KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
KDDockWidgets::Config Class Reference

Singleton to allow to choose certain behaviours of the framework. More...

#include <Config.h>

Inheritance diagram for KDDockWidgets::Config:
Inheritance graph
[legend]

Public Types

enum  CustomizableWidget {
  CustomizableWidget_None = 0 , CustomizableWidget_TitleBar , CustomizableWidget_DockWidget , CustomizableWidget_Frame ,
  CustomizableWidget_TabBar , CustomizableWidget_TabWidget , CustomizableWidget_FloatingWindow , CustomizableWidget_Separator
}
 List of customizable widgets. More...
 
enum  Flag {
  Flag_None = 0 , Flag_NativeTitleBar = 1 , Flag_AeroSnapWithClientDecos , Flag_AlwaysTitleBarWhenFloating ,
  Flag_HideTitleBarWhenTabsVisible = 8 , Flag_AlwaysShowTabs = 16 , Flag_AllowReorderTabs = 32 , Flag_TabsHaveCloseButton ,
  Flag_DoubleClickMaximizes = 128 , Flag_TitleBarHasMaximizeButton , Flag_TitleBarIsFocusable , Flag_LazyResize = 1024 ,
  Flag_DontUseUtilityFloatingWindows = 0x1000 , Flag_TitleBarHasMinimizeButton , Flag_TitleBarNoFloatButton = 0x4000 , Flag_AutoHideSupport ,
  Flag_KeepAboveIfNotUtilityWindow , Flag_CloseOnlyCurrentTab = 0x20000 , Flag_ShowButtonsOnTabBarIfTitleBarHidden , Flag_AllowSwitchingTabsViaMenu = 0x80000 ,
  Flag_AutoHideAsTabGroups = 0x100000 , Flag_Default = Flag_AeroSnapWithClientDecos
}
 Flag enum to tune certain behaviours, the defaults are Flag_Default. More...
 
enum  InternalFlag {
  InternalFlag_None = 0 , InternalFlag_NoAeroSnap = 1 , InternalFlag_DontUseParentForFloatingWindows , InternalFlag_DontUseQtToolWindowsForFloatingWindows ,
  InternalFlag_DontShowWhenUnfloatingHiddenWindow , InternalFlag_UseTransparentFloatingWindow , InternalFlag_DisableTranslucency , InternalFlag_TopLevelIndicatorRubberBand ,
  InternalFlag_NoDeleteLaterWorkaround = 128 , InternalFlag_DeleteSeparatorsLater = 256
}
 
enum  MDIFlag { MDIFlag_None = 0 , MDIFlag_NoClickToRaise = 1 }
 Flags to be used in MDI mode. More...
 

Public Member Functions

 ~Config ()
 destructor, called at shutdown
 
Size absoluteWidgetMaxSize () const
 
Size absoluteWidgetMinSize () const
 
Config::CustomizableWidgets disabledPaintEvents () const
 
DockWidgetFactoryFunc dockWidgetFactoryFunc () const
 Returns the DockWidgetFactoryFunc. nullptr by default.
 
DragAboutToStartFunc dragAboutToStartFunc () const
 
DragEndedFunc dragEndedFunc () const
 
double draggedWindowOpacity () const
 returns the opacity to use when dragging dock widgets By default it's 1.0, fully opaque
 
DropIndicatorAllowedFunc dropIndicatorAllowedFunc () const
 Used internally by the framework. Returns the function which was passed to setDropIndicatorAllowedFunc() By default it's nullptr.
 
bool dropIndicatorsInhibited () const
 Returns whether drop indicators are inhibited. by default this is false unless you call setDropIndicatorsInhibited(true)
 
Flags flags () const
 returns the chosen flags
 
InternalFlags internalFlags () const
 
bool layoutSaverUsesStrictMode () const
 
int layoutSpacing () const
 
