mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-04-20 20:34:45 +08:00
FIX: Update Python SIP bindings 3.2.1 & Linux Crash (#126)
* (Python) WIP: attempt to update to 3.2.0 * (Python) MAINT: move demo.py to demo/ to avoid PyQtAds import issue * (Python) STY: remove trailing whitespace * (Python) Missing/incorrect /Transfer/ annotations * (Python) n-elie's fix for setup.py moc generation * (Python) FIX: Q_OS_LINUX is not defined by default with moc * (Python) FIX: split FloatingDockContainer.sip to be platform-specific %If (Platform) blocks around the class definition in FloatingDockContainer.sip did not seem to work. Co-authored-by: K Lauer <klauer@users.noreply.github.com>
This commit is contained in:
parent
dec170ed24
commit
c90fb9413c
16
setup.py
16
setup.py
@ -198,16 +198,28 @@ class build_ext(sipdistutils.build_ext):
|
|||||||
|
|
||||||
dir_util.mkpath(self.build_temp, dry_run=self.dry_run)
|
dir_util.mkpath(self.build_temp, dry_run=self.dry_run)
|
||||||
|
|
||||||
|
def get_moc_args(out_file, source):
|
||||||
|
if sys.platform.startswith('linux'):
|
||||||
|
return ["moc", "-D", "Q_OS_LINUX=1", "-o", out_file, source]
|
||||||
|
return ["moc", "-o", out_file, source]
|
||||||
|
|
||||||
# Run moc on all header files.
|
# Run moc on all header files.
|
||||||
for source in cppsources:
|
for source in cppsources:
|
||||||
|
# *.cpp -> *.moc
|
||||||
|
moc_file = os.path.basename(source).replace(".cpp", ".moc")
|
||||||
|
out_file = os.path.join(self.build_temp, moc_file)
|
||||||
|
|
||||||
|
if newer(source, out_file) or self.force:
|
||||||
|
spawn.spawn(get_moc_args(out_file, source), dry_run=self.dry_run)
|
||||||
|
|
||||||
header = source.replace(".cpp", ".h")
|
header = source.replace(".cpp", ".h")
|
||||||
if os.path.exists(header):
|
if os.path.exists(header):
|
||||||
|
# *.h -> moc_*.cpp
|
||||||
moc_file = "moc_" + os.path.basename(header).replace(".h", ".cpp")
|
moc_file = "moc_" + os.path.basename(header).replace(".h", ".cpp")
|
||||||
out_file = os.path.join(self.build_temp, moc_file)
|
out_file = os.path.join(self.build_temp, moc_file)
|
||||||
|
|
||||||
if newer(header, out_file) or self.force:
|
if newer(header, out_file) or self.force:
|
||||||
call_arg = ["moc", "-o", out_file, header]
|
spawn.spawn(get_moc_args(out_file, header), dry_run=self.dry_run)
|
||||||
spawn.spawn(call_arg, dry_run=self.dry_run)
|
|
||||||
|
|
||||||
if os.path.getsize(out_file) > 0:
|
if os.path.getsize(out_file) > 0:
|
||||||
ext.sources.append(out_file)
|
ext.sources.append(out_file)
|
||||||
|
@ -13,14 +13,6 @@ class CDockAreaTabBar : QScrollArea
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void wheelEvent(QWheelEvent* Event);
|
virtual void wheelEvent(QWheelEvent* Event);
|
||||||
virtual void mousePressEvent(QMouseEvent* ev);
|
|
||||||
virtual void mouseReleaseEvent(QMouseEvent* ev);
|
|
||||||
virtual void mouseMoveEvent(QMouseEvent* ev);
|
|
||||||
virtual void mouseDoubleClickEvent(QMouseEvent *event);
|
|
||||||
void startFloating(const QPoint& Offset);
|
|
||||||
ads::IFloatingWidget* makeAreaFloating(const QPoint& Offset,
|
|
||||||
ads::eDragState DragState);
|
|
||||||
ads::eDragState dragState() const;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CDockAreaTabBar(ads::CDockAreaWidget* parent /TransferThis/);
|
CDockAreaTabBar(ads::CDockAreaWidget* parent /TransferThis/);
|
||||||
@ -35,6 +27,7 @@ public:
|
|||||||
bool isTabOpen(int Index) const;
|
bool isTabOpen(int Index) const;
|
||||||
virtual QSize minimumSizeHint() const;
|
virtual QSize minimumSizeHint() const;
|
||||||
virtual QSize sizeHint() const;
|
virtual QSize sizeHint() const;
|
||||||
|
void elidedChanged(bool elided);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setCurrentIndex(int Index);
|
void setCurrentIndex(int Index);
|
||||||
|
@ -11,6 +11,13 @@ class CDockAreaTitleBar : QFrame
|
|||||||
#include <DockAreaTitleBar.h>
|
#include <DockAreaTitleBar.h>
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void mousePressEvent(QMouseEvent* ev);
|
||||||
|
virtual void mouseReleaseEvent(QMouseEvent* ev);
|
||||||
|
virtual void mouseMoveEvent(QMouseEvent* ev);
|
||||||
|
virtual void mouseDoubleClickEvent(QMouseEvent *event);
|
||||||
|
virtual void contextMenuEvent(QContextMenuEvent *event);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void markTabsMenuOutdated();
|
void markTabsMenuOutdated();
|
||||||
|
|
||||||
@ -20,7 +27,10 @@ public:
|
|||||||
virtual ~CDockAreaTitleBar();
|
virtual ~CDockAreaTitleBar();
|
||||||
ads::CDockAreaTabBar* tabBar() const;
|
ads::CDockAreaTabBar* tabBar() const;
|
||||||
QAbstractButton* button(ads::TitleBarButton which) const;
|
QAbstractButton* button(ads::TitleBarButton which) const;
|
||||||
|
void updateDockWidgetActionsButtons();
|
||||||
virtual void setVisible(bool Visible);
|
virtual void setVisible(bool Visible);
|
||||||
|
void insertWidget(int index, QWidget *widget /Transfer/ );
|
||||||
|
int indexOf(QWidget *widget) const;
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -42,12 +42,16 @@ public:
|
|||||||
int currentIndex() const;
|
int currentIndex() const;
|
||||||
int indexOfFirstOpenDockWidget() const;
|
int indexOfFirstOpenDockWidget() const;
|
||||||
ads::CDockWidget* currentDockWidget() const;
|
ads::CDockWidget* currentDockWidget() const;
|
||||||
void setCurrentDockWidget(ads::CDockWidget* DockWidget /Transfer/);
|
void setCurrentDockWidget(ads::CDockWidget* DockWidget);
|
||||||
void saveState(QXmlStreamWriter& Stream) const;
|
void saveState(QXmlStreamWriter& Stream) const;
|
||||||
ads::CDockWidget::DockWidgetFeatures features() const;
|
ads::CDockWidget::DockWidgetFeatures features(ads::eBitwiseOperator Mode = ads::BitwiseAnd) const;
|
||||||
QAbstractButton* titleBarButton(ads::TitleBarButton which) const;
|
QAbstractButton* titleBarButton(ads::TitleBarButton which) const;
|
||||||
virtual void setVisible(bool Visible);
|
virtual void setVisible(bool Visible);
|
||||||
|
|
||||||
|
void setAllowedAreas(DockWidgetAreas areas);
|
||||||
|
DockWidgetAreas allowedAreas() const;
|
||||||
|
CDockAreaTitleBar* titleBar() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setCurrentIndex(int index);
|
void setCurrentIndex(int index);
|
||||||
void closeArea();
|
void closeArea();
|
||||||
|
26
sip/DockComponentsFactory.sip
Normal file
26
sip/DockComponentsFactory.sip
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
%If (Qt_5_0_0 -)
|
||||||
|
|
||||||
|
namespace ads
|
||||||
|
{
|
||||||
|
|
||||||
|
class CDockComponentsFactory
|
||||||
|
{
|
||||||
|
|
||||||
|
%TypeHeaderCode
|
||||||
|
#include <DockComponentsFactory.h>
|
||||||
|
%End
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual ~CDockComponentsFactory();
|
||||||
|
virtual CDockWidgetTab* createDockWidgetTab(CDockWidget* DockWidget /Transfer/ ) const;
|
||||||
|
virtual CDockAreaTabBar* createDockAreaTabBar(CDockAreaWidget* DockArea /Transfer/ ) const;
|
||||||
|
virtual CDockAreaTitleBar* createDockAreaTitleBar(CDockAreaWidget* DockArea /Transfer/ ) const;
|
||||||
|
static const CDockComponentsFactory* factory();
|
||||||
|
static void setFactory(CDockComponentsFactory* Factory);
|
||||||
|
static void resetDefaultFactory();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
%End
|
@ -25,11 +25,10 @@ protected:
|
|||||||
void dropFloatingWidget(ads::CFloatingDockContainer* FloatingWidget, const QPoint& TargetPos);
|
void dropFloatingWidget(ads::CFloatingDockContainer* FloatingWidget, const QPoint& TargetPos);
|
||||||
void dropWidget(QWidget* widget, const QPoint& TargetPos);
|
void dropWidget(QWidget* widget, const QPoint& TargetPos);
|
||||||
void addDockArea(ads::CDockAreaWidget* DockAreaWidget /Transfer/, ads::DockWidgetArea area = ads::CenterDockWidgetArea);
|
void addDockArea(ads::CDockAreaWidget* DockAreaWidget /Transfer/, ads::DockWidgetArea area = ads::CenterDockWidgetArea);
|
||||||
void removeDockArea(ads::CDockAreaWidget* area /Transfer/);
|
void removeDockArea(ads::CDockAreaWidget* area /TransferBack/);
|
||||||
void saveState(QXmlStreamWriter& Stream) const;
|
void saveState(QXmlStreamWriter& Stream) const;
|
||||||
bool restoreState(CDockingStateReader& Stream, bool Testing);
|
bool restoreState(CDockingStateReader& Stream, bool Testing);
|
||||||
ads::CDockAreaWidget* lastAddedDockAreaWidget(ads::DockWidgetArea area) const;
|
ads::CDockAreaWidget* lastAddedDockAreaWidget(ads::DockWidgetArea area) const;
|
||||||
bool hasTopLevelDockWidget() const;
|
|
||||||
ads::CDockWidget* topLevelDockWidget() const;
|
ads::CDockWidget* topLevelDockWidget() const;
|
||||||
ads::CDockAreaWidget* topLevelDockArea() const;
|
ads::CDockAreaWidget* topLevelDockArea() const;
|
||||||
QList<ads::CDockWidget*> dockWidgets() const;
|
QList<ads::CDockWidget*> dockWidgets() const;
|
||||||
@ -88,6 +87,7 @@ public:
|
|||||||
* If all dock widgets in a dock area are closed, the dock area will be closed
|
* If all dock widgets in a dock area are closed, the dock area will be closed
|
||||||
*/
|
*/
|
||||||
QList<ads::CDockAreaWidget*> openedDockAreas() const;
|
QList<ads::CDockAreaWidget*> openedDockAreas() const;
|
||||||
|
bool hasTopLevelDockWidget() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of dock areas in this container
|
* Returns the number of dock areas in this container
|
||||||
|
@ -156,7 +156,16 @@ public:
|
|||||||
DragPreviewIsDynamic,
|
DragPreviewIsDynamic,
|
||||||
DragPreviewShowsContentPixmap,
|
DragPreviewShowsContentPixmap,
|
||||||
DragPreviewHasWindowFrame,
|
DragPreviewHasWindowFrame,
|
||||||
DefaultConfig,
|
AlwaysShowTabs,
|
||||||
|
DockAreaHasUndockButton,
|
||||||
|
DockAreaHasTabsMenuButton,
|
||||||
|
DockAreaHideDisabledButtons,
|
||||||
|
DockAreaDynamicTabsMenuButtonVisibility,
|
||||||
|
FloatingContainerHasWidgetTitle,
|
||||||
|
FloatingContainerHasWidgetIcon,
|
||||||
|
DefaultDockAreaButtons,
|
||||||
|
DefaultBaseConfig,
|
||||||
|
DefaultOpaqueConfig,
|
||||||
DefaultNonOpaqueConfig,
|
DefaultNonOpaqueConfig,
|
||||||
NonOpaqueWithWindowFrame,
|
NonOpaqueWithWindowFrame,
|
||||||
};
|
};
|
||||||
@ -167,6 +176,7 @@ public:
|
|||||||
static ads::CDockManager::ConfigFlags configFlags();
|
static ads::CDockManager::ConfigFlags configFlags();
|
||||||
static void setConfigFlags(const ads::CDockManager::ConfigFlags Flags);
|
static void setConfigFlags(const ads::CDockManager::ConfigFlags Flags);
|
||||||
static void setConfigFlag(ads::CDockManager::eConfigFlag Flag, bool On = true);
|
static void setConfigFlag(ads::CDockManager::eConfigFlag Flag, bool On = true);
|
||||||
|
static bool testConfigFlag(eConfigFlag Flag);
|
||||||
static ads::CIconProvider& iconProvider();
|
static ads::CIconProvider& iconProvider();
|
||||||
ads::CDockAreaWidget* addDockWidget(ads::DockWidgetArea area, ads::CDockWidget* Dockwidget /Transfer/,
|
ads::CDockAreaWidget* addDockWidget(ads::DockWidgetArea area, ads::CDockWidget* Dockwidget /Transfer/,
|
||||||
ads::CDockAreaWidget* DockAreaWidget /Transfer/ = 0);
|
ads::CDockAreaWidget* DockAreaWidget /Transfer/ = 0);
|
||||||
@ -180,7 +190,7 @@ public:
|
|||||||
QMap<QString, ads::CDockWidget*> dockWidgetsMap() const;
|
QMap<QString, ads::CDockWidget*> dockWidgetsMap() const;
|
||||||
const QList<ads::CDockContainerWidget*> dockContainers() const;
|
const QList<ads::CDockContainerWidget*> dockContainers() const;
|
||||||
const QList<ads::CFloatingDockContainer*> floatingWidgets() const;
|
const QList<ads::CFloatingDockContainer*> floatingWidgets() const;
|
||||||
virtual unsigned int zOrderIndex() const;
|
unsigned int zOrderIndex() const;
|
||||||
QByteArray saveState(int version = 1) const;
|
QByteArray saveState(int version = 1) const;
|
||||||
bool restoreState(const QByteArray &state, int version = 1);
|
bool restoreState(const QByteArray &state, int version = 1);
|
||||||
void addPerspective(const QString& UniquePrespectiveName);
|
void addPerspective(const QString& UniquePrespectiveName);
|
||||||
@ -206,6 +216,7 @@ signals:
|
|||||||
void stateRestored();
|
void stateRestored();
|
||||||
void openingPerspective(const QString& PerspectiveName);
|
void openingPerspective(const QString& PerspectiveName);
|
||||||
void perspectiveOpened(const QString& PerspectiveName);
|
void perspectiveOpened(const QString& PerspectiveName);
|
||||||
|
void floatingWidgetCreated(CFloatingDockContainer* FloatingWidget);
|
||||||
void dockAreaCreated(ads::CDockAreaWidget* DockArea);
|
void dockAreaCreated(ads::CDockAreaWidget* DockArea);
|
||||||
void dockWidgetAboutToBeRemoved(ads::CDockWidget* DockWidget);
|
void dockWidgetAboutToBeRemoved(ads::CDockWidget* DockWidget);
|
||||||
void dockWidgetRemoved(ads::CDockWidget* DockWidget);
|
void dockWidgetRemoved(ads::CDockWidget* DockWidget);
|
||||||
|
@ -21,6 +21,7 @@ protected:
|
|||||||
void emitTopLevelChanged(bool Floating);
|
void emitTopLevelChanged(bool Floating);
|
||||||
void setClosedState(bool Closed);
|
void setClosedState(bool Closed);
|
||||||
void toggleViewInternal(bool Open);
|
void toggleViewInternal(bool Open);
|
||||||
|
bool closeDockWidgetInternal(bool ForceClose = false);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum DockWidgetFeature
|
enum DockWidgetFeature
|
||||||
@ -77,7 +78,7 @@ public:
|
|||||||
QIcon icon() const;
|
QIcon icon() const;
|
||||||
QToolBar* toolBar() const;
|
QToolBar* toolBar() const;
|
||||||
QToolBar* createDefaultToolBar();
|
QToolBar* createDefaultToolBar();
|
||||||
void setToolBar(QToolBar* ToolBar);
|
void setToolBar(QToolBar* ToolBar /Transfer/ );
|
||||||
void setToolBarStyle(Qt::ToolButtonStyle Style, ads::CDockWidget::eState State);
|
void setToolBarStyle(Qt::ToolButtonStyle Style, ads::CDockWidget::eState State);
|
||||||
Qt::ToolButtonStyle toolBarStyle(ads::CDockWidget::eState State) const;
|
Qt::ToolButtonStyle toolBarStyle(ads::CDockWidget::eState State) const;
|
||||||
void setToolBarIconSize(const QSize& IconSize, ads::CDockWidget::eState State);
|
void setToolBarIconSize(const QSize& IconSize, ads::CDockWidget::eState State);
|
||||||
|
@ -30,6 +30,7 @@ public:
|
|||||||
const QIcon& icon() const;
|
const QIcon& icon() const;
|
||||||
QString text() const;
|
QString text() const;
|
||||||
void setText(const QString& title);
|
void setText(const QString& title);
|
||||||
|
bool isTitleElided() const;
|
||||||
bool isClosable() const;
|
bool isClosable() const;
|
||||||
virtual bool event(QEvent *e);
|
virtual bool event(QEvent *e);
|
||||||
|
|
||||||
@ -43,6 +44,7 @@ signals:
|
|||||||
void closeRequested();
|
void closeRequested();
|
||||||
void closeOtherTabsRequested();
|
void closeOtherTabsRequested();
|
||||||
void moved(const QPoint& GlobalPos);
|
void moved(const QPoint& GlobalPos);
|
||||||
|
void elidedChanged(bool elided);
|
||||||
}; // class DockWidgetTab
|
}; // class DockWidgetTab
|
||||||
};
|
};
|
||||||
// namespace ads
|
// namespace ads
|
||||||
|
@ -22,7 +22,7 @@ public:
|
|||||||
virtual ~CElidingLabel();
|
virtual ~CElidingLabel();
|
||||||
Qt::TextElideMode elideMode() const;
|
Qt::TextElideMode elideMode() const;
|
||||||
void setElideMode(Qt::TextElideMode mode);
|
void setElideMode(Qt::TextElideMode mode);
|
||||||
|
bool isElided() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual QSize minimumSizeHint() const;
|
virtual QSize minimumSizeHint() const;
|
||||||
@ -33,6 +33,7 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void clicked();
|
void clicked();
|
||||||
void doubleClicked();
|
void doubleClicked();
|
||||||
|
void elidedChanged(bool elided);
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
// NOTE: there is a separate sip/linux/FloatingDockContainer.sip as the base
|
||||||
|
// class for CFloatingDockContainer changes for Linux.
|
||||||
|
|
||||||
%Import QtWidgets/QtWidgetsmod.sip
|
%Import QtWidgets/QtWidgetsmod.sip
|
||||||
|
|
||||||
%If (Qt_5_0_0 -)
|
%If (Qt_5_0_0 -)
|
||||||
@ -46,7 +49,6 @@ protected:
|
|||||||
virtual void closeEvent(QCloseEvent *event);
|
virtual void closeEvent(QCloseEvent *event);
|
||||||
virtual void hideEvent(QHideEvent *event);
|
virtual void hideEvent(QHideEvent *event);
|
||||||
virtual void showEvent(QShowEvent *event);
|
virtual void showEvent(QShowEvent *event);
|
||||||
virtual bool eventFilter(QObject *watched, QEvent *event);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CFloatingDockContainer(ads::CDockManager* DockManager /TransferThis/);
|
CFloatingDockContainer(ads::CDockManager* DockManager /TransferThis/);
|
||||||
|
@ -12,6 +12,10 @@ class CFloatingDragPreview : QWidget, ads::IFloatingWidget
|
|||||||
#include <FloatingDragPreview.h>
|
#include <FloatingDragPreview.h>
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void moveEvent(QMoveEvent *event);
|
||||||
|
virtual void paintEvent(QPaintEvent *e);
|
||||||
|
CFloatingDragPreview(QWidget* Content /TransferThis/, QWidget* parent /TransferThis/);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CFloatingDragPreview(ads::CDockWidget* Content /TransferThis/ );
|
CFloatingDragPreview(ads::CDockWidget* Content /TransferThis/ );
|
||||||
@ -21,6 +25,7 @@ public:
|
|||||||
|
|
||||||
virtual bool eventFilter(QObject* watched, QEvent* event);
|
virtual bool eventFilter(QObject* watched, QEvent* event);
|
||||||
|
|
||||||
|
public: // implements IFloatingWidget
|
||||||
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
|
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
|
||||||
ads::eDragState DragState, QWidget* MouseEventHandler);
|
ads::eDragState DragState, QWidget* MouseEventHandler);
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
%Include DockAreaTabBar.sip
|
%Include DockAreaTabBar.sip
|
||||||
%Include DockAreaTitleBar.sip
|
%Include DockAreaTitleBar.sip
|
||||||
%Include DockAreaWidget.sip
|
%Include DockAreaWidget.sip
|
||||||
|
%Include DockComponentsFactory.sip
|
||||||
%Include DockContainerWidget.sip
|
%Include DockContainerWidget.sip
|
||||||
%Include DockingStateReader.sip
|
%Include DockingStateReader.sip
|
||||||
%Include DockManager.sip
|
%Include DockManager.sip
|
||||||
@ -15,9 +16,12 @@
|
|||||||
%Include DockSplitter.sip
|
%Include DockSplitter.sip
|
||||||
%Include DockWidgetTab.sip
|
%Include DockWidgetTab.sip
|
||||||
%Include ElidingLabel.sip
|
%Include ElidingLabel.sip
|
||||||
%Include FloatingDockContainer.sip
|
|
||||||
%Include FloatingDragPreview.sip
|
%Include FloatingDragPreview.sip
|
||||||
%Include IconProvider.sip
|
%Include IconProvider.sip
|
||||||
%If (Linux)
|
%If (Linux)
|
||||||
|
%Include linux/FloatingDockContainer.sip
|
||||||
%Include linux/FloatingWidgetTitleBar.sip
|
%Include linux/FloatingWidgetTitleBar.sip
|
||||||
%End
|
%End
|
||||||
|
%If (!Linux)
|
||||||
|
%Include FloatingDockContainer.sip
|
||||||
|
%End
|
||||||
|
@ -49,6 +49,12 @@ namespace ads
|
|||||||
IconCount,
|
IconCount,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum eBitwiseOperator
|
||||||
|
{
|
||||||
|
BitwiseAnd,
|
||||||
|
BitwiseOr
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
%End
|
%End
|
67
sip/linux/FloatingDockContainer.sip
Normal file
67
sip/linux/FloatingDockContainer.sip
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
// NOTE: this is the Linux version, with QDockWidget as the
|
||||||
|
// CFloatingDockContainer base class.
|
||||||
|
|
||||||
|
%Import QtWidgets/QtWidgetsmod.sip
|
||||||
|
|
||||||
|
%If (Qt_5_0_0 -)
|
||||||
|
|
||||||
|
namespace ads
|
||||||
|
{
|
||||||
|
|
||||||
|
class IFloatingWidget
|
||||||
|
{
|
||||||
|
%TypeHeaderCode
|
||||||
|
#include <FloatingDockContainer.h>
|
||||||
|
%End
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
|
||||||
|
ads::eDragState DragState, QWidget* MouseEventHandler) = 0;
|
||||||
|
|
||||||
|
virtual void moveFloating() = 0;
|
||||||
|
virtual void finishDragging() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class CFloatingDockContainer : QDockWidget, ads::IFloatingWidget
|
||||||
|
{
|
||||||
|
|
||||||
|
%TypeHeaderCode
|
||||||
|
#include <FloatingDockContainer.h>
|
||||||
|
%End
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
|
||||||
|
ads::eDragState DragState, QWidget* MouseEventHandler);
|
||||||
|
void startDragging(const QPoint& DragStartMousePos, const QSize& Size,
|
||||||
|
QWidget* MouseEventHandler);
|
||||||
|
virtual void finishDragging();
|
||||||
|
void initFloatingGeometry(const QPoint& DragStartMousePos, const QSize& Size);
|
||||||
|
void moveFloating();
|
||||||
|
bool restoreState(ads::CDockingStateReader& Stream, bool Testing);
|
||||||
|
void updateWindowTitle();
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void changeEvent(QEvent *event);
|
||||||
|
virtual void moveEvent(QMoveEvent *event);
|
||||||
|
virtual bool event(QEvent *e);
|
||||||
|
virtual void closeEvent(QCloseEvent *event);
|
||||||
|
virtual void hideEvent(QHideEvent *event);
|
||||||
|
virtual void showEvent(QShowEvent *event);
|
||||||
|
|
||||||
|
public:
|
||||||
|
CFloatingDockContainer(ads::CDockManager* DockManager /TransferThis/);
|
||||||
|
CFloatingDockContainer(ads::CDockAreaWidget* DockArea /TransferThis/);
|
||||||
|
CFloatingDockContainer(ads::CDockWidget* DockWidget /TransferThis/);
|
||||||
|
virtual ~CFloatingDockContainer();
|
||||||
|
ads::CDockContainerWidget* dockContainer() const;
|
||||||
|
bool isClosable() const;
|
||||||
|
bool hasTopLevelDockWidget() const;
|
||||||
|
ads::CDockWidget* topLevelDockWidget() const;
|
||||||
|
QList<ads::CDockWidget*> dockWidgets() const;
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
%End
|
Loading…
Reference in New Issue
Block a user