KDDockWidgets API Documentation 1.7
Loading...
Searching...
No Matches
Config.h
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2019-2023 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#include "KDDockWidgets.h"
24
25#include <qglobal.h>
26
27QT_BEGIN_NAMESPACE
28class QQmlEngine;
29class QSize;
30QT_END_NAMESPACE
31
32namespace KDDockWidgets {
33
34class DockWidgetBase;
35class MainWindowBase;
36class FrameworkWidgetFactory;
37class DropArea;
38
39typedef KDDockWidgets::DockWidgetBase *(*DockWidgetFactoryFunc)(const QString &name);
40typedef KDDockWidgets::MainWindowBase *(*MainWindowFactoryFunc)(const QString &name);
41
54typedef bool (*DropIndicatorAllowedFunc)(DropLocation location,
55 const QVector<DockWidgetBase *> &source,
56 const QVector<DockWidgetBase *> &target,
57 DropArea *dropArea);
58
65typedef bool (*TabbingAllowedFunc)(const QVector<DockWidgetBase *> &source,
66 const QVector<DockWidgetBase *> &target);
67
74class DOCKS_EXPORT Config
75{
76public:
78 static Config &self();
79
81 ~Config();
82
87 enum Flag {
88 Flag_None = 0,
89 Flag_NativeTitleBar = 1,
90 Flag_AeroSnapWithClientDecos = 2,
91 Flag_AlwaysTitleBarWhenFloating = 4,
92 Flag_HideTitleBarWhenTabsVisible = 8,
93 Flag_AlwaysShowTabs = 16,
94 Flag_AllowReorderTabs = 32,
95 Flag_TabsHaveCloseButton = 64,
96 Flag_DoubleClickMaximizes = 128,
97 Flag_TitleBarHasMaximizeButton = 256,
98 Flag_TitleBarIsFocusable = 512,
99 Flag_LazyResize = 1024,
100 Flag_DontUseUtilityFloatingWindows = 0x1000,
101 Flag_TitleBarHasMinimizeButton = 0x2000 | Flag_DontUseUtilityFloatingWindows,
102 Flag_TitleBarNoFloatButton = 0x4000,
103 Flag_AutoHideSupport = 0x8000 | Flag_TitleBarNoFloatButton,
105 Flag_KeepAboveIfNotUtilityWindow = 0x10000,
106 Flag_CloseOnlyCurrentTab = 0x20000,
107 Flag_ShowButtonsOnTabBarIfTitleBarHidden = 0x40000,
108 Flag_AllowSwitchingTabsViaMenu = 0x80000,
109 Flag_AutoHideAsTabGroups = 0x100000,
110 Flag_Default = Flag_AeroSnapWithClientDecos
111 };
112 Q_DECLARE_FLAGS(Flags, Flag)
113
114
125 Q_DECLARE_FLAGS(CustomizableWidgets, CustomizableWidget)
126
127
131 InternalFlag_None = 0,
132 InternalFlag_NoAeroSnap = 1,
133 InternalFlag_DontUseParentForFloatingWindows = 2,
134 InternalFlag_DontUseQtToolWindowsForFloatingWindows = 4,
135 InternalFlag_DontShowWhenUnfloatingHiddenWindow = 8,
136 InternalFlag_UseTransparentFloatingWindow = 16,
137 InternalFlag_DisableTranslucency = 32,
139 InternalFlag_TopLevelIndicatorRubberBand = 64
140 };
141 Q_DECLARE_FLAGS(InternalFlags, InternalFlag)
142
143
144 Flags flags() const;
145
150 void setFlags(Flags flags);
151
165 void setDockWidgetFactoryFunc(DockWidgetFactoryFunc);
166
169 DockWidgetFactoryFunc dockWidgetFactoryFunc() const;
170
174 void setMainWindowFactoryFunc(MainWindowFactoryFunc);
175
178 MainWindowFactoryFunc mainWindowFactoryFunc() const;
179
190 void setFrameworkWidgetFactory(FrameworkWidgetFactory *);
191
193 FrameworkWidgetFactory *frameworkWidgetFactory() const;
194
200 int separatorThickness() const;
201
204 void setSeparatorThickness(int value);
205
208 void setDraggedWindowOpacity(qreal opacity);
209
212 qreal draggedWindowOpacity() const;
213
217 void setDropIndicatorsInhibited(bool inhibit) const;
218
221 bool dropIndicatorsInhibited() const;
222
247 void setTabbingAllowedFunc(TabbingAllowedFunc func);
248
252 TabbingAllowedFunc tabbingAllowedFunc() const;
253
279 void setDropIndicatorAllowedFunc(DropIndicatorAllowedFunc func);
280
284 DropIndicatorAllowedFunc dropIndicatorAllowedFunc() const;
285
289 void setAbsoluteWidgetMinSize(QSize size);
290 QSize absoluteWidgetMinSize() const;
291
295 void setAbsoluteWidgetMaxSize(QSize size);
296 QSize absoluteWidgetMaxSize() const;
297
301 // via CSS stylesheets.
302 void setDisabledPaintEvents(CustomizableWidgets);
303 Config::CustomizableWidgets disabledPaintEvents() const;
304
308 InternalFlags internalFlags() const;
309
313 void setInternalFlags(InternalFlags flags);
314
318 void setMDIPopupThreshold(int);
319 int mdiPopupThreshold() const;
320
322 void printDebug();
323
324#ifdef KDDOCKWIDGETS_QTQUICK
326 void setQmlEngine(QQmlEngine *);
327 QQmlEngine *qmlEngine() const;
328#endif
329
330private:
331 Q_DISABLE_COPY(Config)
332 Config();
333 class Private;
334 Private *const d;
335};
336
337}
338
339Q_DECLARE_OPERATORS_FOR_FLAGS(KDDockWidgets::Config::Flags)
340
341#endif
File with KDDockWidgets namespace-level enums and methods.
Singleton to allow to choose certain behaviours of the framework.
Definition Config.h:75
CustomizableWidget
List of customizable widgets.
Definition Config.h:115
@ CustomizableWidget_TabBar
The tab bar, child of Frame, which contains 1 or more dock widgets.
Definition Config.h:120
@ CustomizableWidget_DockWidget
The dock widget.
Definition Config.h:118
@ CustomizableWidget_Frame
The container for a group of 1 or more dockwidgets which are tabbed together.
Definition Config.h:119
@ CustomizableWidget_TabWidget
The tab widget which relates to the tab bar.
Definition Config.h:121
@ CustomizableWidget_FloatingWindow
A top-level window. The container for 1 or more Frame nested side by side.
Definition Config.h:122
@ CustomizableWidget_TitleBar
The title bar.
Definition Config.h:117
Flag
Flag enum to tune certain behaviours, the defaults are Flag_Default.
Definition Config.h:87
The DockWidget base-class. DockWidget and DockWidgetBase are only split in two so we can share some c...
A factory class for allowing the user to customize some internal widgets. This is optional,...
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
KDDockWidgets::MainWindowBase *(* MainWindowFactoryFunc)(const QString &name)
Definition Config.h:40
bool(* DropIndicatorAllowedFunc)(DropLocation location, const QVector< DockWidgetBase * > &source, const QVector< DockWidgetBase * > &target, DropArea *dropArea)
Function to allow more granularity to disallow where widgets are dropped.
Definition Config.h:54
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:65
DropLocation
Enum describing the different drop indicator types.
KDDockWidgets::DockWidgetBase *(* DockWidgetFactoryFunc)(const QString &name)
Definition Config.h:39

© 2019-2023 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 Wed Nov 1 2023 00:02:31 for KDDockWidgets API Documentation by doxygen 1.9.8