From b2ad2e287b65c2ff5201775f313915c7149b669c Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 7 Dec 2021 11:41:00 +0100 Subject: [PATCH 1/2] Fix warnings --- QtAwesome/QtAwesome.h | 2 +- QtAwesome/QtAwesomeAnim.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/QtAwesome/QtAwesome.h b/QtAwesome/QtAwesome.h index 5aabd1b..2859113 100644 --- a/QtAwesome/QtAwesome.h +++ b/QtAwesome/QtAwesome.h @@ -826,7 +826,7 @@ Q_OBJECT public: - explicit QtAwesome(QObject *parent = 0); + explicit QtAwesome(QObject *parent = nullptr); virtual ~QtAwesome(); void init( const QString& fontname ); diff --git a/QtAwesome/QtAwesomeAnim.cpp b/QtAwesome/QtAwesomeAnim.cpp index 8ad44b6..6e4cf8d 100644 --- a/QtAwesome/QtAwesomeAnim.cpp +++ b/QtAwesome/QtAwesomeAnim.cpp @@ -9,7 +9,7 @@ QtAwesomeAnimation::QtAwesomeAnimation(QWidget *parentWidget, int interval, int step) : parentWidgetRef_( parentWidget ) - , timer_( 0 ) + , timer_( nullptr ) , interval_( interval ) , step_( step ) , angle_( 0.0f ) @@ -29,8 +29,8 @@ void QtAwesomeAnimation::setup( QPainter &painter, const QRect &rect) else { //timer, angle, self.step = self.info[self.parent_widget] - float x_center = rect.width() * 0.5; - float y_center = rect.height() * 0.5; + float x_center = rect.width() * 0.5f; + float y_center = rect.height() * 0.5f; painter.translate(x_center, y_center); painter.rotate(angle_); painter.translate(-x_center, -y_center); From 300d50945c0e50a62b9cd5e59531d1bb7c52ccbd Mon Sep 17 00:00:00 2001 From: Martin Delille Date: Tue, 7 Dec 2021 12:06:33 +0100 Subject: [PATCH 2/2] fixup! Fix warnings --- QtAwesome/QtAwesome.h | 2 +- QtAwesome/QtAwesomeAnim.cpp | 2 +- QtAwesome/QtAwesomeAnim.h | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/QtAwesome/QtAwesome.h b/QtAwesome/QtAwesome.h index 2859113..629eeec 100644 --- a/QtAwesome/QtAwesome.h +++ b/QtAwesome/QtAwesome.h @@ -826,7 +826,7 @@ Q_OBJECT public: - explicit QtAwesome(QObject *parent = nullptr); + explicit QtAwesome(QObject *parent = QTAWESOME_NULL); virtual ~QtAwesome(); void init( const QString& fontname ); diff --git a/QtAwesome/QtAwesomeAnim.cpp b/QtAwesome/QtAwesomeAnim.cpp index 6e4cf8d..eba707f 100644 --- a/QtAwesome/QtAwesomeAnim.cpp +++ b/QtAwesome/QtAwesomeAnim.cpp @@ -9,7 +9,7 @@ QtAwesomeAnimation::QtAwesomeAnimation(QWidget *parentWidget, int interval, int step) : parentWidgetRef_( parentWidget ) - , timer_( nullptr ) + , timer_( QTAWESOME_NULL ) , interval_( interval ) , step_( step ) , angle_( 0.0f ) diff --git a/QtAwesome/QtAwesomeAnim.h b/QtAwesome/QtAwesomeAnim.h index 5e3d11d..24a38e5 100644 --- a/QtAwesome/QtAwesomeAnim.h +++ b/QtAwesome/QtAwesomeAnim.h @@ -1,6 +1,12 @@ #ifndef QTAWESOMEANIMATION_H #define QTAWESOMEANIMATION_H +#if __cplusplus <= 199711L + #define QTAWESOME_NULL NULL +#else + #define QTAWESOME_NULL nullptr +#endif + #include class QPainter;