summaryrefslogtreecommitdiffstats
path: root/examples/activeqt/hierarchy/objects.h
diff options
context:
space:
mode:
authorAndre de la Rocha <andre.rocha@qt.io>2017-08-21 13:23:48 +0200
committerAndre de la Rocha <andre.rocha@qt.io>2017-08-23 11:01:43 +0000
commitc2751b1d664748cfbd05d2e397f95f2cc0bec13f (patch)
tree6a7a884caf28250927ee66f395e0634470ac0851 /examples/activeqt/hierarchy/objects.h
parentb3e88744f36144db7cda0b85c161cdb10026eb65 (diff)
Active Qt Examples: Brush up to C++ 11
Use nullptr, member initialization, new connect syntax, QStringLiteral, etc. Change-Id: Ia79473ca302216f91eec6a32f670cf606761ed0d Reviewed-by: Michael Winkelmann <michael.winkelmann@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/activeqt/hierarchy/objects.h')
-rw-r--r--examples/activeqt/hierarchy/objects.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/examples/activeqt/hierarchy/objects.h b/examples/activeqt/hierarchy/objects.h
index 4ceea1f..49b1535 100644
--- a/examples/activeqt/hierarchy/objects.h
+++ b/examples/activeqt/hierarchy/objects.h
@@ -56,17 +56,17 @@ class QParentWidget : public QWidget
Q_CLASSINFO("InterfaceID", "{4a30719d-d9c2-4659-9d16-67378209f822}");
Q_CLASSINFO("EventsID", "{4a30719d-d9c2-4659-9d16-67378209f823}");
public:
- QParentWidget(QWidget *parent = 0);
+ explicit QParentWidget(QWidget *parent = nullptr);
QSize sizeHint() const;
public slots:
- void createSubWidget( const QString &name );
+ void createSubWidget(const QString &name);
- QSubWidget *subWidget( const QString &name );
+ QSubWidget *subWidget(const QString &name);
private:
- QVBoxLayout *vbox;
+ QVBoxLayout *m_vbox;
};
//! [0]
@@ -74,25 +74,25 @@ private:
class QSubWidget : public QWidget
{
Q_OBJECT
- Q_PROPERTY( QString label READ label WRITE setLabel )
+ Q_PROPERTY(QString label READ label WRITE setLabel)
Q_CLASSINFO("ClassID", "{850652f4-8f71-4f69-b745-bce241ccdc30}");
Q_CLASSINFO("InterfaceID", "{2d76cc2f-3488-417a-83d6-debff88b3c3f}");
Q_CLASSINFO("ToSuperClass", "QSubWidget");
public:
- QSubWidget(QWidget *parent = 0, const QString &name = QString());
+ QSubWidget(QWidget *parent = nullptr, const QString &name = QString());
- void setLabel( const QString &text );
+ void setLabel(const QString &text);
QString label() const;
QSize sizeHint() const;
protected:
- void paintEvent( QPaintEvent *e );
+ void paintEvent(QPaintEvent *e);
private:
- QString lbl;
+ QString m_label;
};
//! [1]