KDDockWidgets API Documentation 2.1
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
KDDockWidgets::Core::ViewFactory Class Referenceabstract

A factory class for allowing the user to customize some internal views. This is optional, and if not provided, a default one will be used. More...

#include <ViewFactory.h>

Inheritance diagram for KDDockWidgets::Core::ViewFactory:
Inheritance graph
[legend]
Collaboration diagram for KDDockWidgets::Core::ViewFactory:
Collaboration graph
[legend]

Public Member Functions

 ViewFactory ()=default
 
virtual ~ViewFactory ()
 Destructor. Don't delete ViewFactory directly, it's owned by the framework.
 
virtual QString classicIndicatorsPath () const
 The path to a folder containing the classic_indicator png files.
 
virtual KDDockWidgets::Core::ActioncreateAction (Core::DockWidget *, const char *debugName) const =0
 Creates a QAction if QtWidgets, or an equivalent fallback if QtQuick/Flutter Not needed to be overridden by users.
 
virtual Core::ClassicIndicatorWindowViewInterfacecreateClassicIndicatorWindow (Core::ClassicDropIndicatorOverlay *, Core::View *parent=nullptr) const =0
 Creates the window that will show the actual drop indicators. They need a higher z-order, so this is actually a separate window, not parented to the main window.
 
virtual ViewcreateDockWidget (const QString &uniqueName, DockWidgetOptions options={}, LayoutSaverOptions layoutSaverOptions={}, Qt::WindowFlags windowFlags={}) const =0
 Creates a dock widget. This is only used by MainWindow's persistent widget feature. In all other cases users will instantiate DockWidget directly.
 
virtual ViewcreateDropArea (Core::DropArea *, View *parent) const =0
 Called by the framework to create a DropArea view.
 
virtual ViewcreateFloatingWindow (Core::FloatingWindow *controller, Core::MainWindow *parent=nullptr, Qt::WindowFlags windowFlags={}) const =0
 Called by the framework to create a FloatingWindow view Override to provide your own FloatingWindow sub-class.
 
virtual ViewcreateGroup (Core::Group *, View *parent=nullptr) const =0
 Called by the framework to create a Frame view Override to provide your own Frame sub-class. A group is the widget that holds the titlebar and tab-widget which holds the DockWidgets.
 
virtual ViewcreateMDILayout (Core::MDILayout *, View *parent) const =0
 Called by the framework to create a MDI Layout view.
 
virtual ViewcreateRubberBand (View *parent) const =0
 Called by the framework to create a RubberBand view to show as drop zone.
 
virtual ViewcreateSegmentedDropIndicatorOverlayView (Core::SegmentedDropIndicatorOverlay *controller, View *parent) const =0
 Creates the view that will parent the segmented drop indicators.
 
virtual ViewcreateSeparator (Core::Separator *, View *parent=nullptr) const =0
 Called by the framework to create a Separator view Override to provide your own Separator sub-class. The Separator allows the user to resize nested dock widgets.
 
virtual ViewcreateSideBar (Core::SideBar *, View *parent) const =0
 Called by the framework to create a SideBar view.
 
virtual ViewcreateStack (Core::Stack *stack, View *parent) const =0
 Called by the framework to create a Stack view Override to provide your own Stack sub-class.
 
virtual ViewcreateTabBar (Core::TabBar *tabBar, View *parent=nullptr) const =0
 Called by the framework to create a TabBar view Override to provide your own TabBar sub-class.
 
virtual ViewcreateTitleBar (Core::TitleBar *controller, View *parent) const =0
 Called by the framework to create a TitleBar view Override to provide your own TitleBar sub-class. Just forward the controller and parent arguments to the TitleBar view ctor.
 
virtual Icon iconForButtonType (TitleBarButtonType type, double dpr) const =0
 Returns the icon to be used with the specified type.
 

Static Public Attributes

static DropIndicatorType s_dropIndicatorType = DropIndicatorType::Classic
 @ The drop indicator type
 

Detailed Description

A factory class for allowing the user to customize some internal views. This is optional, and if not provided, a default one will be used.

You should however not derive directly from ViewFactory, and instead, derive from QtWidgets::ViewFactory or QtQuick::ViewFactory.

Sub-classing ViewFactory allows for fine-grained customization and styling of some non-public widgets, such as titlebars, dock widget group and tab widgets.

To set your own factory see Config::setViewFactory()

See also
Config::setViewFactory()

Definition at line 56 of file core/ViewFactory.h.

Constructor & Destructor Documentation

◆ ViewFactory()

KDDockWidgets::Core::ViewFactory::ViewFactory ( )
default

◆ ~ViewFactory()

ViewFactory::~ViewFactory ( )
virtual

Destructor. Don't delete ViewFactory directly, it's owned by the framework.

Reimplemented in KDDockWidgets::flutter::ViewFactory, KDDockWidgets::QtQuick::ViewFactory, and KDDockWidgets::QtWidgets::ViewFactory.

Definition at line 19 of file core/ViewFactory.cpp.

Member Function Documentation

◆ classicIndicatorsPath()

QString ViewFactory::classicIndicatorsPath ( ) const
virtual

The path to a folder containing the classic_indicator png files.

Definition at line 23 of file core/ViewFactory.cpp.

◆ createAction()

virtual KDDockWidgets::Core::Action * KDDockWidgets::Core::ViewFactory::createAction ( Core::DockWidget ,
const char *  debugName 
) const
pure virtual

Creates a QAction if QtWidgets, or an equivalent fallback if QtQuick/Flutter Not needed to be overridden by users.

Implemented in KDDockWidgets::flutter::ViewFactory, KDDockWidgets::QtQuick::ViewFactory, and KDDockWidgets::QtWidgets::ViewFactory.

◆ createClassicIndicatorWindow()

