KDDockWidgets API Documentation 2.0
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 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 "kddockwidgets/docks_export.h"
23#include "kddockwidgets/KDDockWidgets.h"
24
25namespace KDDockWidgets {
26
27namespace Core {
28class DockWidget;
29class MainWindow;
30class DropArea;
31class Draggable;
32class ViewFactory;
33}
34
35typedef KDDockWidgets::Core::DockWidget *(*DockWidgetFactoryFunc)(const QString &name);
36typedef KDDockWidgets::Core::MainWindow *(*MainWindowFactoryFunc)(const QString &name, KDDockWidgets::MainWindowOptions);
37typedef bool (*DragAboutToStartFunc)(Core::Draggable *draggable);
38typedef void (*DragEndedFunc)();
39
52typedef bool (*DropIndicatorAllowedFunc)(DropLocation location,
53 const Vector<Core::DockWidget *> &source,
54 const Vector<Core::DockWidget *> &target,
55 Core::DropArea *dropArea);
56
63class DOCKS_EXPORT Config
64{
65public:
67 static Config &self();
68
70 ~Config();
71
77 enum Flag {
78 Flag_None = 0,
79 Flag_NativeTitleBar = 1,
81 Flag_AeroSnapWithClientDecos =
82 2,
85 Flag_AlwaysTitleBarWhenFloating =
86 4,
89 Flag_HideTitleBarWhenTabsVisible = 8,
91 Flag_AlwaysShowTabs = 16,
92 Flag_AllowReorderTabs = 32,
93 Flag_TabsHaveCloseButton =
94 64,
95 Flag_DoubleClickMaximizes = 128,
97 Flag_TitleBarHasMaximizeButton =
98 256,
100 Flag_TitleBarIsFocusable =
101 512,
104 Flag_LazyResize = 1024,
106 Flag_DontUseUtilityFloatingWindows = 0x1000,
107 Flag_TitleBarHasMinimizeButton =
108 0x2000 | Flag_DontUseUtilityFloatingWindows,
113 Flag_TitleBarNoFloatButton = 0x4000,
114 Flag_AutoHideSupport =
115 0x8000 | Flag_TitleBarNoFloatButton,
119 Flag_KeepAboveIfNotUtilityWindow =
120 0x10000,
123 Flag_CloseOnlyCurrentTab = 0x20000,
125 Flag_ShowButtonsOnTabBarIfTitleBarHidden =
126 0x40000,
129 Flag_AllowSwitchingTabsViaMenu = 0x80000,
131 Flag_AutoHideAsTabGroups = 0x100000,
132 Flag_Default = Flag_AeroSnapWithClientDecos
133 };
134 Q_DECLARE_FLAGS(Flags, Flag)
135
136
138 CustomizableWidget_None = 0,
141 CustomizableWidget_Frame,
143 CustomizableWidget_TabBar,
146 CustomizableWidget_FloatingWindow,
148 CustomizableWidget_Separator
149 };
150 Q_DECLARE_FLAGS(CustomizableWidgets, CustomizableWidget)
151
152
156 InternalFlag_None = 0,
157 InternalFlag_NoAeroSnap = 1,
158 InternalFlag_DontUseParentForFloatingWindows =
159 2,
160 InternalFlag_DontUseQtToolWindowsForFloatingWindows =
161 4,
162 InternalFlag_DontShowWhenUnfloatingHiddenWindow =
163 8,
164 InternalFlag_UseTransparentFloatingWindow =
165 16,
167 InternalFlag_DisableTranslucency =
168 32,
171 InternalFlag_TopLevelIndicatorRubberBand =
172 64
174 };
175 Q_DECLARE_FLAGS(InternalFlags, InternalFlag)
176
177
178 Flags flags() const;
179
184 void setFlags(Flags flags);
185
187 static bool hasFlag(Flag);
188
202 void setDockWidgetFactoryFunc(DockWidgetFactoryFunc);
203
206 DockWidgetFactoryFunc dockWidgetFactoryFunc() const;
207
211 void setMainWindowFactoryFunc(MainWindowFactoryFunc);
212
215 MainWindowFactoryFunc mainWindowFactoryFunc() const;
216
225 void setViewFactory(Core::ViewFactory *);
226
228 Core::ViewFactory *viewFactory() const;
229
235 int separatorThickness() const;
236
239 void setSeparatorThickness(int value);
240
243 void setDraggedWindowOpacity(double opacity);
244
248 void setTransparencyOnlyOverDropIndicator(bool only);
249
252 double draggedWindowOpacity() const;
253
257 bool transparencyOnlyOverDropIndicator() const;
258
262 void setDropIndicatorsInhibited(bool inhibit) const;
263
266 bool dropIndicatorsInhibited() const;
267
293 void setDropIndicatorAllowedFunc(DropIndicatorAllowedFunc func);
294
306 void setDragAboutToStartFunc(DragAboutToStartFunc func);
307 DragAboutToStartFunc dragAboutToStartFunc() const;
308
312 void setDragEndedFunc(DragEndedFunc func);
313 DragEndedFunc dragEndedFunc() const;
314
319 DropIndicatorAllowedFunc dropIndicatorAllowedFunc() const;
320
324 void setAbsoluteWidgetMinSize(Size size);
325 Size absoluteWidgetMinSize() const;
326
330 void setAbsoluteWidgetMaxSize(Size size);
331 Size absoluteWidgetMaxSize() const;
332
337 // via CSS stylesheets.
338 void setDisabledPaintEvents(CustomizableWidgets);
339 Config::CustomizableWidgets disabledPaintEvents() const;
340
344 InternalFlags internalFlags() const;
345
349 void setInternalFlags(InternalFlags flags);
350
354 void setMDIPopupThreshold(int);
355 int mdiPopupThreshold() const;
356
360 void setStartDragDistance(int);
361
365 int startDragDistance() const;
366
368 void printDebug();
369
373 void setLayoutSaverStrictMode(bool);
374 bool layoutSaverUsesStrictMode() const;
375
379 void setOnlyProgrammaticDrag(bool);
380 bool onlyProgrammaticDrag() const;
381
382private:
384 Config();
385 class Private;
386 Private *const d;
387};
388
389}
390
391Q_DECLARE_OPERATORS_FOR_FLAGS(KDDockWidgets::Config::Flags)
392
393#endif
#define KDDW_DELETE_COPY_CTOR(NAME)
Singleton to allow to choose certain behaviours of the framework.
Definition Config.h:64
CustomizableWidget
List of customizable widgets.
Definition Config.h:137
@ CustomizableWidget_DockWidget
The dock widget.
Definition Config.h:140
@ CustomizableWidget_TabWidget
The tab widget which relates to the tab bar.
Definition Config.h:145
@ CustomizableWidget_TitleBar
The title bar.
Definition Config.h:139
Flag
Flag enum to tune certain behaviours, the defaults are Flag_Default.
Definition Config.h:77
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
A factory class for allowing the user to customize some internal views. This is optional,...
Class to abstract QAction, so code still works with QtQuick and Flutter.
void(* DragEndedFunc)()
Definition Config.h:38
DropLocation
Enum describing the different drop indicator types.
bool(* DropIndicatorAllowedFunc)(DropLocation location, const Vector< Core::DockWidget * > &source, const Vector< Core::DockWidget * > &target, Core::DropArea *dropArea)
Function to allow more granularity to disallow where widgets are dropped.
Definition Config.h:52
KDDockWidgets::Core::DockWidget *(* DockWidgetFactoryFunc)(const QString &name)
Definition Config.h:35
bool(* DragAboutToStartFunc)(Core::Draggable *draggable)
Definition Config.h:37
KDDockWidgets::Core::MainWindow *(* MainWindowFactoryFunc)(const QString &name, KDDockWidgets::MainWindowOptions)
Definition Config.h:36

© 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 by doxygen 1.9.8