WIP: Changes between 2.5.2 and 2.7.0.

This commit is contained in:
Hugo Slepicka 2019-12-18 14:21:34 -08:00
parent 2150ebf45e
commit 5778dfe929
11 changed files with 126 additions and 9 deletions

View File

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

View File

@ -18,7 +18,7 @@ protected:
virtual void mouseMoveEvent(QMouseEvent* ev);
virtual void mouseDoubleClickEvent(QMouseEvent *event);
void startFloating(const QPoint& Offset);
ads::CFloatingDockContainer* makeAreaFloating(const QPoint& Offset,
ads::IFloatingWidget* makeAreaFloating(const QPoint& Offset,
ads::eDragState DragState);
public:

View File

@ -23,10 +23,11 @@ protected:
QSplitter* rootSplitter() const;
void createRootSplitter();
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 removeDockArea(ads::CDockAreaWidget* area /Transfer/);
void saveState(QXmlStreamWriter& Stream) const;
bool restoreState(QXmlStreamReader& Stream, bool Testing);
bool restoreState(CDockingStateReader& Stream, bool Testing);
ads::CDockAreaWidget* lastAddedDockAreaWidget(ads::DockWidgetArea area) const;
bool hasTopLevelDockWidget() const;
ads::CDockWidget* topLevelDockWidget() const;

View File

@ -152,7 +152,13 @@ public:
TabCloseButtonIsToolButton,
AllTabsHaveCloseButton,
RetainTabSizeWhenCloseButtonHidden,
OpaqueUndocking,
DragPreviewIsDynamic,
DragPreviewShowsContentPixmap,
DragPreviewHasWindowFrame,
DefaultConfig,
DefaultNonOpaqueConfig,
NonOpaqueWithWindowFrame,
};
typedef QFlags<ads::CDockManager::eConfigFlag> ConfigFlags;
@ -161,20 +167,22 @@ public:
static ads::CDockManager::ConfigFlags configFlags();
static void setConfigFlags(const ads::CDockManager::ConfigFlags Flags);
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* DockAreaWidget /Transfer/ = 0);
ads::CDockAreaWidget* addDockWidgetTab(ads::DockWidgetArea area,
ads::CDockWidget* Dockwidget /Transfer/);
ads::CDockAreaWidget* addDockWidgetTabToArea(ads::CDockWidget* Dockwidget /Transfer/,
ads::CDockAreaWidget* DockAreaWidget /Transfer/);
ads::CFloatingDockContainer* addDockWidgetFloating(ads::CDockWidget* DockWidget /Transfer/);
ads::CDockWidget* findDockWidget(const QString& ObjectName) const;
void removeDockWidget(ads::CDockWidget* Dockwidget) /TransferBack/;
QMap<QString, ads::CDockWidget*> dockWidgetsMap() const;
const QList<ads::CDockContainerWidget*> dockContainers() const;
const QList<ads::CFloatingDockContainer*> floatingWidgets() const;
virtual unsigned int zOrderIndex() const;
QByteArray saveState(int version = 0) const;
bool restoreState(const QByteArray &state, int version = 0);
QByteArray saveState(int version = 1) const;
bool restoreState(const QByteArray &state, int version = 1);
void addPerspective(const QString& UniquePrespectiveName);
void removePerspective(const QString& Name);
void removePerspectives(const QStringList& Names);
@ -198,6 +206,7 @@ signals:
void stateRestored();
void openingPerspective(const QString& PerspectiveName);
void perspectiveOpened(const QString& PerspectiveName);
void dockAreaCreated(ads::CDockAreaWidget* DockArea);
};
};

View File

@ -88,6 +88,7 @@ public:
public slots:
void toggleView(bool Open = true);
void setFloating();
signals:
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,21 @@
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;
};
class CFloatingDockContainer : QWidget, ads::IFloatingWidget
{
%TypeHeaderCode
@ -20,7 +34,7 @@ protected:
void finishDragging();
void initFloatingGeometry(const QPoint& DragStartMousePos, const QSize& Size);
void moveFloating();
bool restoreState(QXmlStreamReader& Stream, bool Testing);
bool restoreState(ads::CDockingStateReader& Stream, bool Testing);
void updateWindowTitle();

30
sip/FloatingOverlay.sip Normal file
View File

@ -0,0 +1,30 @@
%Import QtWidgets/QtWidgetsmod.sip
%If (Qt_5_0_0 -)
namespace ads
{
class CFloatingOverlay : QWidget, ads::IFloatingWidget
{
%TypeHeaderCode
#include <FloatingOverlay.h>
%End
public:
CFloatingOverlay(ads::CDockWidget* Content /TransferThis/ );
CFloatingOverlay(ads::CDockAreaWidget* Content /TransferThis/ );
virtual ~CFloatingOverlay();
virtual void startFloating(const QPoint& DragStartMousePos, const QSize& Size,
ads::eDragState DragState, QWidget* MouseEventHandler);
virtual void moveFloating();
};
};
%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 DockAreaWidget.sip
%Include DockContainerWidget.sip
%Include DockingStateReader.sip
%Include DockManager.sip
%Include DockOverlay.sip
%Include DockSplitter.sip
%Include DockWidgetTab.sip
%Include ElidingLabel.sip
%Include FloatingDockContainer.sip
%Include FloatingOverlay.sip
%Include IconProvider.sip
%If (Linux)
%Include linux/FloatingWidgetTitleBar.sip
%End

View File

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