mirror of
https://github.com/gamecreature/QtAwesome.git
synced 2024-11-15 13:35:44 +08:00
Merge pull request #39 from MartinDelille/fix-warnings
Fix warnings nullptr / floats
This commit is contained in:
commit
5283c11a12
@ -826,7 +826,7 @@ Q_OBJECT
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit QtAwesome(QObject *parent = 0);
|
explicit QtAwesome(QObject *parent = QTAWESOME_NULL);
|
||||||
virtual ~QtAwesome();
|
virtual ~QtAwesome();
|
||||||
|
|
||||||
void init( const QString& fontname );
|
void init( const QString& fontname );
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
QtAwesomeAnimation::QtAwesomeAnimation(QWidget *parentWidget, int interval, int step)
|
QtAwesomeAnimation::QtAwesomeAnimation(QWidget *parentWidget, int interval, int step)
|
||||||
: parentWidgetRef_( parentWidget )
|
: parentWidgetRef_( parentWidget )
|
||||||
, timer_( 0 )
|
, timer_( QTAWESOME_NULL )
|
||||||
, interval_( interval )
|
, interval_( interval )
|
||||||
, step_( step )
|
, step_( step )
|
||||||
, angle_( 0.0f )
|
, angle_( 0.0f )
|
||||||
@ -29,8 +29,8 @@ void QtAwesomeAnimation::setup( QPainter &painter, const QRect &rect)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//timer, angle, self.step = self.info[self.parent_widget]
|
//timer, angle, self.step = self.info[self.parent_widget]
|
||||||
float x_center = rect.width() * 0.5;
|
float x_center = rect.width() * 0.5f;
|
||||||
float y_center = rect.height() * 0.5;
|
float y_center = rect.height() * 0.5f;
|
||||||
painter.translate(x_center, y_center);
|
painter.translate(x_center, y_center);
|
||||||
painter.rotate(angle_);
|
painter.rotate(angle_);
|
||||||
painter.translate(-x_center, -y_center);
|
painter.translate(-x_center, -y_center);
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
#ifndef QTAWESOMEANIMATION_H
|
#ifndef QTAWESOMEANIMATION_H
|
||||||
#define QTAWESOMEANIMATION_H
|
#define QTAWESOMEANIMATION_H
|
||||||
|
|
||||||
|
#if __cplusplus <= 199711L
|
||||||
|
#define QTAWESOME_NULL NULL
|
||||||
|
#else
|
||||||
|
#define QTAWESOME_NULL nullptr
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
class QPainter;
|
class QPainter;
|
||||||
|
Loading…
Reference in New Issue
Block a user