KDDockWidgets API Documentation 1.7
|
Singleton to allow to choose certain behaviours of the framework. More...
#include <Config.h>
Public Member Functions | |
~Config () | |
destructor, called at shutdown | |
QSize | absoluteWidgetMaxSize () const |
QSize | absoluteWidgetMinSize () const |
Config::CustomizableWidgets | disabledPaintEvents () const |
DockWidgetFactoryFunc | dockWidgetFactoryFunc () const |
Returns the DockWidgetFactoryFunc. nullptr by default. | |
qreal | 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 | |
FrameworkWidgetFactory * | frameworkWidgetFactory () const |
getter for the framework widget factory | |
InternalFlags | internalFlags () const |
MainWindowFactoryFunc | mainWindowFactoryFunc () const |
Returns the MainWindowFactoryFunc. nullptr by default. | |
int | mdiPopupThreshold () const |
void | printDebug () |
Prints some debug information. | |
int | separatorThickness () const |
Returns the thickness of the separator. | |
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. | |
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. | |
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 | setDraggedWindowOpacity (qreal 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 | setFrameworkWidgetFactory (FrameworkWidgetFactory *) |
Sets the WidgetFactory. | |
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 | |
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 | setSeparatorThickness (int value) |
setter for separatorThickness Note: Only use this function at startup before creating any DockWidget or MainWindow. | |
void | setTabbingAllowedFunc (TabbingAllowedFunc func) |
Allows the user to intercept a docking attempt to center (tabbed) and disallow it. | |
TabbingAllowedFunc | tabbingAllowedFunc () const |
Used internally by the framework. Returns the function which was passed to setTabbingAllowedFunc() By default it's nullptr. | |
Static Public Member Functions | |
static Config & | self () |
returns the singleton Config instance | |
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 90 of file Config.cpp.
QSize KDDockWidgets::Config::absoluteWidgetMaxSize | ( | ) | const |
Definition at line 220 of file Config.cpp.
QSize KDDockWidgets::Config::absoluteWidgetMinSize | ( | ) | const |
Definition at line 205 of file Config.cpp.
Config::CustomizableWidgets KDDockWidgets::Config::disabledPaintEvents | ( | ) | const |
Definition at line 331 of file Config.cpp.
DockWidgetFactoryFunc KDDockWidgets::Config::dockWidgetFactoryFunc | ( | ) | const |
Returns the DockWidgetFactoryFunc. nullptr by default.
Definition at line 123 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 170 of file Config.cpp.
DropIndicatorAllowedFunc KDDockWidgets::Config::dropIndicatorAllowedFunc | ( | ) | const |
Used internally by the framework. Returns the function which was passed to setDropIndicatorAllowedFunc() By default it's nullptr.
Definition at line 190 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 354 of file Config.cpp.
Config::Flags KDDockWidgets::Config::flags | ( | ) | const |
returns the chosen flags
Definition at line 95 of file Config.cpp.
Referenced by setInternalFlags().
FrameworkWidgetFactory * KDDockWidgets::Config::frameworkWidgetFactory | ( | ) | const |
getter for the framework widget factory
Definition at line 145 of file Config.cpp.
Referenced by KDDockWidgets::MainWindowBase::overlayOnSideBar(), and KDDockWidgets::LayoutSaver::restoreLayout().
Config::InternalFlags KDDockWidgets::Config::internalFlags | ( | ) | const |
Definition at line 225 of file Config.cpp.
MainWindowFactoryFunc KDDockWidgets::Config::mainWindowFactoryFunc | ( | ) | const |
Returns the MainWindowFactoryFunc. nullptr by default.
Definition at line 133 of file Config.cpp.
Referenced by KDDockWidgets::LayoutSaver::restoreLayout().
int KDDockWidgets::Config::mdiPopupThreshold | ( | ) | const |
Definition at line 341 of file Config.cpp.
void KDDockWidgets::Config::printDebug | ( | ) |
Prints some debug information.
Definition at line 359 of file Config.cpp.
|
static |
returns the singleton Config instance
Definition at line 84 of file Config.cpp.
Referenced by KDDockWidgets::RubberBandQuick::RubberBandQuick(), KDDockWidgets::actualOptions(), actualParent(), flagsForFloatingWindow(), 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 150 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 210 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 195 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 326 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 118 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 165 of file Config.cpp.
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.
Run "kddockwidgets_example --hide-certain-docking-indicators" to see this in action.
Definition at line 185 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 346 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 100 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 138 of file Config.cpp.
void KDDockWidgets::Config::setInternalFlags | ( | InternalFlags | flags | ) |
Definition at line 230 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 128 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 336 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 155 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:
Definition at line 175 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 180 of file Config.cpp.