-
Notifications
You must be signed in to change notification settings - Fork 0
/
dialog.cpp
executable file
·48 lines (32 loc) · 1.18 KB
/
dialog.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
#include "dialog.h"
#include <QPushButton>
#include <QDebug>
ListFoundedItemsDialog::ListFoundedItemsDialog (QWidget* pwgt/*= 0*/)
: QDialog (pwgt, Qt::WindowTitleHint | Qt::WindowSystemMenuHint)
{
buttonOK = new QPushButton (tr("OK"));
buttonCancel = new QPushButton (tr("Cancel"));
buttonSelectAll = new QPushButton (tr("SelectALL"));
connect (buttonOK, SIGNAL(clicked()), SLOT (accept()));
connect (buttonCancel, SIGNAL(clicked()), SLOT (reject()));
//Layout setup
myLayout = new QGridLayout;
myLayout->addWidget (buttonOK, 1, 0);
myLayout->addWidget (buttonCancel, 1, 1);
setLayout(myLayout);
resize(pwgt->size());
label = new QLabel("");
}
void ListFoundedItemsDialog::setMessage(MainTableWidget **table) {
myTable = *table;
myLayout->addWidget(myTable, 0, 0, 1, 3);
myLayout->addWidget(buttonSelectAll, 1, 2);
connect(buttonSelectAll, SIGNAL(clicked()), myTable, SLOT(selectAllItems()));
}
void ListFoundedItemsDialog::setMessage(QString error) {
label->setText(error);
label->setAlignment(Qt::AlignCenter);
label->setAcceptDrops(true);
myLayout->addWidget (label, 0, 0, 1, 0);
this->resize(300, 70);
}