ADS: Integrate newest base repository commits

* Update to newest version of ADS
* Remove native window and title bar support on linux

Base repository was merged until commit
8d4507e9d83434be976ff8c7bc9f59733937a08d

Task-number: QDS-10242
Change-Id: If74b6b50421be3b759c61b0f76f4a330991f71fa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Henning Gruendl
2023-06-23 19:58:25 +02:00
committed by Henning Gründl
parent 21983a8377
commit 16ef838f23
47 changed files with 10507 additions and 5668 deletions

View File

@@ -21,6 +21,9 @@ class DockContainerWidget;
class DockAreaWidget;
class DockContainerWidgetPrivate;
class FloatingDockContainer;
class AutoHideTab;
class AutoHideDockContainer;
class AutoHideSideBar;
/**
* The QDockWidget class provides a widget that can be docked inside a
@@ -49,6 +52,8 @@ protected:
friend class DockWidgetTab;
friend class DockWidgetTabPrivate;
friend class DockAreaTitleBarPrivate;
friend class AutoHideDockContainer;
friend AutoHideSideBar;
/**
* Assigns the dock manager that manages this dock widget
@@ -120,14 +125,28 @@ public:
using Super = QFrame;
enum DockWidgetFeature {
DockWidgetClosable = 0x01,///< dock widget has a close button
DockWidgetMovable = 0x02,///< dock widget is movable and can be moved to a new position in the current dock container
DockWidgetFloatable = 0x04,
DockWidgetDeleteOnClose = 0x08, ///< deletes the dock widget when it is closed
CustomCloseHandling = 0x10,
DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable,
AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose | CustomCloseHandling,
NoDockWidgetFeatures = 0x00
DockWidgetClosable = 0x001, ///< dock widget has a close button
DockWidgetMovable
= 0x002, ///< dock widget is movable and can be moved to a new position in the current dock container
DockWidgetFloatable = 0x004, ///< dock widget can be dragged into a floating window
DockWidgetDeleteOnClose = 0x008, ///< deletes the dock widget when it is closed
CustomCloseHandling
= 0x010, ///< clicking the close button will not close the dock widget but emits the closeRequested() signal instead
DockWidgetFocusable = 0x020, ///< if this is enabled, a dock widget can get focus highlighting
DockWidgetForceCloseWithArea
= 0x040, ///< dock widget will be closed when the dock area hosting it is closed
NoTab = 0x080, ///< dock widget tab will never be shown if this flag is set
DeleteContentOnClose
= 0x100, ///< deletes only the contained widget on close, keeping the dock widget intact
///< and in place. Attempts to rebuild the contents widget on show if there is a widget factory set.
DockWidgetPinnable
= 0x200, ///< dock widget can be pinned and added to an auto hide dock container
DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable
| DockWidgetFocusable | DockWidgetPinnable,
AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose
| CustomCloseHandling,
DockWidgetAlwaysCloseAndDelete = DockWidgetForceCloseWithArea | DockWidgetDeleteOnClose,
NoDockWidgetFeatures = 0x000
};
Q_DECLARE_FLAGS(DockWidgetFeatures, DockWidgetFeature)
@@ -158,10 +177,18 @@ public:
* To ensure, that a dock widget does not block resizing, the dock widget
* reimplements minimumSizeHint() function to return a very small minimum
* size hint. If you would like to adhere the minimumSizeHint() from the
* content widget, the set the minimumSizeHintMode() to
* MinimumSizeHintFromContent.
* content widget, then set the minimumSizeHintMode() to
* MinimumSizeHintFromContent. If you would like to use the minimumSize()
* value of the content widget or the dock widget, then you can use the
* MinimumSizeHintFromDockWidgetMinimumSize or
* MinimumSizeHintFromContentMinimumSize modes.
*/
enum eMinimumSizeHintMode { MinimumSizeHintFromDockWidget, MinimumSizeHintFromContent };
enum eMinimumSizeHintMode {
MinimumSizeHintFromDockWidget,
MinimumSizeHintFromContent,
MinimumSizeHintFromDockWidgetMinimumSize,
MinimumSizeHintFromContentMinimumSize,
};
/**
* This mode configures the behavior of the toggle view action.
@@ -205,7 +232,7 @@ public:
/**
* Sets the widget for the dock widget to widget.
* The InsertMode defines how the widget is inserted into the dock widget.
* The content of a dock widget should be resizable do a very small size to
* The content of a dock widget should be resizable to a very small size to
* prevent the dock widget from blocking the resizing. To ensure, that a
* dock widget can be resized very well, it is better to insert the content+
* widget into a scroll area or to provide a widget that is already a scroll
@@ -221,6 +248,18 @@ public:
*/
void setWidget(QWidget *widget, eInsertMode insertMode = AutoScrollArea);
/**
* Only used when the feature flag DeleteContentOnClose is set.
* Using the flag and setting a widget factory allows to free the resources
* of the widget of your application while retaining the position the next
* time you want to show your widget, unlike the flag DockWidgetDeleteOnClose
* which deletes the dock widget itself. Since we keep the dock widget, all
* regular features of ADS should work as normal, including saving and
* restoring the state of the docking system and using perspectives.
*/
using FactoryFunc = std::function<QWidget *(QWidget *)>;
void setWidgetFactory(FactoryFunc createWidget, eInsertMode insertMode = AutoScrollArea);
/**
* Remove the widget from the dock and give ownership back to the caller
*/
@@ -269,12 +308,41 @@ public:
*/
DockContainerWidget *dockContainer() const;
/**
* This function return the floating DockContainer if is isFloating() is true
* and a nullptr if this dock widget is not floating.
*/
FloatingDockContainer *floatingDockContainer() const;
/**
* Returns the dock area widget this dock widget belongs to or 0
* if this dock widget has not been docked yet
*/
DockAreaWidget *dockAreaWidget() const;
/**
* Returns the side tab widget for this dock, if this dock widget is in
* a auto hide container. If it is not in a auto hide container, then this
* function returns a nullptr,
*/
AutoHideTab *sideTabWidget() const;
/**
* Assign a side tab widget if this dock widget is an auto hide container
*/
void setSideTabWidget(AutoHideTab *sideTab) const;
/**
* Returns true, if this dock widget is in an auto hide container
*/
bool isAutoHide() const;
/**
* Returns the auto hide dock container of this dock widget
* or 0 if there is none
*/
AutoHideDockContainer *autoHideDockContainer() const;
/**
* This property holds whether the dock widget is floating.
* A dock widget is only floating, if it is the one and only widget inside
@@ -314,6 +382,16 @@ public:
*/
void setMinimumSizeHintMode(eMinimumSizeHintMode mode);
/**
* Get the minimum size hint mode configured by setMinimumSizeHintMode
*/
eMinimumSizeHintMode minimumSizeHintMode() const;
/**
* Returns true if the dock widget is set as central widget of it's dock manager
*/
bool isCentralWidget() const;
/**
* Sets the dock widget icon that is shown in tabs and in toggle view
* actions
@@ -431,7 +509,7 @@ public: // reimplements QFrame
/**
* This property controls whether the dock widget is open or closed.
* The toogleViewAction triggers this slot
* The toggleViewAction triggers this slot
*/
void toggleView(bool open = true);
@@ -488,6 +566,18 @@ public: // reimplements QFrame
*/
void showNormal();
/**
* Sets the dock widget into auto hide mode if this feature is enabled
* via CDockManager::setAutoHideFlags(CDockManager::AutoHideFeatureEnabled)
*/
void setAutoHide(bool enable, SideBarLocation location = SideBarNone);
/**
* Switches the dock widget to auto hide mode or vice versa depending on its
* current state.
*/
void toggleAutoHide(SideBarLocation location = SideBarNone);
signals:
/**
* This signal is emitted if the dock widget is opened or closed