/
qhuabanxhform.cpp
46 lines (40 loc) · 1.25 KB
/
qhuabanxhform.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "qhuabanxhform.h"
#include"globaldata.h"
#include "data.h"
QHuabanXhForm::QHuabanXhForm(QWidget *parent) :
QDialog(parent){
setupUi(this);
///////////////////////////////
setWindowFlags(Qt::FramelessWindowHint);
QCntLoopModel *loopmodel = new QCntLoopModel(&patternData,this);
QMdItemDelegate *delegate = new QMdItemDelegate(this);
delegate->setRange(1,patternData.tatalcntrow);
delegate->setRange(1,20000,-1,2);
tableView->setModel(loopmodel);
tableView->setItemDelegate(delegate);
connect(loopmodel,SIGNAL(datasValid(bool)),pushButton_4,SLOT(setEnabled(bool)));
///////////////////////////////
}
void QHuabanXhForm::on_pushButton_clicked()
{
tableView->model()->insertRow(tableView->currentIndex().row()+1,QModelIndex());
}
void QHuabanXhForm::on_pushButton_2_clicked()
{
tableView->model()->removeRow(tableView->currentIndex().row());
}
void QHuabanXhForm::on_pushButton_5_clicked()
{
this->reject();
this->deleteLater();
}
void QHuabanXhForm::on_pushButton_4_clicked()
{
qobject_cast<QCntLoopModel *>(tableView->model())->save();
}
void QHuabanXhForm::on_pushButton_3_clicked()
{
QCntLoopModel *model;
model = qobject_cast<QCntLoopModel *>(tableView->model());
model->resetVal();
}