QGIS API Documentation  2.99.0-Master (9fdd060)
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QgsPanelWidget Class Reference

Base class for any widget that can be shown as a inline panel. More...

#include <qgspanelwidget.h>

Inheritance diagram for QgsPanelWidget:
Inheritance graph
[legend]

Public Slots

void acceptPanel ()
 Accept the panel. More...
 
void openPanel (QgsPanelWidget *panel)
 Open a panel or dialog depending on dock mode setting If dock mode is true this method will emit the showPanel signal for connected slots to handle the open event. More...
 

Signals

void panelAccepted (QgsPanelWidget *panel)
 Emitted when the panel is accepted by the user. More...
 
void showPanel (QgsPanelWidget *panel)
 Emit when you require a panel to be show in the interface. More...
 
void widgetChanged ()
 Emitted when the widget state changes. More...
 

Public Member Functions

 QgsPanelWidget (QWidget *parent=0)
 Base class for any widget that can be shown as a inline panel. More...
 
bool autoDelete ()
 The the auto delete property on the widget. More...
 
void connectChildPanel (QgsPanelWidget *panel)
 Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user. More...
 
void connectChildPanels (const QList< QgsPanelWidget *> &panels)
 Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user. More...
 
bool dockMode ()
 Return the dock mode state. More...
 
QString panelTitle ()
 The title of the panel. More...
 
void setAutoDelete (bool autoDelete)
 The the auto delete property on the widget. More...
 
virtual void setDockMode (bool dockMode)
 Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs. More...
 
void setPanelTitle (const QString &panelTitle)
 Set the title of the panel when shown in the interface. More...
 

Static Public Member Functions

static QgsPanelWidgetfindParentPanel (QWidget *widget)
 Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget. More...
 

Protected Member Functions

void keyPressEvent (QKeyEvent *event)
 Overridden key press event to handle the esc event on the widget. More...
 

Detailed Description

Base class for any widget that can be shown as a inline panel.

Definition at line 27 of file qgspanelwidget.h.

Constructor & Destructor Documentation

◆ QgsPanelWidget()

QgsPanelWidget::QgsPanelWidget ( QWidget *  parent = 0)

Base class for any widget that can be shown as a inline panel.

Parameters
parentParent widget.

Definition at line 24 of file qgspanelwidget.cpp.

Member Function Documentation

◆ acceptPanel

void QgsPanelWidget::acceptPanel ( )
slot

Accept the panel.

Causes panelAccepted to be emitted. Widgets are normally removed form the interface using the panel manager or the caller.

Definition at line 96 of file qgspanelwidget.cpp.

◆ autoDelete()

bool QgsPanelWidget::autoDelete ( )
inline

The the auto delete property on the widget.

True by default. When auto delete is enabled when a panel is removed from the stack it will be deleted.

Returns
The auto delete value for the widget.

Definition at line 97 of file qgspanelwidget.h.

◆ connectChildPanel()

void QgsPanelWidget::connectChildPanel ( QgsPanelWidget panel)

Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.

Use this method if you have children widgets that need to show a panel to the user.

Parameters
panelThe panel to connect.

Definition at line 37 of file qgspanelwidget.cpp.

◆ connectChildPanels()

void QgsPanelWidget::connectChildPanels ( const QList< QgsPanelWidget *> &  panels)

Connect the given sub panel widgets showPanel signals to this current panels main showPanel event to bubble up to the user.

Use this method if you have children widgets that need to show a panel to the user.

Parameters
panelsA list of panel widgets to connect.

Definition at line 29 of file qgspanelwidget.cpp.

◆ dockMode()

bool QgsPanelWidget::dockMode ( )
inline

Return the dock mode state.

Returns
True if in dock mode. If in dock mode the widget will emit the showPanel signal to handle panel opening If false it will open dialogs when openPanel is called.

Definition at line 81 of file qgspanelwidget.h.

◆ findParentPanel()

QgsPanelWidget * QgsPanelWidget::findParentPanel ( QWidget *  widget)
static

Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget.

Parameters
widgetwidget which may be contained within a panel widget
Returns
parent panel widget if found, otherwise nullptr
Since
QGIS 3.0

Definition at line 48 of file qgspanelwidget.cpp.

◆ keyPressEvent()

void QgsPanelWidget::keyPressEvent ( QKeyEvent *  event)
protected

Overridden key press event to handle the esc event on the widget.

Parameters
eventThe key event

Definition at line 101 of file qgspanelwidget.cpp.

◆ openPanel

void QgsPanelWidget::openPanel ( QgsPanelWidget panel)
slot

Open a panel or dialog depending on dock mode setting If dock mode is true this method will emit the showPanel signal for connected slots to handle the open event.

If dock mode is false this method will open a dialog and block the user.

Parameters
panelThe panel widget to open.

Definition at line 68 of file qgspanelwidget.cpp.

◆ panelAccepted

void QgsPanelWidget::panelAccepted ( QgsPanelWidget panel)
signal

Emitted when the panel is accepted by the user.

Parameters
panelThe panel widget that was accepted.
Note
This argument is normally raised with emit panelAccepted(this) so that callers can retrieve the widget easier in calling code.
this is emitted only when this panel is accepted, and is not emitted for child panels. For example, if this panel opens a second stacked panel, then this panel will not emit panelAccepted when the second panel is accepted.

◆ panelTitle()

QString QgsPanelWidget::panelTitle ( )
inline

The title of the panel.

Returns
The title pf the panel.

Definition at line 48 of file qgspanelwidget.h.

◆ setAutoDelete()

void QgsPanelWidget::setAutoDelete ( bool  autoDelete)
inline

The the auto delete property on the widget.

True by default. When auto delete is enabled when a panel is removed from the stack it will be deleted.

Parameters
autoDeleteEnable or disable auto delete on the panel.

Definition at line 89 of file qgspanelwidget.h.

◆ setDockMode()

void QgsPanelWidget::setDockMode ( bool  dockMode)
virtual

Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.

Parameters
dockModeTrue to enable dock mode.

Reimplemented in QgsTextFormatPanelWidget, QgsPropertyAssistantWidget, QgsLayerPropertiesWidget, and QgsSingleSymbolRendererWidget.

Definition at line 43 of file qgspanelwidget.cpp.

◆ setPanelTitle()

void QgsPanelWidget::setPanelTitle ( const QString &  panelTitle)
inline

Set the title of the panel when shown in the interface.

Parameters
panelTitleThe panel title.

Definition at line 42 of file qgspanelwidget.h.

◆ showPanel

void QgsPanelWidget::showPanel ( QgsPanelWidget panel)
signal

Emit when you require a panel to be show in the interface.

Parameters
panelThe panel widget to show.
Note
If you are connected to this signal you should also connect given panels showPanel signal as they can be nested.

◆ widgetChanged

void QgsPanelWidget::widgetChanged ( )
signal

Emitted when the widget state changes.

Connect to this to pull any changes off the widget when needed. As panels are non blocking "dialogs" you should listen to this signal to give the user feedback when something changes.


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