-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuibuilders.cpp
More file actions
74 lines (56 loc) · 2.05 KB
/
Copy pathuibuilders.cpp
File metadata and controls
74 lines (56 loc) · 2.05 KB
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
71
72
73
74
#include "uibuilders.h"
void ui_functionControls(QTabWidget *t, QPushButton *clear, QPushButton *cancel, QPushButton *apply, QComboBox *mode, GraphController *g) {
QWidget *container = new QWidget();
QHBoxLayout *topBox = new QHBoxLayout();
topBox->addWidget(new QLabel("Function"));
topBox->addWidget(new InputEdit());
QHBoxLayout *middleBox = new QHBoxLayout();
QListWidget *subfunc = new QListWidget();
ui_functionControls_subfuncs(subfunc);
middleBox->addWidget(subfunc);
QHBoxLayout *bottomBox = new QHBoxLayout();
QComboBox *presets = new QComboBox();
ui_functionControls_presets(presets);
bottomBox->addWidget(new QLabel("Load Preset"));
bottomBox->addWidget(presets);
bottomBox->addSpacerItem(new QSpacerItem(40, 20));
bottomBox->addWidget(new QLabel("Mode"));
ui_functionControls_mode(mode);
bottomBox->addWidget(mode);
bottomBox->addSpacerItem(new QSpacerItem(40, 20, QSizePolicy::Expanding));
ui_functionControls_clear(clear, g);
ui_functionControls_cancel(cancel);
ui_functionControls_apply(apply, g);
bottomBox->addWidget(clear);
bottomBox->addWidget(cancel);
bottomBox->addWidget(apply);
QVBoxLayout *layout = new QVBoxLayout();
layout->addLayout(topBox);
layout->addLayout(middleBox);
layout->addLayout(bottomBox);
container->setLayout(layout);
t->addTab(container, "Function");
}
void ui_functionControls_apply(QPushButton *apply, GraphController *g) {
apply->setText("Apply Changes");
}
void ui_functionControls_cancel(QPushButton *cancel) {
cancel->setText("Cancel");
}
void ui_functionControls_clear(QPushButton *clear, GraphController *g) {
clear->setText("Clear Graphs");
QObject::connect(clear, SIGNAL(pressed()), g, SLOT(s_clear()) );
}
void ui_functionControls_mode(QComboBox *mode) {
mode->addItem("Point");
mode->addItem("Iterate");
}
void ui_functionControls_presets(QComboBox *presets) {
presets->setDuplicatesEnabled(false);
presets->addItem("Linear");
presets->addItem("Polar Linear");
presets->addItem("Quadratic");
presets->addItem("Inverse Quadratic");
}
void ui_functionControls_subfuncs(QListWidget *l) {
}