QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
QgsWidgetStateHelper is a helper class to save and restore the geometry of QWidgets in the application. More...
#include <qgswidgetstatehelper_p.h>
Public Member Functions | |
QgsWidgetStateHelper (QObject *parent=nullptr) | |
QgsWidgetStateHelper. | |
bool | eventFilter (QObject *object, QEvent *event) override |
Event filter to catch events from registered widgets. | |
void | registerWidget (QWidget *widget, const QString &key=QString()) |
Register a widget to have it geometry state automatically saved and restored. | |
QgsWidgetStateHelper is a helper class to save and restore the geometry of QWidgets in the application.
This removes the need for devs to remember to call saveGeometry() and restoreGeometry() when writing new widgets.
This helper is internal and should only be called via QgsGui::enabledAutoGeometryRestore
Definition at line 31 of file qgswidgetstatehelper_p.h.
|
explicit |
parent | Parent object |
Definition at line 26 of file qgswidgetstatehelper_p.cpp.
|
override |
Event filter to catch events from registered widgets.
object | Object getting the event. |
event | Event sent from Qt. |
true
so that widget still gets event. Definition at line 31 of file qgswidgetstatehelper_p.cpp.
void QgsWidgetStateHelper::registerWidget | ( | QWidget * | widget, |
const QString & | key = QString() |
||
) |
Register a widget to have it geometry state automatically saved and restored.
widget | The widget to save. Must have objectName() set. |
key | The override settings key name to use if objectName() isn't to be used. objectName() is the default if not set. |
Definition at line 71 of file qgswidgetstatehelper_p.cpp.