-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
40 lines (33 loc) · 772 Bytes
/
mainwindow.cpp
File metadata and controls
40 lines (33 loc) · 772 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
36
37
38
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QMessageBox>
#include"sub_window.h"
extern int num;
extern int ch;
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->QLineEdit_Process_Num->setPlaceholderText("input number...");
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_Input_clicked()
{
QString text=ui->QLineEdit_Process_Num->text();
num=text.toInt();
//QMessageBox::information(this,"my",text);
if(num==0||num<4||num>10)
{
QMessageBox::warning(this,"Waring","You input a wrong number!");
}
else
{
sub_window sub_window;
sub_window.setModal(true);
sub_window.exec();
}
}