KDDockWidgets API Documentation 2.1
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 InternalFlag_NoDeleteLaterWorkaround = 128,
177 InternalFlag_DeleteSeparatorsLater = 256
178 };
179 Q_DECLARE_FLAGS(InternalFlags, InternalFlag)
180
181
182 enum MDIFlag {
183 MDIFlag_None = 0,
184 MDIFlag_NoClickToRaise = 1
185 };
186 Q_DECLARE_FLAGS(MDIFlags, MDIFlag)
187
188
189 Flags flags() const;
190
193 MDIFlags mdiFlags() const;
194
199 void setFlags(Flags flags);
200
202 void setMDIFlags(MDIFlags);
203
205 static bool hasFlag(Flag);
206
208 static bool hasMDIFlag(MDIFlag);
209
223 void setDockWidgetFactoryFunc(DockWidgetFactoryFunc);
224
227 DockWidgetFactoryFunc dockWidgetFactoryFunc() const;
228
232 void setMainWindowFactoryFunc(MainWindowFactoryFunc);
233
236 MainWindowFactoryFunc mainWindowFactoryFunc() const;
237
246 void setViewFactory(Core::ViewFactory *);
247
249 Core::ViewFactory *viewFactory() const;
250
256 int separatorThickness() const;
257
261 void setSeparatorThickness(int value);
262
265 int layoutSpacing() const;
266
271 void setLayoutSpacing(int);
272
275 void setDraggedWindowOpacity(double opacity);
276
280 void setTransparencyOnlyOverDropIndicator(bool only);
281
284 double draggedWindowOpacity() const;
285
289 bool transparencyOnlyOverDropIndicator() const;
290
294 void setDropIndicatorsInhibited(bool inhibit) const;
295
298 bool dropIndicatorsInhibited() const;
299
325 void setDropIndicatorAllowedFunc(DropIndicatorAllowedFunc func);
326
338 void setDragAboutToStartFunc(DragAboutToStartFunc func);
339 DragAboutToStartFunc dragAboutToStartFunc() const;
340
344 void setDragEndedFunc(DragEndedFunc func);
345 DragEndedFunc dragEndedFunc() const;
346
351 DropIndicatorAllowedFunc dropIndicatorAllowedFunc() const;
352
356 void setAbsoluteWidgetMinSize(Size size);
357 Size absoluteWidgetMinSize() const;
358
362 void setAbsoluteWidgetMaxSize(Size size);
363 Size absoluteWidgetMaxSize() const;
364
369 // via CSS stylesheets.
370 void setDisabledPaintEvents(CustomizableWidgets);
371 Config::CustomizableWidgets disabledPaintEvents() const;
372
376 InternalFlags internalFlags() const;
377
381 void setInternalFlags(InternalFlags flags);
382
386 void setMDIPopupThreshold(int);
387 int mdiPopupThreshold() const;
388
392 void setStartDragDistance(int);
393
397 int startDragDistance() const;
398
400 void printDebug();
401
405 void setLayoutSaverStrictMode(bool);
406 bool layoutSaverUsesStrictMode() const;
407
411 void setOnlyProgrammaticDrag(bool);
412 bool onlyProgrammaticDrag() const;
413
414private:
416 Config();
417 class Private;
418 Private *const d;
419};
420
421}
422
423Q_DECLARE_OPERATORS_FOR_FLAGS(KDDockWidgets::Config::Flags)
424
425#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
MDIFlag
Flags to be used in MDI mode.
Definition Config.h:182
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