File indexing completed on 2025-07-06 03:31:34
0001 #ifndef DockWidgetH 0002 #define DockWidgetH 0003 /******************************************************************************* 0004 ** Qt Advanced Docking System 0005 ** Copyright (C) 2017 Uwe Kindler 0006 ** 0007 ** This library is free software; you can redistribute it and/or 0008 ** modify it under the terms of the GNU Lesser General Public 0009 ** License as published by the Free Software Foundation; either 0010 ** version 2.1 of the License, or (at your option) any later version. 0011 ** 0012 ** This library is distributed in the hope that it will be useful, 0013 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 0014 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0015 ** Lesser General Public License for more details. 0016 ** 0017 ** You should have received a copy of the GNU Lesser General Public 0018 ** License along with this library; If not, see <http://www.gnu.org/licenses/>. 0019 ******************************************************************************/ 0020 0021 0022 //============================================================================ 0023 /// \file DockWidget.h 0024 /// \author Uwe Kindler 0025 /// \date 26.02.2017 0026 /// \brief Declaration of CDockWidget class 0027 //============================================================================ 0028 0029 0030 //============================================================================ 0031 // INCLUDES 0032 //============================================================================ 0033 #include <QFrame> 0034 0035 #include "ads_globals.h" 0036 0037 QT_FORWARD_DECLARE_CLASS(QToolBar) 0038 QT_FORWARD_DECLARE_CLASS(QXmlStreamWriter) 0039 0040 namespace ads 0041 { 0042 struct DockWidgetPrivate; 0043 class CDockWidgetTab; 0044 class CDockManager; 0045 class CDockContainerWidget; 0046 class CDockAreaWidget; 0047 class DockContainerWidgetPrivate; 0048 class CFloatingDockContainer; 0049 class CAutoHideTab; 0050 class CAutoHideDockContainer; 0051 class CAutoHideSideBar; 0052 0053 /** 0054 * The QDockWidget class provides a widget that can be docked inside a 0055 * CDockManager or floated as a top-level window on the desktop. 0056 */ 0057 class ADS_EXPORT CDockWidget : public QFrame 0058 { 0059 Q_OBJECT 0060 private: 0061 DockWidgetPrivate* d; ///< private data (pimpl) 0062 friend struct DockWidgetPrivate; 0063 0064 private Q_SLOTS: 0065 /** 0066 * Adjusts the toolbar icon sizes according to the floating state 0067 */ 0068 void setToolbarFloatingStyle(bool topLevel); 0069 0070 protected: 0071 friend class CDockContainerWidget; 0072 friend class CDockAreaWidget; 0073 friend class CFloatingDockContainer; 0074 friend class CDockManager; 0075 friend struct DockManagerPrivate; 0076 friend class DockContainerWidgetPrivate; 0077 friend class CDockAreaTabBar; 0078 friend class CDockWidgetTab; 0079 friend struct DockWidgetTabPrivate; 0080 friend struct DockAreaTitleBarPrivate; 0081 friend class CAutoHideDockContainer; 0082 friend CAutoHideSideBar; 0083 0084 /** 0085 * Assigns the dock manager that manages this dock widget 0086 */ 0087 void setDockManager(CDockManager* DockManager); 0088 0089 /** 0090 * If this dock widget is inserted into a dock area, the dock area will 0091 * be registered on this widget via this function. If a dock widget is 0092 * removed from a dock area, this function will be called with nullptr 0093 * value. 0094 */ 0095 void setDockArea(CDockAreaWidget* DockArea); 0096 0097 /** 0098 * This function changes the toggle view action without emitting any 0099 * signal 0100 */ 0101 void setToggleViewActionChecked(bool Checked); 0102 0103 /** 0104 * Saves the state into the given stream 0105 */ 0106 void saveState(QXmlStreamWriter& Stream) const; 0107 0108 /** 0109 * This is a helper function for the dock manager to flag this widget 0110 * as unassigned. 0111 * When calling the restore function, it may happen, that the saved state 0112 * contains less dock widgets then currently available. All widgets whose 0113 * data is not contained in the saved state, are flagged as unassigned 0114 * after the restore process. If the user shows an unassigned dock widget, 0115 * a floating widget will be created to take up the dock widget. 0116 */ 0117 void flagAsUnassigned(); 0118 0119 /** 0120 * Call this function to emit a topLevelChanged() signal and to update 0121 * the dock area tool bar visibility 0122 */ 0123 static void emitTopLevelEventForWidget(CDockWidget* TopLevelDockWidget, bool Floating); 0124 0125 /** 0126 * Use this function to emit a top level changed event. 0127 * Do never use emit topLevelChanged(). Always use this function because 0128 * it only emits a signal if the floating state has really changed 0129 */ 0130 void emitTopLevelChanged(bool Floating); 0131 0132 /** 0133 * Internal function for modifying the closed state when restoring 0134 * a saved docking state 0135 */ 0136 void setClosedState(bool Closed); 0137 0138 /** 0139 * Internal toggle view function that does not check if the widget 0140 * already is in the given state 0141 */ 0142 void toggleViewInternal(bool Open); 0143 0144 /** 0145 * Internal close dock widget implementation. 0146 * The function returns true if the dock widget has been closed or hidden 0147 */ 0148 bool closeDockWidgetInternal(bool ForceClose = false); 0149 0150 public: 0151 using Super = QFrame; 0152 0153 enum DockWidgetFeature 0154 { 0155 DockWidgetClosable = 0x001,///< dock widget has a close button 0156 DockWidgetMovable = 0x002,///< dock widget is movable and can be moved to a new position in the current dock container 0157 DockWidgetFloatable = 0x004,///< dock widget can be dragged into a floating window 0158 DockWidgetDeleteOnClose = 0x008, ///< deletes the dock widget when it is closed 0159 CustomCloseHandling = 0x010, ///< clicking the close button will not close the dock widget but emits the closeRequested() signal instead 0160 DockWidgetFocusable = 0x020, ///< if this is enabled, a dock widget can get focus highlighting 0161 DockWidgetForceCloseWithArea = 0x040, ///< dock widget will be closed when the dock area hosting it is closed 0162 NoTab = 0x080, ///< dock widget tab will never be shown if this flag is set 0163 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. 0164 DockWidgetPinnable = 0x200, ///< dock widget can be pinned and added to an auto hide dock container 0165 DefaultDockWidgetFeatures = DockWidgetClosable | DockWidgetMovable | DockWidgetFloatable | DockWidgetFocusable | DockWidgetPinnable, 0166 AllDockWidgetFeatures = DefaultDockWidgetFeatures | DockWidgetDeleteOnClose | CustomCloseHandling, 0167 DockWidgetAlwaysCloseAndDelete = DockWidgetForceCloseWithArea | DockWidgetDeleteOnClose, 0168 NoDockWidgetFeatures = 0x000 0169 }; 0170 Q_DECLARE_FLAGS(DockWidgetFeatures, DockWidgetFeature) 0171 0172 enum eState 0173 { 0174 StateHidden, 0175 StateDocked, 0176 StateFloating 0177 }; 0178 0179 enum eToolBarStyleSource 0180 { 0181 ToolBarStyleFromDockManager, 0182 ToolBarStyleFromDockWidget 0183 }; 0184 0185 /** 0186 * Sets the widget for the dock widget to widget. 0187 * The InsertMode defines how the widget is inserted into the dock widget. 0188 * The content of a dock widget should be resizable do a very small size to 0189 * prevent the dock widget from blocking the resizing. To ensure, that a 0190 * dock widget can be resized very well, it is better to insert the content+ 0191 * widget into a scroll area or to provide a widget that is already a scroll 0192 * area or that contains a scroll area. 0193 * If the InsertMode is AutoScrollArea, the DockWidget tries to automatically 0194 * detect how to insert the given widget. If the widget is derived from 0195 * QScrollArea (i.e. an QAbstractItemView), then the widget is inserted 0196 * directly. If the given widget is not a scroll area, the widget will be 0197 * inserted into a scroll area. 0198 * To force insertion into a scroll area, you can also provide the InsertMode 0199 * ForceScrollArea. To prevent insertion into a scroll area, you can 0200 * provide the InsertMode ForceNoScrollArea 0201 */ 0202 enum eInsertMode 0203 { 0204 AutoScrollArea, 0205 ForceScrollArea, 0206 ForceNoScrollArea 0207 }; 0208 0209 0210 /** 0211 * The mode of the minimumSizeHint() that is returned by the DockWidget 0212 * minimumSizeHint() function. 0213 * To ensure, that a dock widget does not block resizing, the dock widget 0214 * reimplements minimumSizeHint() function to return a very small minimum 0215 * size hint. If you would like to adhere the minimumSizeHint() from the 0216 * content widget, then set the minimumSizeHintMode() to 0217 * MinimumSizeHintFromContent. If you would like to use the minimumSize() 0218 * value of the content widget or the dock widget, then you can use the 0219 * MinimumSizeHintFromDockWidgetMinimumSize or 0220 * MinimumSizeHintFromContentMinimumSize modes. 0221 */ 0222 enum eMinimumSizeHintMode 0223 { 0224 MinimumSizeHintFromDockWidget, 0225 MinimumSizeHintFromContent, 0226 MinimumSizeHintFromDockWidgetMinimumSize, 0227 MinimumSizeHintFromContentMinimumSize, 0228 }; 0229 0230 0231 /** 0232 * This mode configures the behavior of the toggle view action. 0233 * If the mode if ActionModeToggle, then the toggle view action is 0234 * a checkable action to show / hide the dock widget. If the mode 0235 * is ActionModeShow, then the action is not checkable an it will 0236 * always show the dock widget if clicked. If the mode is ActionModeShow, 0237 * the user can only close the DockWidget with the close button. 0238 */ 0239 enum eToggleViewActionMode 0240 { 0241 ActionModeToggle,//!< ActionModeToggle 0242 ActionModeShow //!< ActionModeShow 0243 }; 0244 0245 0246 /** 0247 * This constructor creates a dock widget with the given title. 0248 * The title is the text that is shown in the window title when the dock 0249 * widget is floating and it is the title that is shown in the titlebar 0250 * or the tab of this dock widget if it is tabified. 0251 * The object name of the dock widget is also set to the title. The 0252 * object name is required by the dock manager to properly save and restore 0253 * the state of the dock widget. That means, the title needs to be unique. 0254 * If your title is not unique or if you would like to change the title 0255 * during runtime, you need to set a unique object name explicitly 0256 * by calling setObjectName() after construction. 0257 * Use the layoutFlags to configure the layout of the dock widget. 0258 */ 0259 CDockWidget(const QString &title, QWidget* parent = nullptr); 0260 0261 /** 0262 * Virtual Destructor 0263 */ 0264 virtual ~CDockWidget(); 0265 0266 /** 0267 * We return a fixed minimum size hint or the size hint of the content 0268 * widget if minimum size hint mode is MinimumSizeHintFromContent 0269 */ 0270 virtual QSize minimumSizeHint() const override; 0271 0272 /** 0273 * Sets the widget for the dock widget to widget. 0274 * The InsertMode defines how the widget is inserted into the dock widget. 0275 * The content of a dock widget should be resizable to a very small size to 0276 * prevent the dock widget from blocking the resizing. To ensure, that a 0277 * dock widget can be resized very well, it is better to insert the content+ 0278 * widget into a scroll area or to provide a widget that is already a scroll 0279 * area or that contains a scroll area. 0280 * If the InsertMode is AutoScrollArea, the DockWidget tries to automatically 0281 * detect how to insert the given widget. If the widget is derived from 0282 * QScrollArea (i.e. an QAbstractItemView), then the widget is inserted 0283 * directly. If the given widget is not a scroll area, the widget will be 0284 * inserted into a scroll area. 0285 * To force insertion into a scroll area, you can also provide the InsertMode 0286 * ForceScrollArea. To prevent insertion into a scroll area, you can 0287 * provide the InsertMode ForceNoScrollArea 0288 */ 0289 void setWidget(QWidget* widget, eInsertMode InsertMode = AutoScrollArea); 0290 0291 /** 0292 * Only used when the feature flag DeleteContentOnClose is set. 0293 * Using the flag and setting a widget factory allows to free the resources 0294 * of the widget of your application while retaining the position the next 0295 * time you want to show your widget, unlike the flag DockWidgetDeleteOnClose 0296 * which deletes the dock widget itself. Since we keep the dock widget, all 0297 * regular features of ADS should work as normal, including saving and 0298 * restoring the state of the docking system and using perspectives. 0299 */ 0300 using FactoryFunc = std::function<QWidget*(QWidget*)>; 0301 void setWidgetFactory(FactoryFunc createWidget, eInsertMode InsertMode = AutoScrollArea); 0302 0303 /** 0304 * Remove the widget from the dock and give ownership back to the caller 0305 */ 0306 QWidget* takeWidget(); 0307 0308 /** 0309 * Returns the widget for the dock widget. This function returns zero if 0310 * the widget has not been set. 0311 */ 0312 QWidget* widget() const; 0313 0314 /** 0315 * Returns the tab widget of this dock widget that is shown in the dock 0316 * area title bar 0317 */ 0318 CDockWidgetTab* tabWidget() const; 0319 0320 /** 0321 * Sets, whether the dock widget is movable, closable, and floatable. 0322 */ 0323 void setFeatures(DockWidgetFeatures features); 0324 0325 /** 0326 * Sets the feature flag for this dock widget if on is true; otherwise 0327 * clears the flag. 0328 */ 0329 void setFeature(DockWidgetFeature flag, bool on); 0330 0331 /** 0332 * This property holds whether the dock widget is movable, closable, and 0333 * floatable. 0334 * By default, this property is set to a combination of DockWidgetClosable, 0335 * DockWidgetMovable and DockWidgetFloatable. 0336 */ 0337 DockWidgetFeatures features() const; 0338 0339 /** 0340 * Returns the dock manager that manages the dock widget or 0 if the widget 0341 * has not been assigned to any dock manager yet 0342 */ 0343 CDockManager* dockManager() const; 0344 0345 /** 0346 * Returns the dock container widget this dock area widget belongs to or 0 0347 * if this dock widget has not been docked yet 0348 */ 0349 CDockContainerWidget* dockContainer() const; 0350 0351 /** 0352 * This function return the floating DockContainer if is isFloating() is true 0353 * and a nullptr if this dock widget is not floating. 0354 */ 0355 CFloatingDockContainer* floatingDockContainer() const; 0356 0357 /** 0358 * Returns the dock area widget this dock widget belongs to or 0 0359 * if this dock widget has not been docked yet 0360 */ 0361 CDockAreaWidget* dockAreaWidget() const; 0362 0363 /** 0364 * Returns the side tab widget for this dock, if this dock widget is in 0365 * a auto hide container. If it is not in a auto hide container, then this 0366 * function returns a nullptr, 0367 */ 0368 CAutoHideTab* sideTabWidget() const; 0369 0370 /** 0371 * Assign a side tab widget if this dock widget is an auto hide container 0372 */ 0373 void setSideTabWidget(CAutoHideTab* SideTab) const; 0374 0375 /** 0376 * Returns true, if this dock widget is in an auto hide container 0377 */ 0378 bool isAutoHide() const; 0379 0380 /** 0381 * Returns the auto hide dock container of this dock widget 0382 * or 0 if there is none 0383 */ 0384 CAutoHideDockContainer* autoHideDockContainer() const; 0385 0386 /** 0387 * Returns the auto hide side bar location or SideBarNone if, this is not 0388 * an autohide dock widget 0389 */ 0390 SideBarLocation autoHideLocation() const; 0391 0392 /** 0393 * This property holds whether the dock widget is floating. 0394 * A dock widget is only floating, if it is the one and only widget inside 0395 * of a floating container. If there are more than one dock widget in a 0396 * floating container, the all dock widgets are docked and not floating. 0397 */ 0398 bool isFloating() const; 0399 0400 /** 0401 * This function returns true, if this dock widget is in a floating. 0402 * The function returns true, if the dock widget is floating and it also 0403 * returns true if it is docked inside of a floating container. 0404 */ 0405 bool isInFloatingContainer() const; 0406 0407 /** 0408 * Returns true, if this dock widget is closed. 0409 */ 0410 bool isClosed() const; 0411 0412 /** 0413 * Returns a checkable action that can be used to show or close this dock widget. 0414 * The action's text is set to the dock widget's window title. 0415 */ 0416 QAction* toggleViewAction() const; 0417 0418 /** 0419 * Use provided action to be the default toggle view action for this dock widget. 0420 * This dock widget now owns the action. 0421 */ 0422 void setToggleViewAction(QAction* action); 0423 0424 /** 0425 * Configures the behavior of the toggle view action. 0426 * \see eToggleViewActionMode for a detailed description 0427 */ 0428 void setToggleViewActionMode(eToggleViewActionMode Mode); 0429 0430 /** 0431 * Configures the minimum size hint that is returned by the 0432 * minimumSizeHint() function. 0433 * \see eMinimumSizeHintMode for a detailed description 0434 */ 0435 void setMinimumSizeHintMode(eMinimumSizeHintMode Mode); 0436 0437 /** 0438 * Get the minimum size hint mode configured by setMinimumSizeHintMode 0439 */ 0440 eMinimumSizeHintMode minimumSizeHintMode() const; 0441 0442 /** 0443 * Returns true if the dock widget is set as central widget of it's dock manager 0444 */ 0445 bool isCentralWidget() const; 0446 0447 /** 0448 * Sets the dock widget icon that is shown in tabs and in toggle view 0449 * actions 0450 */ 0451 void setIcon(const QIcon& Icon); 0452 0453 /** 0454 * Returns the icon that has been assigned to the dock widget 0455 */ 0456 QIcon icon() const; 0457 0458 /** 0459 * This function returns the dock widget top tool bar. 0460 * If no toolbar is assigned, this function returns nullptr. To get a valid 0461 * toolbar you either need to create a default empty toolbar via 0462 * createDefaultToolBar() function or you need to assign your custom 0463 * toolbar via setToolBar(). 0464 */ 0465 QToolBar* toolBar() const; 0466 0467 /** 0468 * If you would like to use the default top tool bar, then call this 0469 * function to create the default tool bar. 0470 * After this function the toolBar() function will return a valid toolBar() 0471 * object. 0472 */ 0473 QToolBar* createDefaultToolBar(); 0474 0475 /** 0476 * Assign a new tool bar that is shown above the content widget. 0477 * The dock widget will become the owner of the tool bar and deletes it 0478 * on destruction 0479 */ 0480 void setToolBar(QToolBar* ToolBar); 0481 0482 /** 0483 * Configures, if the dock widget uses the global tool bar styles from 0484 * dock manager or if it uses its own tool bar style 0485 */ 0486 void setToolBarStyleSource(eToolBarStyleSource Source); 0487 0488 /** 0489 * Returns the configured tool bar style source 0490 */ 0491 eToolBarStyleSource toolBarStyleSource() const; 0492 0493 /** 0494 * This function sets the tool button style for the given dock widget state. 0495 * It is possible to switch the tool button style depending on the state. 0496 * If a dock widget is floating, then here are more space and it is 0497 * possible to select a style that requires more space like 0498 * Qt::ToolButtonTextUnderIcon. For the docked state Qt::ToolButtonIconOnly 0499 * might be better. 0500 */ 0501 void setToolBarStyle(Qt::ToolButtonStyle Style, eState State); 0502 0503 /** 0504 * Returns the tool button style for the given docking state. 0505 * \see setToolBarStyle() 0506 */ 0507 Qt::ToolButtonStyle toolBarStyle(eState State) const; 0508 0509 /** 0510 * This function sets the tool button icon size for the given state. 0511 * If a dock widget is floating, there is more space an increasing the 0512 * icon size is possible. For docked widgets, small icon sizes, eg. 16 x 16 0513 * might be better. 0514 */ 0515 void setToolBarIconSize(const QSize& IconSize, eState State); 0516 0517 /** 0518 * Returns the icon size for a given docking state. 0519 * \see setToolBarIconSize() 0520 */ 0521 QSize toolBarIconSize(eState State) const; 0522 0523 /** 0524 * Set the actions that will be shown in the dock area title bar 0525 * if this dock widget is the active tab. 0526 * You should not add to many actions to the title bar, because this 0527 * will remove the available space for the tabs. If you have a number 0528 * of actions, just add an action with a menu to show a popup menu 0529 * button in the title bar. 0530 */ 0531 void setTitleBarActions(QList<QAction*> actions); 0532 0533 /** 0534 * Returns a list of actions that will be inserted into the dock area title 0535 * bar if this dock widget becomes the current widget 0536 */ 0537 virtual QList<QAction*> titleBarActions() const; 0538 0539 0540 #ifndef QT_NO_TOOLTIP 0541 /** 0542 * This is function sets text tooltip for title bar widget 0543 * and tooltip for toggle view action 0544 */ 0545 void setTabToolTip(const QString &text); 0546 #endif 0547 0548 /** 0549 * Returns true if the dock widget is floating and if the floating dock 0550 * container is full screen 0551 */ 0552 bool isFullScreen() const; 0553 0554 /** 0555 * Returns true if this dock widget is in a dock area, that contains at 0556 * least 2 opened dock widgets 0557 */ 0558 bool isTabbed() const; 0559 0560 /** 0561 * Returns true if this dock widget is the current one in the dock 0562 * area widget that contains it. 0563 * If the dock widget is the only opened dock widget in a dock area, 0564 * the true is returned 0565 */ 0566 bool isCurrentTab() const; 0567 0568 public: // reimplements QFrame ----------------------------------------------- 0569 /** 0570 * Emits titleChanged signal if title change event occurs 0571 */ 0572 virtual bool event(QEvent *e) override; 0573 0574 public Q_SLOTS: 0575 /** 0576 * This property controls whether the dock widget is open or closed. 0577 * The toogleViewAction triggers this slot 0578 */ 0579 void toggleView(bool Open = true); 0580 0581 /** 0582 * Makes this dock widget the current tab in its dock area. 0583 * The function only has an effect, if the dock widget is open. A call 0584 * to this function will not toggle the view, so if it is closed, 0585 * nothing will happen 0586 */ 0587 void setAsCurrentTab(); 0588 0589 /** 0590 * Brings the dock widget to the front 0591 * This means: 0592 * - If the dock widget is tabbed with other dock widgets but its tab is not current, it's made current. 0593 * - If the dock widget is floating, QWindow::raise() is called. 0594 * This only applies if the dock widget is already open. If closed, does nothing. 0595 */ 0596 void raise(); 0597 0598 /** 0599 * This function will make a docked widget floating 0600 */ 0601 void setFloating(); 0602 0603 /** 0604 * This function will delete the dock widget and its content from the 0605 * docking system 0606 */ 0607 void deleteDockWidget(); 0608 0609 /** 0610 * Closes the dock widget. 0611 * The function forces closing of the dock widget even for CustomCloseHandling. 0612 */ 0613 void closeDockWidget(); 0614 0615 /** 0616 * Request closing of the dock widget. 0617 * For DockWidget with default close handling, the function does the same 0618 * like clodeDockWidget() but if the flas CustomCloseHandling is set, 0619 * the function only emits the closeRequested() signal. 0620 */ 0621 void requestCloseDockWidget(); 0622 0623 /** 0624 * Shows the widget in full-screen mode. 0625 * Normally this function only affects windows. To make the interface 0626 * compatible to QDockWidget, this function also maximizes a floating 0627 * dock widget. 0628 * 0629 * \note Full-screen mode works fine under Windows, but has certain 0630 * problems (doe not work) under X (Linux). These problems are due to 0631 * limitations of the ICCCM protocol that specifies the communication 0632 * between X11 clients and the window manager. ICCCM simply does not 0633 * understand the concept of non-decorated full-screen windows. 0634 */ 0635 void showFullScreen(); 0636 0637 /** 0638 * This function complements showFullScreen() to restore the widget 0639 * after it has been in full screen mode. 0640 */ 0641 void showNormal(); 0642 0643 /** 0644 * Sets the dock widget into auto hide mode if this feature is enabled 0645 * via CDockManager::setAutoHideFlags(CDockManager::AutoHideFeatureEnabled) 0646 */ 0647 void setAutoHide(bool Enable, SideBarLocation Location = SideBarNone, int TabIndex = -1); 0648 0649 /** 0650 * Switches the dock widget to auto hide mode or vice versa depending on its 0651 * current state. 0652 */ 0653 void toggleAutoHide(SideBarLocation Location = SideBarNone); 0654 0655 0656 Q_SIGNALS: 0657 /** 0658 * This signal is emitted if the dock widget is opened or closed 0659 */ 0660 void viewToggled(bool Open); 0661 0662 /** 0663 * This signal is emitted if the dock widget is closed 0664 */ 0665 void closed(); 0666 0667 /** 0668 * This signal is emitted if the window title of this dock widget 0669 * changed 0670 */ 0671 void titleChanged(const QString& Title); 0672 0673 /** 0674 * This signal is emitted when the floating property changes. 0675 * The topLevel parameter is true if the dock widget is now floating; 0676 * otherwise it is false. 0677 */ 0678 void topLevelChanged(bool topLevel); 0679 0680 /** 0681 * This signal is emitted, if close is requested 0682 */ 0683 void closeRequested(); 0684 0685 /** 0686 * This signal is emitted when the dock widget becomes visible (or invisible). 0687 * This happens when the widget is hidden or shown, as well as when it is 0688 * docked in a tabbed dock area and its tab becomes selected or unselected. 0689 */ 0690 void visibilityChanged(bool visible); 0691 0692 /** 0693 * This signal is emitted when the features property changes. 0694 * The features parameter gives the new value of the property. 0695 */ 0696 void featuresChanged(ads::CDockWidget::DockWidgetFeatures features); 0697 }; // class DockWidget 0698 } // namespace ads 0699 0700 Q_DECLARE_OPERATORS_FOR_FLAGS(ads::CDockWidget::DockWidgetFeatures) 0701 //----------------------------------------------------------------------------- 0702 #endif // DockWidgetH