KDDockWidgets API Documentation  1.5
Config.h
Go to the documentation of this file.
1 /*
2  This file is part of KDDockWidgets.
3 
4  SPDX-FileCopyrightText: 2019-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5  Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6 
7  SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8 
9  Contact KDAB at <info@kdab.com> for commercial licensing options.
10 */
11 
19 #ifndef KD_DOCKWIDGETS_CONFIG_H
20 #define KD_DOCKWIDGETS_CONFIG_H
21 
22 #include "docks_export.h"
23 
24 #include <qglobal.h>
25 
26 QT_BEGIN_NAMESPACE
27 class QQmlEngine;
28 class QSize;
29 QT_END_NAMESPACE
30 
31 namespace KDDockWidgets {
32 
33 class DockWidgetBase;
34 class MainWindowBase;
35 class FrameworkWidgetFactory;
36 
37 typedef KDDockWidgets::DockWidgetBase *(*DockWidgetFactoryFunc)(const QString &name);
38 typedef KDDockWidgets::MainWindowBase *(*MainWindowFactoryFunc)(const QString &name);
39 
45 typedef bool (*TabbingAllowedFunc)(const QVector<DockWidgetBase *> &source,
46  const QVector<DockWidgetBase *> &target);
47 
54 class DOCKS_EXPORT Config
55 {
56 public:
58  static Config &self();
59 
61  ~Config();
62 
67  enum Flag
68  {
69  Flag_None = 0,
70  Flag_NativeTitleBar = 1,
71  Flag_AeroSnapWithClientDecos = 2,
72  Flag_AlwaysTitleBarWhenFloating = 4,
73  Flag_HideTitleBarWhenTabsVisible = 8,
74  Flag_AlwaysShowTabs = 16,
75  Flag_AllowReorderTabs = 32,
76  Flag_TabsHaveCloseButton = 64,
77  Flag_DoubleClickMaximizes = 128,
78  Flag_TitleBarHasMaximizeButton = 256,
79  Flag_TitleBarIsFocusable = 512,
80  Flag_LazyResize = 1024,
81  Flag_DontUseUtilityFloatingWindows = 0x1000,
82  Flag_TitleBarHasMinimizeButton = 0x2000 | Flag_DontUseUtilityFloatingWindows,
83  Flag_TitleBarNoFloatButton = 0x4000,
84  Flag_AutoHideSupport = 0x8000 | Flag_TitleBarNoFloatButton,
85  Flag_KeepAboveIfNotUtilityWindow = 0x10000,
87  Flag_CloseOnlyCurrentTab = 0x20000,
88  Flag_ShowButtonsOnTabBarIfTitleBarHidden = 0x40000,
89  Flag_AllowSwitchingTabsViaMenu = 0x80000,
90  Flag_Default = Flag_AeroSnapWithClientDecos
91  };
92  Q_DECLARE_FLAGS(Flags, Flag)
93 
94 
96  {
97  CustomizableWidget_None = 0,
104  CustomizableWidget_Separator
105  };
106  Q_DECLARE_FLAGS(CustomizableWidgets, CustomizableWidget)
107 
108 
109  enum InternalFlag
112  {
113  InternalFlag_None = 0,
114  InternalFlag_NoAeroSnap = 1,
115  InternalFlag_DontUseParentForFloatingWindows = 2,
116  InternalFlag_DontUseQtToolWindowsForFloatingWindows = 4,
117  InternalFlag_DontShowWhenUnfloatingHiddenWindow = 8,
118  InternalFlag_UseTransparentFloatingWindow = 16,
119  InternalFlag_DisableTranslucency = 32,
120  InternalFlag_TopLevelIndicatorRubberBand = 64
122  };
123  Q_DECLARE_FLAGS(InternalFlags, InternalFlag)
124 
125 
126  Flags flags() const;
127 
132  void setFlags(Flags flags);
133 
147  void setDockWidgetFactoryFunc(DockWidgetFactoryFunc);
148 
151  DockWidgetFactoryFunc dockWidgetFactoryFunc() const;
152 
156  void setMainWindowFactoryFunc(MainWindowFactoryFunc);
157 
160  MainWindowFactoryFunc mainWindowFactoryFunc() const;
161 
172  void setFrameworkWidgetFactory(FrameworkWidgetFactory *);
173 
175  FrameworkWidgetFactory *frameworkWidgetFactory() const;
176 
182  int separatorThickness() const;
183 
186  void setSeparatorThickness(int value);
187 
190  void setDraggedWindowOpacity(qreal opacity);
191 
194  qreal draggedWindowOpacity() const;
195 
199  void setDropIndicatorsInhibited(bool inhibit) const;
200 
203  bool dropIndicatorsInhibited() const;
204 
225  void setTabbingAllowedFunc(TabbingAllowedFunc func);
226 
230  TabbingAllowedFunc tabbingAllowedFunc() const;
231 
235  void setAbsoluteWidgetMinSize(QSize size);
236  QSize absoluteWidgetMinSize() const;
237 
241  void setAbsoluteWidgetMaxSize(QSize size);
242  QSize absoluteWidgetMaxSize() const;
243 
247  // via CSS stylesheets.
248  void setDisabledPaintEvents(CustomizableWidgets);
249  Config::CustomizableWidgets disabledPaintEvents() const;
250 
254  InternalFlags internalFlags() const;
255 
259  void setInternalFlags(InternalFlags flags);
260 
264  void setMDIPopupThreshold(int);
265  int mdiPopupThreshold() const;
266 
267 #ifdef KDDOCKWIDGETS_QTQUICK
268  void setQmlEngine(QQmlEngine *);
270  QQmlEngine *qmlEngine() const;
271 #endif
272 
273 private:
274  Q_DISABLE_COPY(Config)
275  Config();
276  class Private;
277  Private *const d;
278 };
279 
280 }
281 
282 Q_DECLARE_OPERATORS_FOR_FLAGS(KDDockWidgets::Config::Flags)
283 
284 #endif
KDDockWidgets::Config::CustomizableWidget_DockWidget
@ CustomizableWidget_DockWidget
The dock widget.
Definition: Config.h:99
KDDockWidgets::Config::CustomizableWidget_TabBar
@ CustomizableWidget_TabBar
The tab bar, child of Frame, which contains 1 or more dock widgets.
Definition: Config.h:101
KDDockWidgets::MainWindowFactoryFunc
KDDockWidgets::MainWindowBase *(* MainWindowFactoryFunc)(const QString &name)
Definition: Config.h:38
KDDockWidgets::DockWidgetFactoryFunc
KDDockWidgets::DockWidgetBase *(* DockWidgetFactoryFunc)(const QString &name)
Definition: Config.h:37
KDDockWidgets::Config::CustomizableWidget_FloatingWindow
@ CustomizableWidget_FloatingWindow
A top-level window. The container for 1 or more Frame nested side by side.
Definition: Config.h:103
QSize
KDDockWidgets::Config::CustomizableWidget_TitleBar
@ CustomizableWidget_TitleBar
The title bar.
Definition: Config.h:98
KDDockWidgets::Config::CustomizableWidget_TabWidget
@ CustomizableWidget_TabWidget
The tab widget which relates to the tab bar.
Definition: Config.h:102
KDDockWidgets::TabbingAllowedFunc
bool(* TabbingAllowedFunc)(const QVector< DockWidgetBase * > &source, const QVector< DockWidgetBase * > &target)
Function to allow the user more granularity to disallow dock widgets to tab together.
Definition: Config.h:45
QString
KDDockWidgets::Config
Singleton to allow to choose certain behaviours of the framework.
Definition: Config.h:55
KDDockWidgets::Config::Flag
Flag
Flag enum to tune certain behaviours, the defaults are Flag_Default.
Definition: Config.h:68
KDDockWidgets::Config::CustomizableWidget_Frame
@ CustomizableWidget_Frame
The container for a group of 1 or more dockwidgets which are tabbed together.
Definition: Config.h:100
KDDockWidgets::FrameworkWidgetFactory
A factory class for allowing the user to customize some internal widgets. This is optional,...
Definition: FrameworkWidgetFactory.h:68
KDDockWidgets::Config::CustomizableWidget
CustomizableWidget
List of customizable widgets.
Definition: Config.h:96
KDDockWidgets::DockWidgetBase
The DockWidget base-class. DockWidget and DockWidgetBase are only split in two so we can share some c...
Definition: DockWidgetBase.h:61
KDDockWidgets
Definition: Config.cpp:36
KDDockWidgets::MainWindowBase
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
Definition: MainWindowBase.h:56
QVector< DockWidgetBase * >

© 2019-2022 Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated on Mon Mar 7 2022 02:01:20 for KDDockWidgets API Documentation by doxygen 1.8.20