KDDockWidgets API Documentation
1.0.1
|
Singleton to allow to choose certain behaviours of the framework. More...
#include <Config.h>
Public Types | |
enum | Flag { Flag_None = 0, Flag_NativeTitleBar = 1, Flag_AeroSnapWithClientDecos = 2, Flag_HideTitleBarWhenTabsVisible = 8, Flag_AlwaysShowTabs = 16, Flag_AllowReorderTabs = 32, Flag_TabsHaveCloseButton = 64, Flag_DoubleClickMaximizes = 128, Flag_TitleBarHasMaximizeButton = 256, Flag_LazyResize = 1024, Flag_Default = Flag_AeroSnapWithClientDecos } |
Flag enum to tune certain behaviours, the defaults are Flag_Default. More... | |
Public Member Functions | |
~Config () | |
destructor, called at shutdown | |
DockWidgetFactoryFunc | dockWidgetFactoryFunc () const |
Returns the DockWidgetFactoryFunc. nullptr by default. | |
Flags | flags () const |
returns the chosen flags | |
FrameworkWidgetFactory * | frameworkWidgetFactory () const |
getter for the framework widget factory | |
MainWindowFactoryFunc | mainWindowFactoryFunc () const |
Returns the MainWindowFactoryFunc. nullptr by default. | |
QQmlEngine * | qmlEngine () const |
int | separatorThickness () const |
Returns the thickness of the separator. More... | |
void | setDockWidgetFactoryFunc (DockWidgetFactoryFunc) |
Registers a DockWidgetFactoryFunc. More... | |
void | setFlags (Flags flags) |
setter for the flags More... | |
void | setFrameworkWidgetFactory (FrameworkWidgetFactory *) |
Sets the WidgetFactory. 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 | setQmlEngine (QQmlEngine *) |
Sets the QQmlEngine to use. Applicable only when using QtQuick. | |
void | setSeparatorThickness (int value) |
setter for separatorThickness Note: Only use this function at startup before creating any DockWidget or MainWindow. | |
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.
Flag enum to tune certain behaviours, the defaults are Flag_Default.
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.