QGIS API Documentation  3.37.0-Master (a5b4d9743e8)
Public Member Functions | List of all members
QgsOptionsWidgetFactory Class Referenceabstract

A factory class for creating custom options pages. More...

#include <qgsoptionswidgetfactory.h>

Inheritance diagram for QgsOptionsWidgetFactory:
Inheritance graph
[legend]

Public Member Functions

 QgsOptionsWidgetFactory ()=default
 Constructor. More...
 
 QgsOptionsWidgetFactory (const QString &title, const QIcon &icon, const QString &key=QString())
 Constructor. More...
 
virtual QgsOptionsPageWidgetcreateWidget (QWidget *parent=nullptr) const =0
 Factory function to create the widget on demand as needed by the options dialog. More...
 
virtual QIcon icon () const
 The icon that will be shown in the UI for the panel. More...
 
virtual QString key () const
 The key of the panel (untranslated title). More...
 
virtual QString pagePositionHint () const
 Returns a tab name hinting at where this page should be inserted into the options properties tab list. More...
 
virtual QStringList path () const
 Returns the path to place the widget page at, for options dialogs which are structured using a tree view. More...
 
void setIcon (const QIcon &icon)
 Set the icon to show in the interface for the factory object. More...
 
void setKey (const QString &key)
 Set the key for the interface. More...
 
void setTitle (const QString &title)
 Set the title for the interface. More...
 
virtual QString title () const
 The title of the panel. More...
 

Detailed Description

A factory class for creating custom options pages.

Definition at line 110 of file qgsoptionswidgetfactory.h.

Constructor & Destructor Documentation

◆ QgsOptionsWidgetFactory() [1/2]

QgsOptionsWidgetFactory::QgsOptionsWidgetFactory ( )
default

Constructor.

◆ QgsOptionsWidgetFactory() [2/2]

QgsOptionsWidgetFactory::QgsOptionsWidgetFactory ( const QString &  title,
const QIcon &  icon,
const QString &  key = QString() 
)
inline

Constructor.

Definition at line 120 of file qgsoptionswidgetfactory.h.

Member Function Documentation

◆ createWidget()

virtual QgsOptionsPageWidget* QgsOptionsWidgetFactory::createWidget ( QWidget *  parent = nullptr) const
pure virtual

Factory function to create the widget on demand as needed by the options dialog.

Parameters
parentThe parent of the widget.
Returns
A new widget to show as a page in the options dialog.

◆ icon()

virtual QIcon QgsOptionsWidgetFactory::icon ( ) const
inlinevirtual

The icon that will be shown in the UI for the panel.

Returns
A QIcon for the panel icon.
See also
setIcon()

Definition at line 131 of file qgsoptionswidgetfactory.h.

◆ key()

virtual QString QgsOptionsWidgetFactory::key ( ) const
inlinevirtual

The key of the panel (untranslated title).

See also
setKey()
Since
QGIS 3.32

Definition at line 157 of file qgsoptionswidgetfactory.h.

◆ pagePositionHint()

virtual QString QgsOptionsWidgetFactory::pagePositionHint ( ) const
inlinevirtual

Returns a tab name hinting at where this page should be inserted into the options properties tab list.

If the returned string is non-empty, the options widget page will be inserted before the existing page with matching object name.

The default implementation returns an empty string, which causes the widget to be placed at the end of the dialog page list.

Since
QGIS 3.18

Definition at line 177 of file qgsoptionswidgetfactory.h.

◆ path()

virtual QStringList QgsOptionsWidgetFactory::path ( ) const
inlinevirtual

Returns the path to place the widget page at, for options dialogs which are structured using a tree view.

A factory which returns "Code", "Javascript" would have its widget placed in a group named "Javascript", contained in a parent group named "Code".

Since
QGIS 3.22

Definition at line 188 of file qgsoptionswidgetfactory.h.

◆ setIcon()

void QgsOptionsWidgetFactory::setIcon ( const QIcon &  icon)
inline

Set the icon to show in the interface for the factory object.

See also
icon()

Definition at line 137 of file qgsoptionswidgetfactory.h.

◆ setKey()

void QgsOptionsWidgetFactory::setKey ( const QString &  key)
inline

Set the key for the interface.

See also
key()

Definition at line 163 of file qgsoptionswidgetfactory.h.

◆ setTitle()

void QgsOptionsWidgetFactory::setTitle ( const QString &  title)
inline

Set the title for the interface.

See also
title()

Definition at line 149 of file qgsoptionswidgetfactory.h.

◆ title()

virtual QString QgsOptionsWidgetFactory::title ( ) const
inlinevirtual

The title of the panel.

See also
setTitle()

Definition at line 143 of file qgsoptionswidgetfactory.h.


The documentation for this class was generated from the following file: