-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
35 lines (29 loc) · 822 Bytes
/
mainwindow.cpp
File metadata and controls
35 lines (29 loc) · 822 Bytes
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
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QLabel"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->pushButton, SIGNAL(clicked(bool)), this, SLOT(clicked(bool)));
ui->tableWidget->setColumnCount(2);
ui->tableWidget->setRowCount(5);
QLabel *lab = new QLabel();
lab->setText("aaa");
ui->tableWidget->setCellWidget(0,0, lab);
ui->comboBox->addItem("1");
ui->comboBox->addItem("2");
ui->comboBox->addItem("3");
ui->comboBox->addItem("*");
ui->comboBox->setCurrentIndex(3);
ui->tableWidget->setCellWidget(0,1, ui->comboBox);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::clicked(bool)
{
ui->pushButton_2->setVisible(!ui->pushButton_2->isVisible());
}