-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.cpp
More file actions
54 lines (43 loc) · 1000 Bytes
/
Copy pathform.cpp
File metadata and controls
54 lines (43 loc) · 1000 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "form.h"
#include "ui_form.h"
#include "avl.h"
#include <QGraphicsView>
#include <QTextStream>
#include <QProcess>
#include <QTextEdit>
#include <QMessageBox>
Form::Form(QWidget *parent) :
QWidget(parent),
ui(new Ui::Form)
{
ui->setupUi(this);
view = new QGraphicsView(&scene) ;
view->setRenderHints(QPainter::SmoothPixmapTransform);
a = new AVL () ;
a->init(&scene , view) ;
}
Form::~Form()
{
delete ui;
}
void Form::on_pushButton_clicked()
{
a->insert(ui->lineEdit->text().toInt());
a->show();
}
void Form::on_pushButton_2_clicked()
{
a->deleteNode(ui->lineEdit_2->text().toInt());
a->show();
}
void Form::on_pushButton_3_clicked()
{
bool temp = a->findElem(ui->lineEdit_3->text().toInt()) ;
if (temp == true)
{
QMessageBox::information(this,tr("AVL"),tr("Found"));
}else
{
QMessageBox::information(this,tr("AVL"),tr(" not Found"));
}
}