diff --git a/demo/MainWindow.cpp b/demo/MainWindow.cpp index e5b910c..518afa8 100644 --- a/demo/MainWindow.cpp +++ b/demo/MainWindow.cpp @@ -779,6 +779,9 @@ CMainWindow::CMainWindow(QWidget *parent) : // uncomment if you would like to close tabs with the middle mouse button, web browser style // CDockManager::setConfigFlag(CDockManager::MiddleMouseButtonClosesTab, true); + // uncomment if you would like to avoid using the built-in QSS stylesheet + // CDockManager::setConfigFlag(CDockManager::DisableStylesheet, true); + // Now create the dock manager and its content d->DockManager = new CDockManager(this); d->DockManager->setDockWidgetToolBarStyle(Qt::ToolButtonIconOnly, ads::CDockWidget::StateFloating); diff --git a/src/DockManager.cpp b/src/DockManager.cpp index 605d0e3..a7c639e 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -203,6 +203,10 @@ DockManagerPrivate::DockManagerPrivate(CDockManager* _public) : //============================================================================ void DockManagerPrivate::loadStylesheet() { + if (CDockManager::testConfigFlag(CDockManager::DisableStylesheet)) + { + return; + } initResource(); QString Result; QString FileName = ":ads/stylesheets/"; diff --git a/src/DockManager.h b/src/DockManager.h index f64aac0..1ac9215 100644 --- a/src/DockManager.h +++ b/src/DockManager.h @@ -64,8 +64,13 @@ struct AutoHideTabPrivate; * of the docking system. The dock manager uses an internal stylesheet to * style its components like splitters, tabs and buttons. If you want to * disable this stylesheet because your application uses its own, - * just call the function for settings the stylesheet with an empty - * string. + * you can either set the DisableStylesheet config flag before creating + * the dock manager: + * \code + * CDockManager::setConfigFlag(CDockManager::DisableStylesheet, true); + * \endcode + * Or call the function for settings the stylesheet with an empty string + * after creating the dock manager: * \code * DockManager->setStyleSheet(""); * \endcode @@ -218,6 +223,7 @@ public: DoubleClickUndocksWidget = 0x10000000, //!< If the flag is set, a double click on a tab undocks the widget TabsAtBottom = 0x20000000, //!< If the flag is set, tabs will be shown at the bottom instead of in the title bar. UseNativeWindows = 0x40000000, //!< If the flag is set, windows for the dock and area widgets will be native. + DisableStylesheet = 0x80000000, //!< If the flag is set, the dock manager will not apply the default stylesheet DefaultDockAreaButtons = DockAreaHasCloseButton