30 if ( event->type() == QEvent::Close ||
event->type() == QEvent::Destroy )
32 QWidget *widget = qobject_cast<QWidget *>( object );
33 QString name = widgetSafeName( widget );
34 QString key = mKeys[name];
37 else if ( event->type() == QEvent::Show )
39 QWidget *widget = qobject_cast<QWidget *>( object );
40 QString name = widgetSafeName( widget );
41 QString key = mKeys[name];
44 return QObject::eventFilter(
object, event );
49 QString name = widgetSafeName( widget );
51 widget->installEventFilter(
this );
54 QString QgsWidgetStateHelper::widgetSafeName( QWidget *widget )
56 if ( widget->objectName().isEmpty() )
58 return widget->metaObject()->className();
60 return widget->objectName();
void saveGeometry(QWidget *widget, const QString &keyName)
Save the wigget geometry into settings.
bool restoreGeometry(QWidget *widget, const QString &keyName)
Restore the wigget geometry from settings.