Repository navigation
Expand file tree
/
Copy pathSample.cpp
More file actions
50 lines (42 loc) · 1.39 KB
/
Copy pathSample.cpp
File metadata and controls
50 lines (42 loc) · 1.39 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
#include "Sample.h"
#include "QtToolkit/WidgetCreator.h"
#include "GeneralPage.h"
#include "AdsWidgetPage.h"
#include "SelectWidgetPage.h"
#include "ClockPage.h"
#include "StuffLabelPage.h"
#include "AudioWavePage.h"
#include "DSLLayoutPage.h"
#include "ProgressPage.h"
#include "GaugePage.h"
#include "PaginationPage.h"
#include "WidgetTablePage.h"
#include "ObtainSourcePage.h"
Sample::Sample(QWidget* parent) :
QMainWindow(parent) {
setWindowTitle("A sample for QtToolkit library");
setupUi();
appendTab("General", new GeneralPage());
appendTab("Ads", new AdsWidgetPage());
appendTab("Select", new SelectWidgetPage());
appendTab("Clock", new ClockPage());
appendTab("Stuff Label", new StuffLabelPage());
appendTab("Audio Wave", new AudioWavePage());
appendTab("DSL Layout", new DSLLayoutPage());
appendTab("Progress", new ProgressPage());
appendTab("Gauge", new GaugePage());
appendTab("Pagination", new PaginationPage());
appendTab("Widget Table", new WidgetTablePage());
appendTab("Obtain Source Code", new ObtainSourcePage());
}
Sample::~Sample() {}
void Sample::setupUi() {
tab_ = new QTabWidget();
tab_->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setCentralWidget(tab_);
resize(860, 600);
}
void Sample::appendTab(const QString& title, QWidget* widget) {
Q_ASSERT(widget);
tab_->addTab(widget, title);
}