KDDockWidgets API Documentation
1.3
|
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 | |
Flags | flags () const |
returns the chosen flags | |
FrameworkWidgetFactory * | frameworkWidgetFactory () const |
getter for the framework widget factory | |
InternalFlags | internalFlags () const |
returns the internal flags. More... | |
MainWindowFactoryFunc | mainWindowFactoryFunc () const |
Returns the MainWindowFactoryFunc. nullptr by default. | |
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. | |
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. More... | |
void | setDraggedWindowOpacity (qreal opacity) |
sets the dragged window opacity 1.0 is fully opaque while 0.0 is fully transparent | |
void | setFlags (Flags flags) |
setter for the flags More... | |
void | setFrameworkWidgetFactory (FrameworkWidgetFactory *) |
Sets the WidgetFactory. More... | |
void | setInternalFlags (InternalFlags flags) |
setter for the internal flags More... | |
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 | 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. 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 | |
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.
Internal flags for addtional tunning.
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. |
Config::InternalFlags KDDockWidgets::Config::internalFlags | ( | ) | const |
returns the internal flags.
int KDDockWidgets::Config::separatorThickness | ( | ) | const |
Returns the thickness of the separator.
Default is 5px.
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.
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 |
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.
void KDDockWidgets::Config::setInternalFlags | ( | InternalFlags | flags | ) |
setter for the internal flags
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);
TabbingAllowedFunc KDDockWidgets::Config::tabbingAllowedFunc | ( | ) | const |
Used internally by the framework. Returns the function which was passed to setTabbingAllowedFunc() By default it's nullptr.