-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.cpp
51 lines (42 loc) · 1.19 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* Mainwindow program
*
**/
#include <iostream>
#include "mainwindow.h"
#include "ui_mainwindow.h"
/* Main window contecting the buttons to the lcd
* displays the count
*/
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
this->connect(this->ui->pushButton_2, SIGNAL(clicked()), this,SLOT(on_pushButton_2_clicked()));
this->connect(this->ui->pushButton_3, SIGNAL(clicked()), this,SLOT(on_pushButton_3_clicked()));
this->count=0;
this->ui->lcdNumber->display(count);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked() //!< a Button fucntion that outputs that it was pressed
{
std::cout << "pushbutton " << std::endl;
}
void MainWindow::on_pushButton_2_clicked() //!< a Button function that increments by 1.
{
count=count+1; //!< increment count by 1 */
this->ui->lcdNumber->display(count);
//std::cout << "increment by 1" << std::endl;
}
void MainWindow::on_lcdNumber_overflow()
{
}
void MainWindow::on_pushButton_3_clicked() //!< a Button function that decremetns by 1.
{
count=count-1; //!< decrement count by 1 */
this->ui->lcdNumber->display(count);
}