diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-05-06 12:59:05 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@theqtcompany.com> | 2015-05-07 13:04:41 +0000 |
commit | 82c3e9edc2e9990027a65705c31bd618df455d91 (patch) | |
tree | 8648cb760baa0f62077e0986d14341b532a90a5f /tests/manual/qscreen/propertywatcher.h | |
parent | cd90182e6761f4becec01f4baea4e2cf70a9982e (diff) |
Manual QScreen test: capture screen changes.
- Make the subject of the Property watcher settable.
- Embed it into a QMainWindow with menu and
listen to the screen changed event, setting
the new screen with a message about the position.
- Remove hash, close obsolete windows by iterating
over the top levels looking for the screen.
Change-Id: I4ed1122bab7c0cd9676d63995ce85a44719f4ba6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'tests/manual/qscreen/propertywatcher.h')
-rw-r--r-- | tests/manual/qscreen/propertywatcher.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/manual/qscreen/propertywatcher.h b/tests/manual/qscreen/propertywatcher.h index 7dccfe3672..01e448845a 100644 --- a/tests/manual/qscreen/propertywatcher.h +++ b/tests/manual/qscreen/propertywatcher.h @@ -44,10 +44,12 @@ class PropertyWatcher : public QWidget Q_OBJECT public: - PropertyWatcher(QObject* subject, QString annotation = QString(), QWidget *parent = 0); - ~PropertyWatcher(); - QFormLayout *layout() { return m_layout; } - QObject* subject() { return m_subject; } + explicit PropertyWatcher(QObject* subject = Q_NULLPTR, QString annotation = QString(), QWidget *parent = Q_NULLPTR); + + QFormLayout *formLayout() { return m_formLayout; } + + QObject *subject() const { return m_subject; } + void setSubject(QObject *s, const QString &annotation = QString()); public slots: void updateAllFields(); @@ -56,9 +58,9 @@ public slots: signals: void updatedAllFields(PropertyWatcher* sender); -protected: +private: QObject* m_subject; - QFormLayout * m_layout; + QFormLayout * m_formLayout; }; #endif // PROPERTY_WATCHER_H |