MainWindowFactoryFunc mainWindowFactoryFunc () const
 Returns the MainWindowFactoryFunc. nullptr by default.
 
MDIFlags mdiFlags () const
 returns the chosen MDI flags default is MDIFlag_None
 
int mdiPopupThreshold () const
 
bool onlyProgrammaticDrag () const
 
void printDebug ()
 Prints some debug information.
 
int separatorThickness () const
 Returns the thickness of the separator.
 
void setAbsoluteWidgetMaxSize (Size size)
 Sets the maximum size a dock widget can have. Widgets can still provide their own max-size and it will be respected, however it can never be bigger than this one.
 
void setAbsoluteWidgetMinSize (Size size)
 Sets the minimum size a dock widget can have. Widgets can still provide their own min-size and it will be respected, however it can never be smaller than this one.
 
void setDisabledPaintEvents (CustomizableWidgets)
 Disables our internal widget's paint events By default, KDDockWidget's internal widgets reimplement paintEvent(). Disabling them (which makes the base-class, QWidget::paintEvent() be called instead) can be useful if you want to style.
 
void setDockWidgetFactoryFunc (DockWidgetFactoryFunc)
 Registers a DockWidgetFactoryFunc.
 
void setDragAboutToStartFunc (DragAboutToStartFunc func)
 set a callback to be called once a drag starts
 
void setDragEndedFunc (DragEndedFunc func)
 set a callback to be called once drag ends
 
void setDraggedWindowOpacity (double opacity)
 sets the dragged window opacity 1.0 is fully opaque while 0.0 is fully transparent
 
void setDropIndicatorAllowedFunc (DropIndicatorAllowedFunc func)
 Allows the client app to disallow certain docking indicators.
 
