-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.cpp
36 lines (25 loc) · 936 Bytes
/
mainwindow.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
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->colors = new QComboBox;
this->colors->insertItem(0, "Blue");
this->colors->insertItem(1, "Red");
this->colors->insertItem(2, "Yellow");
QObject::connect(this->colors, SIGNAL(currentIndexChanged(int)), this->ui->canvasWidget, SLOT(setColor(int)));
this->ui->mainToolBar->addWidget(this->colors);
this->penWidth = new QComboBox;
this->penWidth->insertItem(2, "Light");
this->penWidth->insertItem(5, "Medium");
this->penWidth->insertItem(8, "Heavy");
this->penWidth->setCurrentIndex(1);
QObject::connect(this->penWidth, SIGNAL(currentIndexChanged(int)), this->ui->canvasWidget, SLOT(setPenWidth(int)));
this->ui->mainToolBar->addWidget(this->penWidth);
}
MainWindow::~MainWindow()
{
delete ui;
}