Merge pull request #92 from hhslepicka/fix_sip_bindings

FIX: Update SIP Bindings
This commit is contained in:
githubuser0xFFFF 2019-12-19 06:16:11 +01:00 committed by GitHub
commit 65c080ae8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 143 additions and 12 deletions

View File

@ -14,8 +14,8 @@ from PyQt5.QtCore import PYQT_CONFIGURATION
from PyQt5.pyrcc_main import processResourceFile from PyQt5.pyrcc_main import processResourceFile
MAJOR = 2 MAJOR = 2
MINOR = 5 MINOR = 7
MICRO = 1 MICRO = 0
ISRELEASED = True ISRELEASED = True
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
MODULE_NAME = "ads" MODULE_NAME = "ads"

View File

@ -18,9 +18,10 @@ protected:
virtual void mouseMoveEvent(QMouseEvent* ev); virtual void mouseMoveEvent(QMouseEvent* ev);
virtual void mouseDoubleClickEvent(QMouseEvent *event); virtual void mouseDoubleClickEvent(QMouseEvent *event);
void startFloating(const QPoint& Offset); void startFloating(const QPoint& Offset);
ads::CFloatingDockContainer* makeAreaFloating(const QPoint& Offset, ads::IFloatingWidget* makeAreaFloating(const QPoint& Offset,
ads::eDragState DragState); ads::eDragState DragState);
ads::eDragState dragState() const;
public: public:
CDockAreaTabBar(ads::CDockAreaWidget* parent /TransferThis/); CDockAreaTabBar(ads::CDockAreaWidget* parent /TransferThis/);
virtual ~CDockAreaTabBar(); virtual ~CDockAreaTabBar();

View File

@ -23,10 +23,11 @@ protected:
QSplitter* rootSplitter() const; QSplitter* rootSplitter() const;
void createRootSplitter(); void createRootSplitter();
void dropFloatingWidget(ads::CFloatingDockContainer* FloatingWidget, const QPoint& TargetPos); void dropFloatingWidget(ads::CFloatingDockContainer* FloatingWidget, 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 /Transfer/);
void saveState(QXmlStreamWriter& Stream) const; void saveState(QXmlStreamWriter& Stream) const;
bool restoreState(QXmlStreamReader& 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; bool hasTopLevelDockWidget() const;
ads::CDockWidget* topLevelDockWidget() const; ads::CDockWidget* topLevelDockWidget() const;

View File

@ -152,7 +152,13 @@ public:
TabCloseButtonIsToolButton, TabCloseButtonIsToolButton,
AllTabsHaveCloseButton, AllTabsHaveCloseButton,
RetainTabSizeWhenCloseButtonHidden, RetainTabSizeWhenCloseButtonHidden,
OpaqueUndocking,
DragPreviewIsDynamic,
DragPreviewShowsContentPixmap,
DragPreviewHasWindowFrame,
DefaultConfig, DefaultConfig,
DefaultNonOpaqueConfig,
NonOpaqueWithWindowFrame,
}; };
typedef QFlags<ads::CDockManager::eConfigFlag> ConfigFlags; typedef QFlags<ads::CDockManager::eConfigFlag> ConfigFlags;
@ -161,20 +167,22 @@ 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 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);
ads::CDockAreaWidget* addDockWidgetTab(ads::DockWidgetArea area, ads::CDockAreaWidget* addDockWidgetTab(ads::DockWidgetArea area,
ads::CDockWidget* Dockwidget /Transfer/); ads::CDockWidget* Dockwidget /Transfer/);
ads::CDockAreaWidget* addDockWidgetTabToArea(ads::CDockWidget* Dockwidget /Transfer/, ads::CDockAreaWidget* addDockWidgetTabToArea(ads::CDockWidget* Dockwidget /Transfer/,
ads::CDockAreaWidget* DockAreaWidget /Transfer/); ads::CDockAreaWidget* DockAreaWidget /Transfer/);
ads::CFloatingDockContainer* addDockWidgetFloating(ads::CDockWidget* DockWidget /Transfer/);
ads::CDockWidget* findDockWidget(const QString& ObjectName) const; ads::CDockWidget* findDockWidget(const QString& ObjectName) const;
void removeDockWidget(ads::CDockWidget* Dockwidget) /TransferBack/; void removeDockWidget(ads::CDockWidget* Dockwidget) /TransferBack/;
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; virtual unsigned int zOrderIndex() const;
QByteArray saveState(int version = 0) const; QByteArray saveState(int version = 1) const;
bool restoreState(const QByteArray &state, int version = 0); bool restoreState(const QByteArray &state, int version = 1);
void addPerspective(const QString& UniquePrespectiveName); void addPerspective(const QString& UniquePrespectiveName);
void removePerspective(const QString& Name); void removePerspective(const QString& Name);
void removePerspectives(const QStringList& Names); void removePerspectives(const QStringList& Names);
@ -198,8 +206,11 @@ 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 dockAreaCreated(ads::CDockAreaWidget* DockArea);
void dockWidgetAboutToBeRemoved(ads::CDockWidget* DockWidget);
void dockWidgetRemoved(ads::CDockWidget* DockWidget);
}; };
}; };
%End %End

