From 77ed9b066126427b95e6fc793e45f26d85398e52 Mon Sep 17 00:00:00 2001 From: Nicolas Elie <40382614+n-elie@users.noreply.github.com> Date: Wed, 2 Aug 2023 20:23:49 +0200 Subject: [PATCH] Update PyQt bindings to 4.1.1 (#542) --- sip/AutoHideDockContainer.sip | 7 +++++-- sip/AutoHideSideBar.sip | 9 ++++++--- sip/AutoHideTab.sip | 8 ++++++++ sip/DockAreaTabBar.sip | 2 ++ sip/DockAreaTitleBar.sip | 21 +++++++++++++++++++-- sip/DockAreaTitleBar_p.sip | 15 --------------- sip/DockAreaWidget.sip | 6 ++++++ sip/DockContainerWidget.sip | 6 +++--- sip/DockManager.sip | 2 +- sip/DockOverlay.sip | 2 ++ sip/DockWidget.sip | 4 +++- sip/DockWidgetTab.sip | 1 - sip/FloatingDragPreview.sip | 2 +- sip/ads_globals.sip | 14 ++++++++++++++ 14 files changed, 70 insertions(+), 29 deletions(-) diff --git a/sip/AutoHideDockContainer.sip b/sip/AutoHideDockContainer.sip index 7d5a18b..3b13d10 100644 --- a/sip/AutoHideDockContainer.sip +++ b/sip/AutoHideDockContainer.sip @@ -24,9 +24,10 @@ public: CAutoHideDockContainer(ads::CDockWidget* DockWidget /Transfer/, ads::SideBarLocation area, ads::CDockContainerWidget* parent /TransferThis/); virtual ~CAutoHideDockContainer(); - ads::CAutoHideSideBar* sideBar() const; + ads::CAutoHideSideBar* autoHideSideBar() const; ads::CAutoHideTab* autoHideTab() const; ads::CDockWidget* dockWidget() const; + int tabIndex() const; void addDockWidget(ads::CDockWidget* DockWidget /Transfer/); ads::SideBarLocation sideBarLocation() const; void setSideBarLocation(ads::SideBarLocation SideBarLocation); @@ -38,7 +39,9 @@ public: void collapseView(bool Enable); void toggleCollapseState(); void setSize(int Size); - + void resetToInitialDockWidgetSize(); + Qt::Orientation orientation() const; + void moveToNewSideBarLocation(ads::SideBarLocation); }; }; diff --git a/sip/AutoHideSideBar.sip b/sip/AutoHideSideBar.sip index 776ad76..6904748 100644 --- a/sip/AutoHideSideBar.sip +++ b/sip/AutoHideSideBar.sip @@ -24,10 +24,13 @@ public: void removeTab(ads::CAutoHideTab* SideTab) /TransferBack/; ads::CAutoHideDockContainer* insertDockWidget(int Index, ads::CDockWidget* DockWidget /Transfer/); void removeAutoHideWidget(ads::CAutoHideDockContainer* AutoHideWidget) /TransferBack/; - void addAutoHideWidget(ads::CAutoHideDockContainer* AutoHideWidget); + void addAutoHideWidget(ads::CAutoHideDockContainer* AutoHideWidget, int Index); Qt::Orientation orientation() const; - ads::CAutoHideTab* tabAt(int index) const; - int tabCount() const; + ads::CAutoHideTab* tab(int index) const; + int tabAt(const QPoint& Pos) const; + int tabInsertIndexAt(const QPoint& Pos) const; + int indexOfTab(const CAutoHideTab& Tab) const; + int count() const; int visibleTabCount() const; bool hasVisibleTabs() const; ads::SideBarLocation sideBarLocation() const; diff --git a/sip/AutoHideTab.sip b/sip/AutoHideTab.sip index 42e607c..4d72e7b 100644 --- a/sip/AutoHideTab.sip +++ b/sip/AutoHideTab.sip @@ -16,6 +16,10 @@ protected: void setSideBar(ads::CAutoHideSideBar *SideTabBar); void removeFromSideBar(); virtual bool event(QEvent* event); + virtual void contextMenuEvent(QContextMenuEvent* ev); + virtual void mousePressEvent(QMouseEvent* ev); + virtual void mouseReleaseEvent(QMouseEvent* ev); + virtual void mouseMoveEvent(QMouseEvent* ev); public: CAutoHideTab(QWidget* parent /TransferThis/ = 0); @@ -29,6 +33,10 @@ public: void setDockWidget(ads::CDockWidget* DockWidget); bool iconOnly() const; ads::CAutoHideSideBar* sideBar() const; + int tabIndex() const; + void setDockWidgetFloating(); + void unpinDockWidget(); + void requestCloseDockWidget(); }; }; diff --git a/sip/DockAreaTabBar.sip b/sip/DockAreaTabBar.sip index ff867a4..ab6e72f 100644 --- a/sip/DockAreaTabBar.sip +++ b/sip/DockAreaTabBar.sip @@ -23,6 +23,8 @@ public: int currentIndex() const; ads::CDockWidgetTab* currentTab() const; ads::CDockWidgetTab* tab(int Index) const; + int tabAt(const QPoint& Pos) const; + int tabInsertIndexAt(const QPoint& Pos) const; virtual bool eventFilter(QObject *watched, QEvent *event); bool isTabOpen(int Index) const; virtual QSize minimumSizeHint() const; diff --git a/sip/DockAreaTitleBar.sip b/sip/DockAreaTitleBar.sip index 8d3fad7..70e3d90 100644 --- a/sip/DockAreaTitleBar.sip +++ b/sip/DockAreaTitleBar.sip @@ -5,6 +5,22 @@ namespace ads { +class CTitleBarButton : QToolButton +{ + %TypeHeaderCode + #include + %End + +public: + CTitleBarButton(bool visible = true, QWidget* parent /TransferThis/ = Q_NULLPTR ); + virtual void setVisible(bool); + void setShowInTitleBar(bool); + + +protected: + bool event(QEvent *ev); +}; + class CDockAreaTitleBar : QFrame { %TypeHeaderCode @@ -26,14 +42,15 @@ public: CDockAreaTitleBar(ads::CDockAreaWidget* parent /TransferThis/); virtual ~CDockAreaTitleBar(); ads::CDockAreaTabBar* tabBar() const; - QAbstractButton* button(ads::TitleBarButton which) const; + ads::CTitleBarButton* button(ads::TitleBarButton which) const; ads::CElidingLabel* autoHideTitleLabel() const; void updateDockWidgetActionsButtons(); virtual void setVisible(bool Visible); void insertWidget(int index, QWidget *widget /Transfer/ ); int indexOf(QWidget *widget) const; QString titleBarButtonToolTip(ads::TitleBarButton Button) const; - + void setAreaFloating(); + signals: void tabBarClicked(int index); diff --git a/sip/DockAreaTitleBar_p.sip b/sip/DockAreaTitleBar_p.sip index 0ae3339..243a978 100644 --- a/sip/DockAreaTitleBar_p.sip +++ b/sip/DockAreaTitleBar_p.sip @@ -5,21 +5,6 @@ namespace ads { -class CTitleBarButton : QToolButton -{ - %TypeHeaderCode - #include - %End - -protected: - bool event(QEvent *ev); - -public: - CTitleBarButton(bool visible = true, QWidget* parent /TransferThis/ = Q_NULLPTR ); - virtual void setVisible(bool visible); -}; - - class CSpacerWidget : QWidget { %TypeHeaderCode diff --git a/sip/DockAreaWidget.sip b/sip/DockAreaWidget.sip index ae74263..5274821 100644 --- a/sip/DockAreaWidget.sip +++ b/sip/DockAreaWidget.sip @@ -40,6 +40,9 @@ public: virtual ~CDockAreaWidget(); ads::CDockManager* dockManager() const; ads::CDockContainerWidget* dockContainer() const; + ads::CAutoHideDockContainer* autoHideDockContainer() const; + bool isAutoHide() const; + void setAutoHideDockContainer(CAutoHideDockContainer*); virtual QSize minimumSizeHint() const; QRect titleBarGeometry() const; QRect contentAreaGeometry() const; @@ -74,7 +77,10 @@ public: public slots: void setCurrentIndex(int index); void closeArea(); + void setAutoHide(bool Enable, SideBarLocation Location = ads::SideBarNone, int TabIndex = -1); + void toggleAutoHide(SideBarLocation Location = ads::SideBarNone); void closeOtherAreas(); + void setFloating(); signals: void tabBarClicked(int index); diff --git a/sip/DockContainerWidget.sip b/sip/DockContainerWidget.sip index 922db75..83a9baf 100644 --- a/sip/DockContainerWidget.sip +++ b/sip/DockContainerWidget.sip @@ -21,10 +21,10 @@ class CDockContainerWidget : QFrame protected: virtual bool event(QEvent *e); QSplitter* rootSplitter() const; - ads::CAutoHideDockContainer* createAndSetupAutoHideContainer(ads::SideBarLocation area, ads::CDockWidget* DockWidget /Transfer/); + ads::CAutoHideDockContainer* createAndSetupAutoHideContainer(ads::SideBarLocation area, ads::CDockWidget* DockWidget /Transfer/, int TabIndex = -1); void createRootSplitter(); void dropFloatingWidget(ads::CFloatingDockContainer* FloatingWidget, const QPoint& TargetPos); - void dropWidget(QWidget* Widget, DockWidgetArea DropArea, CDockAreaWidget* TargetAreaWidget); + void dropWidget(QWidget* Widget, DockWidgetArea DropArea, CDockAreaWidget* TargetAreaWidget, int TabIndex = -1); void addDockArea(ads::CDockAreaWidget* DockAreaWidget /Transfer/, ads::DockWidgetArea area = ads::CenterDockWidgetArea); void removeDockArea(ads::CDockAreaWidget* area /TransferBack/); void saveState(QXmlStreamWriter& Stream) const; @@ -59,7 +59,7 @@ public: ads::CDockWidget::DockWidgetFeatures features() const; ads::CFloatingDockContainer* floatingWidget() const; void closeOtherAreas(ads::CDockAreaWidget* KeepOpenArea); - ads::CAutoHideSideBar* sideTabBar(SideBarLocation area) const; + ads::CAutoHideSideBar* autoHideSideBar(SideBarLocation area) const; QList autoHideWidgets() const; QRect contentRect() const; QRect contentRectGlobal() const; diff --git a/sip/DockManager.sip b/sip/DockManager.sip index 5889b17..b7faf9c 100644 --- a/sip/DockManager.sip +++ b/sip/DockManager.sip @@ -187,8 +187,8 @@ public: AutoHideButtonCheckable, AutoHideSideBarsIconOnly, AutoHideShowOnMouseOver, - DefaultAutoHideConfig, AutoHideCloseButtonCollapsesDock, + DefaultAutoHideConfig, }; typedef QFlags AutoHideFlags; diff --git a/sip/DockOverlay.sip b/sip/DockOverlay.sip index 1588800..feb6d45 100644 --- a/sip/DockOverlay.sip +++ b/sip/DockOverlay.sip @@ -22,8 +22,10 @@ public: CDockOverlay(QWidget* parent /TransferThis/, eMode Mode = ads::CDockOverlay::ModeDockAreaOverlay); virtual ~CDockOverlay(); void setAllowedAreas(ads::DockWidgetAreas areas); + void setAllowedArea(ads::DockWidgetArea area, bool Enable); ads::DockWidgetAreas allowedAreas() const; ads::DockWidgetArea dropAreaUnderCursor() const; + int tabIndexUnderCursor() const; ads::DockWidgetArea visibleDropAreaUnderCursor() const; ads::DockWidgetArea showOverlay(QWidget* target); void hideOverlay(); diff --git a/sip/DockWidget.sip b/sip/DockWidget.sip index 90ccea4..5fac34c 100644 --- a/sip/DockWidget.sip +++ b/sip/DockWidget.sip @@ -90,6 +90,7 @@ public: void setSideTabWidget(ads::CAutoHideTab* SideTab /Transfer/) const; bool isAutoHide() const; ads::CAutoHideDockContainer* autoHideDockContainer() const; + ads::SideBarLocation autoHideLocation() const; bool isFloating() const; bool isInFloatingContainer() const; bool isClosed() const; @@ -125,9 +126,10 @@ public slots: void setFloating(); void deleteDockWidget(); void closeDockWidget(); + void requestCloseDockWidget(); void showFullScreen(); void showNormal(); - void setAutoHide(bool Enable, ads::SideBarLocation Location = ads::SideBarNone); + void setAutoHide(bool Enable, ads::SideBarLocation Location = ads::SideBarNone, int TabIndex = -1); void toggleAutoHide(ads::SideBarLocation Location = ads::SideBarNone); signals: diff --git a/sip/DockWidgetTab.sip b/sip/DockWidgetTab.sip index 763bb00..0bc610a 100644 --- a/sip/DockWidgetTab.sip +++ b/sip/DockWidgetTab.sip @@ -37,7 +37,6 @@ public: void updateStyle(); QSize iconSize() const; void setIconSize(const QSize& Size); - bool mousePressed() const; public slots: virtual void setVisible(bool visible); diff --git a/sip/FloatingDragPreview.sip b/sip/FloatingDragPreview.sip index 0dfc502..ad5be71 100644 --- a/sip/FloatingDragPreview.sip +++ b/sip/FloatingDragPreview.sip @@ -29,7 +29,7 @@ public: // implements IFloatingWidget ads::eDragState DragState, QWidget* MouseEventHandler); virtual void moveFloating(); virtual void finishDragging(); - void cleanupAutoHideContainerWidget(); + void cleanupAutoHideContainerWidget(ads::DockWidgetArea ContainerDropArea); signals: void draggingCanceled(); diff --git a/sip/ads_globals.sip b/sip/ads_globals.sip index 62eb674..bbe6491 100644 --- a/sip/ads_globals.sip +++ b/sip/ads_globals.sip @@ -50,13 +50,24 @@ namespace ads TopDockWidgetArea, BottomDockWidgetArea, CenterDockWidgetArea, + LeftAutoHideArea, + RightAutoHideArea, + TopAutoHideArea, + BottomAutoHideArea, InvalidDockWidgetArea, OuterDockAreas, + AutoHideDockAreas, AllDockAreas }; typedef QFlags DockWidgetAreas; + enum eTabIndex + { + TabDefaultInsertIndex, + TabInvalidIndex + }; + enum TitleBarButton { TitleBarButtonTabsMenu, @@ -115,6 +126,9 @@ namespace ads int insertOffset() const; }; ads::internal::CDockInsertParam dockAreaInsertParameters(ads::DockWidgetArea Area); + ads::SideBarLocation toSideBarLocation(ads::DockWidgetArea Area); + bool isHorizontalSideBarLocation(ads::SideBarLocation Location); + bool isSideBarArea(ads::DockWidgetArea Area); SIP_PYOBJECT findParent(SIP_PYTYPE type, const QWidget *w) const /TypeHint="QObject"/; %MethodCode