void setDropIndicatorsInhibited (bool inhibit) const
 Allows to disable support for drop indicators while dragging By default drop indicators will be shown when dragging dock widgets. This functionality can be toggled whenever you need it (it's not a startup-only setting).
 
void setFlags (Flags flags)
 setter for the flags
 
void setInternalFlags (InternalFlags flags)
 
void setLayoutSaverStrictMode (bool)
 
void setLayoutSpacing (int)
 
void setMainWindowFactoryFunc (MainWindowFactoryFunc)
 counter-part of DockWidgetFactoryFunc but for the main window. Should be rarely used. It's good practice to have the main window before restoring a layout. It's here so we can use it in the linter executable
 
void setMDIFlags (MDIFlags)
 Setter for the MDI flags.
 
void setMDIPopupThreshold (int)
 Sets the MDI popup threshold. When the layout is MDI and you drag a dock widget X pixels behond the window's edge, it will float the dock widget. by default this value is 250px. Use -1 to disable.
 
void setOnlyProgrammaticDrag (bool)
 
void setSeparatorThickness (int value)
 setter for separatorThickness Note: Only use this function at startup before creating any DockWidget or MainWindow. Note: For backwards compatibility, setting separatorThickness will set layoutSpacing to the same value.
 
void setStartDragDistance (int)
 Sets how many pixels the mouse needs to travel before a drag is actually started Calling this is usually unneeded and just provided as a means to override Platform::startDragDistance() , which already has a reasonable default 4 pixels.
 
void setTransparencyOnlyOverDropIndicator (bool only)
 Sets whether transparency is only set when the dragged window is over a drop indicator This is only relevant when using setDraggedWindowOpacity() Default is false.
 
void setViewFactory (Core::ViewFactory *)
 Sets the ViewFactory.
 
int startDragDistance () const
 Returns the value set by setStartDragDistance() Returns -1 if setStartDragDistance() wasn't call, in which case the Platform::startDragDistance() will be used.
 
bool transparencyOnlyOverDropIndicator () const
 Returns whether transparency is only set when the dragged window is over a drop indicator This is only relevant when using setDraggedWindowOpacity() Default is false.
 
Core::ViewFactoryviewFactory () const
 getter for the framework view factory
 

Static Public Member Functions

static bool hasFlag (Flag)
 Returns whether the specified flag is set or not.
 
static bool hasMDIFlag (MDIFlag)
 Returns whether the specified MDI flag is set or not.
 
static Configself ()
 returns the singleton Config instance
 

Detailed Description

Singleton to allow to choose certain behaviours of the framework.

The setters should only be used before creating any DockWidget or MainWindow, preferably right after creating the QApplication.

Definition at line 63 of file Config.h.

Member Enumeration Documentation

◆ CustomizableWidget

List of customizable widgets.

Enumerator
CustomizableWidget_None 

None.

CustomizableWidget_TitleBar 

The title bar.

CustomizableWidget_DockWidget 

The dock widget.

CustomizableWidget_Frame 

The container for a group of 1 or more dockwidgets which are tabbed together

CustomizableWidget_TabBar 

The tab bar, child of Frame, which contains 1 or more dock widgets

CustomizableWidget_TabWidget 

The tab widget which relates to the tab bar.

CustomizableWidget_FloatingWindow 

A top-level window. The container for 1 or more Frame nested side by side

CustomizableWidget_Separator 

The draggable separator between dock widgets in a layout.

Definition at line 137 of file Config.h.

◆ Flag

Flag enum to tune certain behaviours, the defaults are Flag_Default.

Warning
Only the default is supported on all platforms. Not all options work with all window managers, Qt does its best to abstract the differences however that's only a best effort. This is true specially for any option that changes window flags.
Enumerator
Flag_None 

No option set.

Flag_NativeTitleBar 

Enables the Native OS title bar on OSes that support it (Windows 10, macOS), ignored otherwise.

Flag_AeroSnapWithClientDecos 

Deprecated. This is now default and cannot be turned off. Moving a window on Windows 10 uses native moving, as that works well across screens with different HDPI settings. There's no reason to use manual client/Qt window moving.

Flag_AlwaysTitleBarWhenFloating 

Floating windows will have a title bar even if Flag_HideTitleBarWhenTabsVisible is specified. Unneeded if Flag_HideTitleBarWhenTabsVisible isn't specified, as that's the default already.

Flag_HideTitleBarWhenTabsVisible 

Hides the title bar if there's tabs visible. The empty space in the tab bar becomes draggable.

Flag_AlwaysShowTabs 

Always show tabs, even if there's only one,.

Flag_AllowReorderTabs 

Allows user to re-order tabs by dragging them.

Flag_TabsHaveCloseButton 

Tabs will have a close button. Equivalent to QTabWidget::setTabsClosable(true).

Flag_DoubleClickMaximizes 

Double clicking the titlebar will maximize a floating window instead of re-docking it

Flag_TitleBarHasMaximizeButton 

The title bar will have a maximize/restore button when floating. This is mutually-exclusive with the floating button (since many apps behave that way).

Flag_TitleBarIsFocusable 

You can click the title bar and it will focus the last focused widget in the focus scope. If no previously focused widget then it focuses the user's dock widget guest, which should accept focus or use a focus proxy.

Flag_LazyResize 

The dock widgets are resized in a lazy manner. The actual resize only happens when you release the mouse button.

Flag_DontUseUtilityFloatingWindows 
Flag_TitleBarHasMinimizeButton 

The title bar will have a minimize button when floating. This implies Flag_DontUseUtilityFloatingWindows too, otherwise they wouldn't appear in the task bar.

Flag_TitleBarNoFloatButton 

The TitleBar won't show the float button.

Flag_AutoHideSupport 

Supports minimizing dock widgets to the side-bar. By default it also turns off the float button, but you can remove Flag_TitleBarNoFloatButton to have both.

Flag_KeepAboveIfNotUtilityWindow 

Only meaningful if Flag_DontUseUtilityFloatingWindows is set. If floating windows are normal windows, you might still want them to keep above and not minimize when you focus the main window.

Flag_CloseOnlyCurrentTab 

The TitleBar's close button will only close the current tab, instead of all of them

Flag_ShowButtonsOnTabBarIfTitleBarHidden 

When using Flag_HideTitleBarWhenTabsVisible the close/float buttons disappear with the title bar. With Flag_ShowButtonsOnTabBarIfHidden they'll be shown in the tab bar.

Flag_AllowSwitchingTabsViaMenu 

Allow switching tabs via a context menu when right clicking on the tab area

Flag_AutoHideAsTabGroups 

If tabbed dockwidgets are sent to/from sidebar, they're all sent and restored together.

Flag_Default 

The defaults.

Definition at line 77 of file Config.h.

◆ InternalFlag

Enumerator
InternalFlag_None 

The default.

InternalFlag_NoAeroSnap 

Only for development. Disables Aero-snap.

InternalFlag_DontUseParentForFloatingWindows 

FloatingWindows won't have a parent top-level.

InternalFlag_DontUseQtToolWindowsForFloatingWindows 

FloatingWindows will use Qt::Window instead of Qt::Tool.

InternalFlag_DontShowWhenUnfloatingHiddenWindow 

DockWidget::setFloating(false) won't do anything if the window is hidden.

InternalFlag_UseTransparentFloatingWindow 

For QtQuick only. Allows to have round-corners. It's flaky when used with native Windows drop-shadow.

InternalFlag_DisableTranslucency 

KDDW tries to detect if your Window Manager doesn't support transparent windows, but the detection might fail

InternalFlag_TopLevelIndicatorRubberBand 

with more exotic setups. This flag can be used to override.

Makes the rubber band of classic drop indicators to be top-level windows. Helps with working around MFC bugs,

InternalFlag_NoDeleteLaterWorkaround 

Disables workaround for QTBUG-83030. Will be the default since Qt 6.7 While the workaround works, it will cause memory leaks at shutdown,

InternalFlag_DeleteSeparatorsLater 

This flag allows to disable the workaround if you think you don't have the complex setup reported in QTBUG-83030.

Uses deleteLater() when disposing of separators

Definition at line 155 of file Config.h.

◆ MDIFlag

Flags to be used in MDI mode.

Enumerator
MDIFlag_None 
MDIFlag_NoClickToRaise 

Clicking on a MDI widget won't raise it.

Definition at line 182 of file Config.h.

Constructor & Destructor Documentation

◆ ~Config()

KDDockWidgets::Config::~Config ( )

destructor, called at shutdown

Definition at line 94 of file Config.cpp.

References KDDockWidgets::Core::Platform::instance(), and KDDockWidgets::Core::Platform::isInitialized().

Member Function Documentation

◆ absoluteWidgetMaxSize()

Size KDDockWidgets::Config::absoluteWidgetMaxSize ( ) const

Definition at line 307 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__absoluteWidgetMaxSize().

◆ absoluteWidgetMinSize()

Size KDDockWidgets::Config::absoluteWidgetMinSize ( ) const

Definition at line 291 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__absoluteWidgetMinSize().

◆ disabledPaintEvents()

Config::CustomizableWidgets KDDockWidgets::Config::disabledPaintEvents ( ) const

Definition at line 381 of file Config.cpp.

◆ dockWidgetFactoryFunc()

DockWidgetFactoryFunc KDDockWidgets::Config::dockWidgetFactoryFunc ( ) const

Returns the DockWidgetFactoryFunc. nullptr by default.

Definition at line 160 of file Config.cpp.

◆ dragAboutToStartFunc()

DragAboutToStartFunc KDDockWidgets::Config::dragAboutToStartFunc ( ) const

Definition at line 265 of file Config.cpp.

◆ dragEndedFunc()

DragEndedFunc KDDockWidgets::Config::dragEndedFunc ( ) const

Definition at line 275 of file Config.cpp.

◆ draggedWindowOpacity()

double KDDockWidgets::Config::draggedWindowOpacity ( ) const

returns the opacity to use when dragging dock widgets By default it's 1.0, fully opaque

Definition at line 240 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__draggedWindowOpacity().

◆ dropIndicatorAllowedFunc()

DropIndicatorAllowedFunc KDDockWidgets::Config::dropIndicatorAllowedFunc ( ) const

Used internally by the framework. Returns the function which was passed to setDropIndicatorAllowedFunc() By default it's nullptr.

See also
setDropIndicatorAllowedFunc().

Definition at line 255 of file Config.cpp.

◆ dropIndicatorsInhibited()

bool KDDockWidgets::Config::dropIndicatorsInhibited ( ) const

Returns whether drop indicators are inhibited. by default this is false unless you call setDropIndicatorsInhibited(true)

Definition at line 404 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__dropIndicatorsInhibited().

◆ flags()

Config::Flags KDDockWidgets::Config::flags ( ) const

◆ hasFlag()

bool KDDockWidgets::Config::hasFlag ( Flag  flag)
static

Returns whether the specified flag is set or not.

static

Definition at line 144 of file Config.cpp.

Referenced by KDDockWidgets::Core::TitleBar::onAutoHideClicked().

◆ hasMDIFlag()

bool KDDockWidgets::Config::hasMDIFlag ( MDIFlag  flag)
static

Returns whether the specified MDI flag is set or not.

static

Definition at line 150 of file Config.cpp.

◆ internalFlags()

Config::InternalFlags KDDockWidgets::Config::internalFlags ( ) const

Definition at line 312 of file Config.cpp.

◆ layoutSaverUsesStrictMode()

bool KDDockWidgets::Config::layoutSaverUsesStrictMode ( ) const

Definition at line 429 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__layoutSaverUsesStrictMode().

◆ layoutSpacing()

int KDDockWidgets::Config::layoutSpacing ( ) const

Returns the spacing between dock widgets By default this is the thickness of the separators, as they are between dock widgets.

Definition at line 192 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__layoutSpacing().

◆ mainWindowFactoryFunc()

MainWindowFactoryFunc KDDockWidgets::Config::mainWindowFactoryFunc ( ) const

Returns the MainWindowFactoryFunc. nullptr by default.

Definition at line 170 of file Config.cpp.

Referenced by KDDockWidgets::LayoutSaver::restoreLayout().

◆ mdiFlags()

Config::MDIFlags KDDockWidgets::Config::mdiFlags ( ) const

returns the chosen MDI flags default is MDIFlag_None

Definition at line 107 of file Config.cpp.

◆ mdiPopupThreshold()

int KDDockWidgets::Config::mdiPopupThreshold ( ) const

Definition at line 391 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__mdiPopupThreshold().

◆ onlyProgrammaticDrag()

bool KDDockWidgets::Config::onlyProgrammaticDrag ( ) const

Definition at line 439 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__onlyProgrammaticDrag().

◆ printDebug()

void KDDockWidgets::Config::printDebug ( )

Prints some debug information.

Definition at line 419 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__printDebug(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::printDebug().

◆ self()

Config & KDDockWidgets::Config::self ( )
static

returns the singleton Config instance

Definition at line 88 of file Config.cpp.

Referenced by KDDockWidgets::QtWidgets::IndicatorWindow::IndicatorWindow(), KDDockWidgets::Core::SegmentedDropIndicatorOverlay::SegmentedDropIndicatorOverlay(), KDDockWidgets::Core::Separator::Separator(), KDDockWidgets::actualOptions(), actualParent(), KDDockWidgets::QtWidgets::MDIArea::addDockWidget(), createIndicatorWindow(), KDDockWidgets::DockRegistry::dockByName(), KDDockWidgets::QtWidgets::Group::dragRect(), KDDockWidgets::Core::DropIndicatorOverlay::dropIndicatorVisible(), KDDockWidgets::QtQuick::TitleBar::event(), KDDockWidgets::QtWidgets::FloatingWindow::event(), flagsForFloatingWindow(), KDDockWidgets::Core::TitleBar::focus(), hackFindParentHarder(), KDDockWidgets::Core::DropArea::hover(), KDDockWidgets::QtWidgets::Stack::init(), KDDockWidgets::QtWidgets::TitleBar::init(), lint(), main(), KDDockWidgets::Core::TabBar::makeWindow(), KDDockWidgets::Core::TitleBar::makeWindow(), KDDockWidgets::QtWidgets::Stack::mousePressEvent(), KDDockWidgets::Core::TitleBar::onCloseClicked(), KDDockWidgets::Core::TitleBar::onDoubleClicked(), KDDockWidgets::Core::Stack::onMouseDoubleClick(), KDDockWidgets::Core::TabBar::onMousePress(), KDDockWidgets::QtWidgets::FloatingWindow::paintEvent(), KDDockWidgets::QtWidgets::Separator::paintEvent(), KDDockWidgets::LayoutSaver::restoreLayout(), KDDockWidgets::QtQuick::ViewFactory::self(), KDDockWidgets::Core::DockWidget::setFloating(), KDDockWidgets::QtQuick::Platform::setQmlEngine(), KDDockWidgets::QtWidgets::Stack::showContextMenu(), KDDockWidgets::Core::Platform::startDragDistance(), KDDockWidgets::Core::TitleBar::supportsFloatingButton(), KDDockWidgets::Core::TabBar::tabsAreMovable(), KDDockWidgets::Core::TitleBar::titleBarIsFocusable(), KDDockWidgets::QtWidgets::TitleBar::updateAutoHideButton(), KDDockWidgets::QtWidgets::TitleBar::updateMaximizeButton(), KDDockWidgets::Core::Group::updateTitleBarVisibility(), KDDockWidgets::QtQuick::Platform::viewFactory(), windowFlagsToUse(), and KDDockWidgets::windowManagerHasTranslucency().

◆ separatorThickness()

int KDDockWidgets::Config::separatorThickness ( ) const

Returns the thickness of the separator.

Default is 5px.

Definition at line 187 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__separatorThickness().

◆ setAbsoluteWidgetMaxSize()

void KDDockWidgets::Config::setAbsoluteWidgetMaxSize ( Size  size)

Sets the maximum size a dock widget can have. Widgets can still provide their own max-size and it will be respected, however it can never be bigger than this one.

Definition at line 296 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setAbsoluteWidgetMaxSize_Size(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setAbsoluteWidgetMaxSize().

◆ setAbsoluteWidgetMinSize()

void KDDockWidgets::Config::setAbsoluteWidgetMinSize ( Size  size)

Sets the minimum size a dock widget can have. Widgets can still provide their own min-size and it will be respected, however it can never be smaller than this one.

Definition at line 280 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setAbsoluteWidgetMinSize_Size(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setAbsoluteWidgetMinSize().

◆ setDisabledPaintEvents()

void KDDockWidgets::Config::setDisabledPaintEvents ( CustomizableWidgets  widgets)

Disables our internal widget's paint events By default, KDDockWidget's internal widgets reimplement paintEvent(). Disabling them (which makes the base-class, QWidget::paintEvent() be called instead) can be useful if you want to style.

Definition at line 376 of file Config.cpp.

◆ setDockWidgetFactoryFunc()

void KDDockWidgets::Config::setDockWidgetFactoryFunc ( DockWidgetFactoryFunc  func)

Registers a DockWidgetFactoryFunc.

This is optional, the default is nullptr.

A DockWidgetFactoryFunc is a function that receives a dock widget name and returns a DockWidget instance.

While restoring, LayoutSaver requires all dock widgets to exist. If a DockWidget doesn't exist then a DockWidgetFactoryFunc function is required, so the layout saver can ask to create the DockWidget and then restore it.

Definition at line 155 of file Config.cpp.

Referenced by lint().

◆ setDragAboutToStartFunc()

void KDDockWidgets::Config::setDragAboutToStartFunc ( DragAboutToStartFunc  func)

set a callback to be called once a drag starts

This function is for advanced usage only. Allows more granularity for inhibiting DnD.

Return true/false whether you allow the drag or not.

Parameters
draggableThe thing about to be dragged. Can be a tab, a group of tabs, a floating window or the tabbar's background.
See also
setDragEndedFunc

Definition at line 260 of file Config.cpp.

◆ setDragEndedFunc()

void KDDockWidgets::Config::setDragEndedFunc ( DragEndedFunc  func)

set a callback to be called once drag ends

See also
setAboutToStartDragFunc

Definition at line 270 of file Config.cpp.

◆ setDraggedWindowOpacity()

void KDDockWidgets::Config::setDraggedWindowOpacity ( double  opacity)

◆ setDropIndicatorAllowedFunc()

void KDDockWidgets::Config::setDropIndicatorAllowedFunc ( DropIndicatorAllowedFunc  func)

Allows the client app to disallow certain docking indicators.

For example, let's assume the app doesn't want to show outer indicators for a certain dock widget.

#include <kddockwidgets/Config.h>
(...)
auto func = [] (KDDockWidgets::DropLocation loc,
{
// disallows dockFoo to be docked to outer areas
return !((loc & KDDockWidgets::DropLocation_Outter) && source.contains(dockFoo));
};
void setDropIndicatorAllowedFunc(DropIndicatorAllowedFunc func)
Allows the client app to disallow certain docking indicators.
Definition Config.cpp:250
static Config & self()
returns the singleton Config instance
Definition Config.cpp:88
DropLocation
Enum describing the different drop indicator types.

Run "examples/qtwidgets_dockwidgets --hide-certain-docking-indicators" to see this in action.

Definition at line 250 of file Config.cpp.

◆ setDropIndicatorsInhibited()

void KDDockWidgets::Config::setDropIndicatorsInhibited ( bool  inhibit) const

Allows to disable support for drop indicators while dragging By default drop indicators will be shown when dragging dock widgets. This functionality can be toggled whenever you need it (it's not a startup-only setting).

Definition at line 396 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setDropIndicatorsInhibited_bool(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setDropIndicatorsInhibited().

◆ setFlags()

void KDDockWidgets::Config::setFlags ( Flags  flags)

setter for the flags

Parameters
flagsthe flags to set Not all flags are guaranteed to be set, as the OS might not supported them Call flags() after the setter if you need to know what was really set

Definition at line 117 of file Config.cpp.

◆ setInternalFlags()

void KDDockWidgets::Config::setInternalFlags ( InternalFlags  flags)

Definition at line 317 of file Config.cpp.

◆ setLayoutSaverStrictMode()

void KDDockWidgets::Config::setLayoutSaverStrictMode ( bool  is)

Mostly used by the linter so it errors out when finding invalid layouts. For production, this should be false, as sometimes there's fallbacks and the layout is recoverable. Default is false.

Definition at line 424 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setLayoutSaverStrictMode_bool(), main(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setLayoutSaverStrictMode().

◆ setLayoutSpacing()

void KDDockWidgets::Config::setLayoutSpacing ( int  value)

Setter for layoutSpacing(). Note: Only call this for the rare case of wanting the spacing to be different than the separator's thickness Use setSeparatorThickness() for the more common case. Note: Only use this function at startup before creating any DockWidget or MainWindow.

Definition at line 214 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setLayoutSpacing_int(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setLayoutSpacing().

◆ setMainWindowFactoryFunc()

void KDDockWidgets::Config::setMainWindowFactoryFunc ( MainWindowFactoryFunc  func)

counter-part of DockWidgetFactoryFunc but for the main window. Should be rarely used. It's good practice to have the main window before restoring a layout. It's here so we can use it in the linter executable

Definition at line 165 of file Config.cpp.

Referenced by lint().

◆ setMDIFlags()

void KDDockWidgets::Config::setMDIFlags ( MDIFlags  flags)

Setter for the MDI flags.

Definition at line 112 of file Config.cpp.

◆ setMDIPopupThreshold()

void KDDockWidgets::Config::setMDIPopupThreshold ( int  threshold)

Sets the MDI popup threshold. When the layout is MDI and you drag a dock widget X pixels behond the window's edge, it will float the dock widget. by default this value is 250px. Use -1 to disable.

Definition at line 386 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setMDIPopupThreshold_int(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setMDIPopupThreshold().

◆ setOnlyProgrammaticDrag()

void KDDockWidgets::Config::setOnlyProgrammaticDrag ( bool  only)

For disallowing DnD to be started by mouse and instead require doing programmatically Default is false, DnD can be started by mouse, which is the most common use case.

See also
Core::DockWidget::startDragging()

Definition at line 434 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setOnlyProgrammaticDrag_bool(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setOnlyProgrammaticDrag().

◆ setSeparatorThickness()

void KDDockWidgets::Config::setSeparatorThickness ( int  value)

setter for separatorThickness Note: Only use this function at startup before creating any DockWidget or MainWindow. Note: For backwards compatibility, setting separatorThickness will set layoutSpacing to the same value.

Definition at line 197 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setSeparatorThickness_int(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setSeparatorThickness().

◆ setStartDragDistance()

void KDDockWidgets::Config::setStartDragDistance ( int  pixels)

Sets how many pixels the mouse needs to travel before a drag is actually started Calling this is usually unneeded and just provided as a means to override Platform::startDragDistance() , which already has a reasonable default 4 pixels.

Definition at line 409 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setStartDragDistance_int(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setStartDragDistance().

◆ setTransparencyOnlyOverDropIndicator()

void KDDockWidgets::Config::setTransparencyOnlyOverDropIndicator ( bool  only)

Sets whether transparency is only set when the dragged window is over a drop indicator This is only relevant when using setDraggedWindowOpacity() Default is false.

Definition at line 235 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setTransparencyOnlyOverDropIndicator_bool(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setTransparencyOnlyOverDropIndicator().

◆ setViewFactory()

void KDDockWidgets::Config::setViewFactory ( Core::ViewFactory wf)

Sets the ViewFactory.

To draw things on screen, KDDW uses QtWidgets::{Group, TitleBar, TabBar, Separator, DockWidget, etc} (same for QtQuick::*) You can set your own factory and provide classes derived from the above list to override visual behaviour.

Ownership is taken.

Definition at line 175 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__setViewFactory_ViewFactory(), and KDDockWidgetsBindings_wrappersNS::Config_wrapper::setViewFactory().

◆ startDragDistance()

int KDDockWidgets::Config::startDragDistance ( ) const

Returns the value set by setStartDragDistance() Returns -1 if setStartDragDistance() wasn't call, in which case the Platform::startDragDistance() will be used.

Definition at line 414 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__startDragDistance(), and KDDockWidgets::Core::Platform::startDragDistance().

◆ transparencyOnlyOverDropIndicator()

bool KDDockWidgets::Config::transparencyOnlyOverDropIndicator ( ) const

Returns whether transparency is only set when the dragged window is over a drop indicator This is only relevant when using setDraggedWindowOpacity() Default is false.

Definition at line 245 of file Config.cpp.

Referenced by c_KDDockWidgets__Config__transparencyOnlyOverDropIndicator().

◆ viewFactory()

ViewFactory * KDDockWidgets::Config::viewFactory ( ) const

The documentation for this class was generated from the following files:

© 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