| 32 | namespace { |
| 33 | |
| 34 | class WidgetGeometrySaver : public QObject |
| 35 | { |
| 36 | Q_OBJECT |
| 37 | public: |
| 38 | explicit WidgetGeometrySaver(QWidget& widget, const QString& configGroupName, const QString& configSubgroupName) |
| 39 | : QObject(&widget) |
| 40 | , m_configGroupName{configGroupName} |
| 41 | , m_configSubgroupName{configSubgroupName} |
| 42 | { |
| 43 | widget.installEventFilter(this); |
| 44 | } |
| 45 | |
| 46 | bool restoreWidgetGeometry() const |
| 47 | { |
| 48 | return widget().restoreGeometry(configGroup().readEntry(entryName(), QByteArray{})); |
| 49 | } |
| 50 | |
| 51 | bool eventFilter(QObject* watched, QEvent* event) override |
| 52 | { |
nothing calls this directly
no test coverage detected