virtual Core::ClassicIndicatorWindowViewInterface * KDDockWidgets::Core::ViewFactory::createClassicIndicatorWindow ( Core::ClassicDropIndicatorOverlay ,
Core::View parent = nullptr 
) const
pure virtual

Creates the window that will show the actual drop indicators. They need a higher z-order, so this is actually a separate window, not parented to the main window.

Implemented in KDDockWidgets::QtWidgets::ViewFactory, KDDockWidgets::flutter::ViewFactory, KDDockWidgets::QtQuick::ViewFactory, KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::ViewFactory_wrapper, and KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::ViewFactory_wrapper.

Referenced by createIndicatorWindow().

◆ createDockWidget()

virtual View * KDDockWidgets::Core::ViewFactory::createDockWidget ( const QString uniqueName,
DockWidgetOptions  options = {},
LayoutSaverOptions  layoutSaverOptions = {},
Qt::WindowFlags  windowFlags = {} 
) const
pure virtual

Creates a dock widget. This is only used by MainWindow's persistent widget feature. In all other cases users will instantiate DockWidget directly.

Implemented in KDDockWidgets::QtQuick::ViewFactory, KDDockWidgets::flutter::ViewFactory, and KDDockWidgets::QtWidgets::ViewFactory.

Referenced by KDDockWidgets::QtWidgets::MDIArea::addDockWidget(), and lint().

◆ createDropArea()

virtual View * KDDockWidgets::Core::ViewFactory::createDropArea ( Core::DropArea ,
View parent 
) const
pure virtual

◆ createFloatingWindow()

virtual View * KDDockWidgets::Core::ViewFactory::createFloatingWindow ( Core::FloatingWindow controller,
Core::MainWindow parent = nullptr,
Qt::WindowFlags  windowFlags = {} 
) const
pure virtual

◆ createGroup()

virtual View * KDDockWidgets::Core::ViewFactory::createGroup ( Core::Group ,
View parent = nullptr 
) const
pure virtual

Called by the framework to create a Frame view Override to provide your own Frame sub-class. A group is the widget that holds the titlebar and tab-widget which holds the DockWidgets.

Parameters
parentjust forward to Frame's constructor

Implemented in KDDockWidgets::QtQuick::ViewFactory, KDDockWidgets::QtWidgets::ViewFactory, KDDockWidgets::flutter::ViewFactory, KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::ViewFactory_wrapper, and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::ViewFactory_wrapper.

◆ createMDILayout()

virtual View * KDDockWidgets::Core::ViewFactory::createMDILayout ( Core::MDILayout ,
View parent 
) const
pure virtual

◆ createRubberBand()

virtual View * KDDockWidgets::Core::ViewFactory::createRubberBand ( View parent) const
pure virtual

◆ createSegmentedDropIndicatorOverlayView()

virtual View * KDDockWidgets::Core::ViewFactory::createSegmentedDropIndicatorOverlayView ( Core::SegmentedDropIndicatorOverlay controller,
View parent 
) const
pure virtual

Creates the view that will parent the segmented drop indicators.

Implemented in KDDockWidgets::flutter::ViewFactory, KDDockWidgets::QtQuick::ViewFactory, and KDDockWidgets::QtWidgets::ViewFactory.

◆ createSeparator()

virtual View * KDDockWidgets::Core::ViewFactory::createSeparator ( Core::Separator ,
View parent = nullptr 
) const
pure virtual

Called by the framework to create a Separator view Override to provide your own Separator sub-class. The Separator allows the user to resize nested dock widgets.

Parameters
parentJust forward to Separator's constructor.

Implemented in KDDockWidgets::flutter::ViewFactory, KDDockWidgets::QtQuick::ViewFactory, KDDockWidgets::QtWidgets::ViewFactory, KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::ViewFactory_wrapper, and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::ViewFactory_wrapper.

◆ createSideBar()

virtual View * KDDockWidgets::Core::ViewFactory::createSideBar ( Core::SideBar ,
View parent 
) const
pure virtual

Called by the framework to create a SideBar view.

Parameters
locThe side-bar location without the main window. Just forward into your SideBar sub-class ctor.
parentThe MainWindow. Just forward into your SideBar sub-class ctor.

Implemented in KDDockWidgets::flutter::ViewFactory, KDDockWidgets::QtQuick::ViewFactory, KDDockWidgets::QtWidgets::ViewFactory, KDDockWidgetsBindings_wrappersNS::KDDWBindingsCore::ViewFactory_wrapper, and KDDockWidgetsBindings_wrappersNS::KDDWBindingsFlutter::ViewFactory_wrapper.

◆ createStack()

virtual View * KDDockWidgets::Core::ViewFactory::createStack ( Core::Stack stack,
View parent 
) const
pure virtual

◆ createTabBar()

virtual View * KDDockWidgets::Core::ViewFactory::createTabBar ( Core::TabBar tabBar,
View parent = nullptr 
) const
pure virtual

◆ createTitleBar()

virtual View * KDDockWidgets::Core::ViewFactory::createTitleBar ( Core::TitleBar controller,
View parent 
) const
pure virtual

◆ iconForButtonType()

virtual Icon KDDockWidgets::Core::ViewFactory::iconForButtonType ( TitleBarButtonType  type,
double  dpr 
) const
pure virtual

Returns the icon to be used with the specified type.

Parameters
dprthe device pixel ratio of the button

Implemented in KDDockWidgets::flutter::ViewFactory.

Member Data Documentation

◆ s_dropIndicatorType

DropIndicatorType ViewFactory::s_dropIndicatorType = DropIndicatorType::Classic
static

@ The drop indicator type

Definition at line 146 of file core/ViewFactory.h.

Referenced by KDDockWidgets::createDropIndicatorOverlay().


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