-
Notifications
You must be signed in to change notification settings - Fork 0
/
GraphDialog2.cpp
70 lines (59 loc) · 1.66 KB
/
GraphDialog2.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "GraphDialog2.h"
#include "ui_GraphDialog2.h"
GraphDialog2::GraphDialog2(QWidget *parent) :
QWidget(parent),
ui(new Ui::GraphDialog2)
{
ui->setupUi(this);
m_drawDialog = new MinMaxDrawDialog();
ui->paintLayout->insertWidget(1, m_drawDialog);
connect(m_drawDialog, SIGNAL(userAnswerFalse()), SLOT(replyUserError()));
connect(m_drawDialog, SIGNAL(result(QPointF,QPointF,qreal,qreal)), this, SLOT(replyResult(QPointF,QPointF,qreal,qreal)));
// ui->scaleSpinBox->setFocus();
}
GraphDialog2::~GraphDialog2()
{
delete ui;
}
void GraphDialog2::showHint()
{
m_drawDialog->setCorrectAnswer();
}
void GraphDialog2::setCondition(double **array, quint8 rows)
{
ui->scaleSpinBox->setValue(1);
m_drawDialog->drawTheProblem(array, rows);
}
void GraphDialog2::replyUserError()
{
emit userError();
}
void GraphDialog2::replyResult(QPointF min, QPointF max, qreal minZ, qreal maxZ)
{
emit result(min, max, minZ, maxZ);
}
void GraphDialog2::on_nextButton_clicked()
{
if(!m_drawDialog->check())
QMessageBox::information(this, QString::fromLocal8Bit("Ошибки!"),
QString::fromLocal8Bit("Не верно выбран минимум или максимум функции Z!"),
QMessageBox::Ok);
else
emit next();
}
void GraphDialog2::on_backButton_clicked()
{
emit back();
}
void GraphDialog2::on_scaleSpinBox_valueChanged(double arg1)
{
m_drawDialog->setScale(qreal(arg1));
}
void GraphDialog2::on_nextMinButton_clicked()
{
m_drawDialog->nextMin();
}
void GraphDialog2::on_nextMaxButton_clicked()
{
m_drawDialog->nextMax();
}