View File

@ -28,6 +28,7 @@ public:
DockWidgetClosable, DockWidgetClosable,
DockWidgetMovable, DockWidgetMovable,
DockWidgetFloatable, DockWidgetFloatable,
DockWidgetDeleteOnClose,
AllDockWidgetFeatures, AllDockWidgetFeatures,
NoDockWidgetFeatures NoDockWidgetFeatures
}; };
@ -88,6 +89,8 @@ public:
public slots: public slots:
void toggleView(bool Open = true); void toggleView(bool Open = true);
void setFloating();
void deleteDockWidget();
signals: signals:
void viewToggled(bool Open); void viewToggled(bool Open);

View File

@ -0,0 +1,21 @@
%If (Qt_5_0_0 -)
namespace ads
{
class CDockingStateReader : QXmlStreamReader
{
%TypeHeaderCode
#include <DockingStateReader.h>
%End
public:
void setFileVersion(int FileVersion);
int fileVersion() const;
};
};
%End

View File

@ -5,7 +5,22 @@
namespace ads namespace ads
{ {
class CFloatingDockContainer : QWidget 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 : QWidget, ads::IFloatingWidget
{ {
%TypeHeaderCode %TypeHeaderCode
@ -13,14 +28,14 @@ class CFloatingDockContainer : QWidget
%End %End
protected: protected:
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);
void startDragging(const QPoint& DragStartMousePos, const QSize& Size, void startDragging(const QPoint& DragStartMousePos, const QSize& Size,
QWidget* MouseEventHandler); QWidget* MouseEventHandler);
void finishDragging(); virtual void finishDragging();
void initFloatingGeometry(const QPoint& DragStartMousePos, const QSize& Size); void initFloatingGeometry(const QPoint& DragStartMousePos, const QSize& Size);
void moveFloating(); void moveFloating();
bool restoreState(QXmlStreamReader& Stream, bool Testing); bool restoreState(ads::CDockingStateReader& Stream, bool Testing);
void updateWindowTitle(); void updateWindowTitle();

View File

@ -0,0 +1,38 @@
%Import QtWidgets/QtWidgetsmod.sip
%If (Qt_5_0_0 -)
namespace ads
{
class CFloatingDragPreview : QWidget, ads::IFloatingWidget
{
%TypeHeaderCode
#include <FloatingDragPreview.h>
%End
public:
CFloatingDragPreview(ads::CDockWidget* Content /TransferThis/ );
CFloatingDragPreview(ads::CDockAreaWidget* Content /TransferThis/ );
virtual ~CFloatingDragPreview();
virtual bool eventFilter(QObject* watched, QEvent* event);
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
ads::eDragState DragState, QWidget* MouseEventHandler);
virtual void moveFloating();
virtual void finishDragging();
signals:
void draggingCanceled();
};
};
%End

28
sip/IconProvider.sip Normal file
View File

@ -0,0 +1,28 @@
%Import QtWidgets/QtWidgetsmod.sip
%If (Qt_5_0_0 -)
namespace ads
{
class CIconProvider
{
%TypeHeaderCode
#include <IconProvider.h>
%End
public:
CIconProvider();
virtual ~CIconProvider();
QIcon customIcon(eIcon IconId);
void registerCustomIcon(eIcon IconId, const QIcon& icon /TransferThis/ );
};
};
%End

View File

@ -9,12 +9,15 @@
%Include DockAreaTitleBar.sip %Include DockAreaTitleBar.sip
%Include DockAreaWidget.sip %Include DockAreaWidget.sip
%Include DockContainerWidget.sip %Include DockContainerWidget.sip
%Include DockingStateReader.sip
%Include DockManager.sip %Include DockManager.sip
%Include DockOverlay.sip %Include DockOverlay.sip
%Include DockSplitter.sip %Include DockSplitter.sip
%Include DockWidgetTab.sip %Include DockWidgetTab.sip
%Include ElidingLabel.sip %Include ElidingLabel.sip
%Include FloatingDockContainer.sip %Include FloatingDockContainer.sip
%Include FloatingDragPreview.sip
%Include IconProvider.sip
%If (Linux) %If (Linux)
%Include linux/FloatingWidgetTitleBar.sip %Include linux/FloatingWidgetTitleBar.sip
%End %End

View File

@ -39,6 +39,16 @@ namespace ads
DraggingFloatingWidget DraggingFloatingWidget
}; };
enum eIcon
{
TabCloseIcon,
DockAreaMenuIcon,
DockAreaUndockIcon,
DockAreaCloseIcon,
IconCount,
};
}; };
%End %End