-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtestwindow1.h
More file actions
executable file
·43 lines (31 loc) · 959 Bytes
/
testwindow1.h
File metadata and controls
executable file
·43 lines (31 loc) · 959 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
#pragma once
#include "dynamicwindow.h"
#include <QHBoxLayout>
#include <QLabel>
#include <QPushButton>
class TestWindow1 : public DynamicWindow {
public:
explicit TestWindow1(QWidget *parent = nullptr)
: DynamicWindow(parent) {
auto *label = new QLabel("aabbcc", this);
auto *layout = new QHBoxLayout(this);
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(label);
setLayout(layout);
toolBar()->addAction("test1");
}
};
class TestWindow2 : public DynamicWindow {
public:
explicit TestWindow2(QWidget *parent = nullptr)
: DynamicWindow(parent) {
auto *btn = new QPushButton("aabbcc", this);
auto *layout = new QHBoxLayout(this);
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0);
layout->addWidget(btn);
setLayout(layout);
toolBar()->addAction("test2");
}
};