diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-04-10 11:42:18 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-04-10 10:34:06 +0000 |
commit | 6d0c86d65b6fa0f37ba696de28fea4e977d0a282 (patch) | |
tree | 10a0c5eb676c27143db4b1ce36ad012d375534b2 /examples/designer/worldtimeclockplugin | |
parent | 1b04bf6d36af200dff0d7afff7080afab278034a (diff) |
Qt Designer Examples: Fix code around constructors.
Make constructors explicit, use constructor initialization for member
variables, remove unused variables.
Change-Id: I84273400d66ef061376bd0ec4948ab1a0fd45f30
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Diffstat (limited to 'examples/designer/worldtimeclockplugin')
4 files changed, 5 insertions, 5 deletions
diff --git a/examples/designer/worldtimeclockplugin/worldtimeclock.cpp b/examples/designer/worldtimeclockplugin/worldtimeclock.cpp index 1a4d8fcda..776eec786 100644 --- a/examples/designer/worldtimeclockplugin/worldtimeclock.cpp +++ b/examples/designer/worldtimeclockplugin/worldtimeclock.cpp @@ -46,11 +46,11 @@ WorldTimeClock::WorldTimeClock(QWidget *parent) : QWidget(parent) + , timeZoneOffset(0) + { typedef void (QWidget::*WidgetUpdateSlot)(); - timeZoneOffset = 0; - QTimer *timer = new QTimer(this); connect(timer, &QTimer::timeout, this, static_cast<WidgetUpdateSlot>(&QWidget::update)); timer->start(1000); diff --git a/examples/designer/worldtimeclockplugin/worldtimeclock.h b/examples/designer/worldtimeclockplugin/worldtimeclock.h index 497c51b4a..e0220a8dc 100644 --- a/examples/designer/worldtimeclockplugin/worldtimeclock.h +++ b/examples/designer/worldtimeclockplugin/worldtimeclock.h @@ -52,7 +52,7 @@ class QDESIGNER_WIDGET_EXPORT WorldTimeClock : public QWidget //! [0] public: - WorldTimeClock(QWidget *parent = 0); + explicit WorldTimeClock(QWidget *parent = 0); public slots: void setTimeZone(int hourOffset); diff --git a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.cpp b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.cpp index 6c879fdfb..416c8288e 100644 --- a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.cpp +++ b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.cpp @@ -45,8 +45,8 @@ WorldTimeClockPlugin::WorldTimeClockPlugin(QObject *parent) : QObject(parent) + , initialized(false) { - initialized = false; } void WorldTimeClockPlugin::initialize(QDesignerFormEditorInterface * /* core */) diff --git a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.h b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.h index a4bb24223..7ed81ba6f 100644 --- a/examples/designer/worldtimeclockplugin/worldtimeclockplugin.h +++ b/examples/designer/worldtimeclockplugin/worldtimeclockplugin.h @@ -54,7 +54,7 @@ class WorldTimeClockPlugin : public QObject, Q_INTERFACES(QDesignerCustomWidgetInterface) public: - WorldTimeClockPlugin(QObject *parent = 0); + explicit WorldTimeClockPlugin(QObject *parent = 0); bool isContainer() const Q_DECL_OVERRIDE; bool isInitialized() const Q_DECL_OVERRIDE; |