QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
Base class for any widget that can be shown as a inline panel. More...
#include <qgspanelwidget.h>
Public Slots | |
void | acceptPanel () |
Accept the panel. | |
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. | |
Signals | |
void | panelAccepted (QgsPanelWidget *panel) |
Emitted when the panel is accepted by the user. | |
void | showPanel (QgsPanelWidget *panel) |
Emit when you require a panel to be show in the interface. | |
void | widgetChanged () |
Emitted when the widget state changes. | |
Public Member Functions | |
QgsPanelWidget (QWidget *parent=nullptr) | |
Base class for any widget that can be shown as a inline panel. | |
virtual bool | applySizeConstraintsToStack () const |
Returns true if the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in. | |
bool | autoDelete () |
The the auto delete property on the widget. | |
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. | |
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. | |
bool | dockMode () |
Returns the dock mode state. | |
virtual QMenu * | menuButtonMenu () |
Returns the menu to use for the menu button for this panel, or nullptr if no menu button is required. | |
virtual QString | menuButtonTooltip () const |
Returns the (translated) tooltip text to use for the menu button for this panel. | |
QString | panelTitle () |
The title of the panel. | |
void | setAutoDelete (bool autoDelete) |
The the auto delete property on the widget. | |
virtual void | setDockMode (bool dockMode) |
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs. | |
void | setPanelTitle (const QString &panelTitle) |
Set the title of the panel when shown in the interface. | |
Static Public Member Functions | |
static QgsPanelWidget * | findParentPanel (QWidget *widget) |
Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget. | |
Protected Member Functions | |
void | keyPressEvent (QKeyEvent *event) override |
Overridden key press event to handle the esc event on the widget. | |
Base class for any widget that can be shown as a inline panel.
Definition at line 29 of file qgspanelwidget.h.
QgsPanelWidget::QgsPanelWidget | ( | QWidget * | parent = nullptr | ) |
Base class for any widget that can be shown as a inline panel.
parent | Parent widget. |
Definition at line 25 of file qgspanelwidget.cpp.
|
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 113 of file qgspanelwidget.cpp.
|
virtual |
Returns true
if the size constraints and hints for the panel widget should be applied to the parent QgsPanelWidgetStack which this panel is shown in.
The default behavior is to return false
.
Reimplemented in QgsTemporalControllerWidget.
Definition at line 50 of file qgspanelwidget.cpp.
|
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.
Definition at line 108 of file qgspanelwidget.h.
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.
panel | The panel to connect. |
Definition at line 39 of file qgspanelwidget.cpp.
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.
panels | A list of panel widgets to connect. |
Definition at line 30 of file qgspanelwidget.cpp.
|
inline |
Returns the dock mode state.
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 92 of file qgspanelwidget.h.
|
static |
Traces through the parents of a widget to find if it is contained within a QgsPanelWidget widget.
widget | widget which may be contained within a panel widget |
nullptr
Definition at line 55 of file qgspanelwidget.cpp.
|
overrideprotected |
Overridden key press event to handle the esc event on the widget.
event | The key event |
Definition at line 118 of file qgspanelwidget.cpp.
|
virtual |
Returns the menu to use for the menu button for this panel, or nullptr
if no menu button is required.
Reimplemented in QgsLabelEngineConfigWidget.
Definition at line 80 of file qgspanelwidget.cpp.
|
virtual |
Returns the (translated) tooltip text to use for the menu button for this panel.
This is only used when the panel returns a menuButtonMenu().
Reimplemented in QgsLabelEngineConfigWidget.
Definition at line 75 of file qgspanelwidget.cpp.
|
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.
panel | The panel widget to open. |
Definition at line 85 of file qgspanelwidget.cpp.
|
signal |
Emitted when the panel is accepted by the user.
panel | The panel widget that was accepted. |
|
inline |
The title of the panel.
Definition at line 49 of file qgspanelwidget.h.
|
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.
autoDelete | Enable or disable auto delete on the panel. |
Definition at line 100 of file qgspanelwidget.h.
|
virtual |
Set the widget in dock mode which tells the widget to emit panel widgets and not open dialogs.
dockMode | true to enable dock mode. |
Reimplemented in QgsPointCloudRendererPropertiesWidget, QgsTiledSceneRendererPropertiesWidget, QgsRuleBasedLabelingWidget, QgsLabelingRulePropsWidget, QgsMeshLabelingWidget, QgsPropertyAssistantWidget, QgsTextFormatPanelWidget, QgsRasterLabelingWidget, QgsInvertedPolygonRendererWidget, QgsLayerPropertiesWidget, QgsMergedFeatureRendererWidget, QgsRendererWidget, QgsRuleBasedRendererWidget, QgsSingleSymbolRendererWidget, and QgsDiagramProperties.
Definition at line 45 of file qgspanelwidget.cpp.
|
inline |
Set the title of the panel when shown in the interface.
panelTitle | The panel title. |
Definition at line 43 of file qgspanelwidget.h.
|
signal |
Emit when you require a panel to be show in the interface.
panel | The panel widget to show. |
|
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.