QtCanpool 3.3.0
载入中...
搜索中...
未找到
dockfloatingcontainer.h
浏览该文件的文档.
1
5#pragma once
6
7#include "qxdock_global.h"
9
10#if QX_DOCK_X11
11#include <QDockWidget>
12#define DockFloatingContainerBase QDockWidget
13#else
14#include <QWidget>
15#define DockFloatingContainerBase QWidget
16#endif
17
19
20class DockWindow;
21class DockPanel;
22class DockWidget;
23class DockContainer;
24class DockStateReader;
25
26class DockFloatingContainerPrivate;
27
35{
36 Q_OBJECT
37public:
39public:
41 explicit DockFloatingContainer(DockPanel *panel);
42 explicit DockFloatingContainer(DockWidget *widget);
43 virtual ~DockFloatingContainer();
44
45 bool isClosable() const;
46
47 DockContainer *dockContainer() const;
48
49 DockWidget *topLevelDockWidget() const;
50 QList<DockWidget *> dockWidgets() const;
51 bool hasTopLevelDockWidget() const;
52
53 void finishDropOperation();
54
55#if QX_DOCK_X11
56 void onMaximizeRequest();
57 void showNormal(bool fixGeometry = false);
58 void showMaximized();
59 bool isMaximized() const;
60 void show();
61 bool hasNativeTitleBar();
62#endif
63
64private Q_SLOTS:
65 void onDockAreasAddedOrRemoved();
66 void onDockAreaCurrentChanged(int index);
67protected:
68 virtual void startFloating(const QPoint &dragStartMousePos, const QSize &size, Qx::DockDragState dragState,
69 QWidget *mouseEventHandler) override;
70 virtual void finishDragging() override;
71 void moveFloating() override;
72
73 void deleteContent();
74 void updateWindowTitle();
75
76 bool restoreState(DockStateReader &stream, bool testing);
77protected:
78 virtual void closeEvent(QCloseEvent *event) override;
79 virtual void hideEvent(QHideEvent *event) override;
80 virtual void showEvent(QShowEvent *event) override;
81 virtual void changeEvent(QEvent *event) override;
82
83#ifdef Q_OS_MACOS
84 virtual bool event(QEvent *e) override;
85 virtual void moveEvent(QMoveEvent *e) override;
86#elif QX_DOCK_X11
87 virtual void moveEvent(QMoveEvent *e) override;
88 virtual void resizeEvent(QResizeEvent *e) override;
89 virtual bool event(QEvent *e) override;
90#endif
91
92#ifdef Q_OS_WIN
96#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
97 virtual bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
98#else
99 virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
100#endif
101#endif
102private:
104 friend class DockWindow;
105 friend class DockWidget;
106 friend class DockPanel;
107 friend class DockWindowPrivate;
109};
110
Container that manages a number of dock panels with single dock widgets or tabyfied dock widgets in e...
This implements a floating widget that is a dock container that accepts docking of dock widgets like ...
Pure virtual interface for floating widgets.
virtual void finishDragging()=0
Tells the widget that to finish dragging if the mouse is released.
virtual void moveFloating()=0
Moves the widget to a new position relative to the position given when startFloating() was called.
virtual void startFloating(const QPoint &dragStartMousePos, const QSize &size, Qx::DockDragState dragState, QWidget *mouseEventHandler)=0
Starts floating.
DockPanel manages multiple instances of DockWidgets.
Definition dockpanel.h:31
Extends QXmlStreamReader with file version information
The DockWidget class provides a widget that can be docked inside a DockWindow or floated as a top-lev...
Definition dockwidget.h:31
The central dock window that maintains the complete docking system.
Definition dockwindow.h:36
#define DockFloatingContainerBase
Copyleft (C) 2024 maminjie canpool@163.com SPDX-License-Identifier: MulanPSL-2.0
DockDragState
#define QX_DECLARE_PRIVATE(Class)
#define QX_DOCK_END_NAMESPACE
#define QX_DOCK_BEGIN_NAMESPACE
#define QX_DOCK_EXPORT
QColor window