-
Notifications
You must be signed in to change notification settings - Fork 0
/
basecentraldock.h
58 lines (41 loc) · 1.27 KB
/
basecentraldock.h
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
#ifndef BASECENTRALDOCK_H
#define BASECENTRALDOCK_H
#include <QObject>
#include <QDockWidget>
#include <QPushButton>
#include <QHBoxLayout>
#include <QMainWindow>
#include <QMenu>
QT_FORWARD_DECLARE_CLASS(BaseProjectController)
//Base class for dock widget in central window
class BaseCentralDock : public QDockWidget
{
Q_OBJECT
public:
explicit BaseCentralDock(const QString& title = "",
QMainWindow* parent = nullptr,
Qt::WindowFlags flags = {});
virtual Qt::DockWidgetArea getDefaultArea() const;
QMenu *getMenu();
//---Translate signals from Titlebar to parent window
signals:
void onCreateDock(bool); //Create new independent widget
void onSplitDock(BaseCentralDock*, Qt::Orientation); //Split this widget
void onTabDock(BaseCentralDock*); //Add a new widget to a tab
//---Events---
private slots:
void closeWidgetSlot(bool);
void onTopLevelChanged(bool);
//---Private methods
private:
//---Events
private:
void closeEvent(QCloseEvent*) override;
void changeEvent(QEvent*) override;
void contextMenuEvent(QContextMenuEvent *event) override;
protected:
QWidget *_titleWidget;
Qt::WindowFlags _flags;
QMenu *_menu;
};
#endif // BASECENTRALDOCK_H