KDDockWidgets API Documentation
1.5
|
Singleton to allow to choose certain behaviours of the framework. More...
#include <Config.h>
Public Member Functions | |
~Config () | |
destructor, called at shutdown More... | |
QSize | absoluteWidgetMaxSize () const |
QSize | absoluteWidgetMinSize () const |
Config::CustomizableWidgets | disabledPaintEvents () const |
DockWidgetFactoryFunc | dockWidgetFactoryFunc () const |
Returns the DockWidgetFactoryFunc. nullptr by default. More... | |
qreal | draggedWindowOpacity () const |
returns the opacity to use when dragging dock widgets By default it's 1.0, fully opaque More... | |
bool | dropIndicatorsInhibited () const |
Returns whether drop indicators are inhibited. by default this is false unless you call setDropIndicatorsInhibited(true) More... | |
Flags | flags () const |
returns the chosen flags More... | |
FrameworkWidgetFactory * | frameworkWidgetFactory () const |
getter for the framework widget factory More... | |
InternalFlags | internalFlags () const |
MainWindowFactoryFunc | mainWindowFactoryFunc () const |
Returns the MainWindowFactoryFunc. nullptr by default. More... | |
int | mdiPopupThreshold () const |
int | separatorThickness () const |
Returns the thickness of the separator. More... | |
void | setAbsoluteWidgetMaxSize (QSize 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. More... | |
void | setAbsoluteWidgetMinSize (QSize 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. More... | |
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. More... | |
void | setDockWidgetFactoryFunc (DockWidgetFactoryFunc) |
Registers a DockWidgetFactoryFunc. More... | |
void | setDraggedWindowOpacity (qreal opacity) |
sets the dragged window opacity 1.0 is fully opaque while 0.0 is fully transparent More... | |
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). More... | |
void | setFlags (Flags flags) |
setter for the flags More... | |
void | setFrameworkWidgetFactory (FrameworkWidgetFactory *) |
Sets the WidgetFactory. More... | |
void | setInternalFlags (InternalFlags flags) |
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 More... | |
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. More... | |
void | setSeparatorThickness (int value) |
setter for separatorThickness Note: Only use this function at startup before creating any DockWidget or MainWindow. More... | |
void | setTabbingAllowedFunc (TabbingAllowedFunc func) |
Allows the user to intercept a docking attempt to center (tabbed) and disallow it. More... | |
TabbingAllowedFunc | tabbingAllowedFunc () const |
Used internally by the framework. Returns the function which was passed to setTabbingAllowedFunc() By default it's nullptr. More... | |
Static Public Member Functions | |
static Config & | self () |
returns the singleton Config instance More... | |
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.
List of customizable widgets.
Flag enum to tune certain behaviours, the defaults are Flag_Default.
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 |
KDDockWidgets::Config::~Config | ( | ) |
destructor, called at shutdown
Definition at line 88 of file Config.cpp.
QSize KDDockWidgets::Config::absoluteWidgetMaxSize | ( | ) | const |
Definition at line 208 of file Config.cpp.
QSize KDDockWidgets::Config::absoluteWidgetMinSize | ( | ) | const |
Definition at line 193 of file Config.cpp.
Config::CustomizableWidgets KDDockWidgets::Config::disabledPaintEvents | ( | ) | const |
Definition at line 319 of file Config.cpp.
DockWidgetFactoryFunc KDDockWidgets::Config::dockWidgetFactoryFunc | ( | ) | const |
Returns the DockWidgetFactoryFunc. nullptr by default.
Definition at line 121 of file Config.cpp.
qreal KDDockWidgets::Config::draggedWindowOpacity | ( | ) | const |
returns the opacity to use when dragging dock widgets By default it's 1.0, fully opaque
Definition at line 168 of file Config.cpp.
bool KDDockWidgets::Config::dropIndicatorsInhibited | ( | ) | const |
Returns whether drop indicators are inhibited. by default this is false unless you call setDropIndicatorsInhibited(true)
Definition at line 342 of file Config.cpp.
Config::Flags KDDockWidgets::Config::flags | ( | ) | const |
returns the chosen flags
Definition at line 93 of file Config.cpp.
Referenced by setInternalFlags().
FrameworkWidgetFactory * KDDockWidgets::Config::frameworkWidgetFactory | ( | ) | const |
getter for the framework widget factory
Definition at line 143 of file Config.cpp.
Referenced by KDDockWidgets::MainWindowBase::overlayOnSideBar(), and KDDockWidgets::LayoutSaver::restoreLayout().
Config::InternalFlags KDDockWidgets::Config::internalFlags | ( | ) | const |
Definition at line 213 of file Config.cpp.
MainWindowFactoryFunc KDDockWidgets::Config::mainWindowFactoryFunc | ( | ) | const |
Returns the MainWindowFactoryFunc. nullptr by default.
Definition at line 131 of file Config.cpp.
int KDDockWidgets::Config::mdiPopupThreshold | ( | ) | const |
Definition at line 329 of file Config.cpp.
|
static |
returns the singleton Config instance
Definition at line 82 of file Config.cpp.
Referenced by KDDockWidgets::RubberBandQuick::RubberBandQuick(), KDDockWidgets::actualOptions(), actualParent(), hackFindParentHarder(), lint(), KDDockWidgets::MainWindowBase::overlayOnSideBar(), Layouting::SeparatorWidget::paintEvent(), KDDockWidgets::LayoutSaver::restoreLayout(), KDDockWidgets::DockWidgetBase::setFloating(), and windowFlagsToUse().
int KDDockWidgets::Config::separatorThickness | ( | ) | const |
Returns the thickness of the separator.
Default is 5px.
Definition at line 148 of file Config.cpp.
References Layouting::Config::self(), and Layouting::Config::separatorThickness().
void KDDockWidgets::Config::setAbsoluteWidgetMaxSize | ( | QSize | 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 198 of file Config.cpp.
void KDDockWidgets::Config::setAbsoluteWidgetMinSize | ( | QSize | 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 183 of file Config.cpp.
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 314 of file Config.cpp.
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 116 of file Config.cpp.
Referenced by lint().
void KDDockWidgets::Config::setDraggedWindowOpacity | ( | qreal | opacity | ) |
sets the dragged window opacity 1.0 is fully opaque while 0.0 is fully transparent
Definition at line 163 of file Config.cpp.
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 334 of file Config.cpp.
void KDDockWidgets::Config::setFlags | ( | Flags | flags | ) |
setter for the flags
flags | the 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 98 of file Config.cpp.
References Flag_LazyResize, Layouting::Config::flags(), Layouting::Config::LazyResize, Layouting::Config::self(), and Layouting::Config::setFlags().
void KDDockWidgets::Config::setFrameworkWidgetFactory | ( | FrameworkWidgetFactory * | wf | ) |
Sets the WidgetFactory.
By default DefaultWidgetFactory is used, which gives you FrameWidget, TitleBarWidget, TabBarWidget, TabWidgetWidget etc. You can set your own factory, to supply your own variants of those classes, for the purposes of changing GUI appearance and such.
Also potentially useful to return QtQuick classes instead of the QtWidget based ones. Ownership is taken.
Definition at line 136 of file Config.cpp.
void KDDockWidgets::Config::setInternalFlags | ( | InternalFlags | flags | ) |
Definition at line 218 of file Config.cpp.
References flags().
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 126 of file Config.cpp.
Referenced by lint().
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 324 of file Config.cpp.
void KDDockWidgets::Config::setSeparatorThickness | ( | int | value | ) |
setter for separatorThickness Note: Only use this function at startup before creating any DockWidget or MainWindow.
Definition at line 153 of file Config.cpp.
References Layouting::Config::self(), and Layouting::Config::setSeparatorThickness().
void KDDockWidgets::Config::setTabbingAllowedFunc | ( | TabbingAllowedFunc | func | ) |
Allows the user to intercept a docking attempt to center (tabbed) and disallow it.
Whenever the user tries to tab two widgets together, the framework will call func
. If it returns true, then tabbing is allowed, otherwise not.
Example:
KDDockWidgets::Config::self()->setTabbingAllowedFunc(func);
Definition at line 173 of file Config.cpp.
TabbingAllowedFunc KDDockWidgets::Config::tabbingAllowedFunc | ( | ) | const |
Used internally by the framework. Returns the function which was passed to setTabbingAllowedFunc() By default it's nullptr.
Definition at line 178 of file Config.cpp.