getting rid of deprecated calls
This commit is contained in:
parent
7044bced9e
commit
b2537351ad
@ -15,6 +15,8 @@
|
|||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
||||||
: QskControl( parent )
|
: QskControl( parent )
|
||||||
, m_box( new QskLinearBox( Qt::Horizontal, this ) )
|
, m_box( new QskLinearBox( Qt::Horizontal, this ) )
|
||||||
@ -25,7 +27,7 @@ SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
|||||||
, m_fuelGauge( new Speedometer( m_box ) )
|
, m_fuelGauge( new Speedometer( m_box ) )
|
||||||
, m_fuelGaugeText( new QskTextLabel( QStringLiteral( "fuel" ), m_fuelGauge ) )
|
, m_fuelGaugeText( new QskTextLabel( QStringLiteral( "fuel" ), m_fuelGauge ) )
|
||||||
{
|
{
|
||||||
qsrand( static_cast< uint >( QTime::currentTime().msec() ) );
|
std::srand( static_cast< uint >( QTime::currentTime().msec() ) );
|
||||||
|
|
||||||
setPolishOnResize( true );
|
setPolishOnResize( true );
|
||||||
|
|
||||||
@ -67,7 +69,7 @@ SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
|||||||
|
|
||||||
connect( timer, &QTimer::timeout, this, [ this ]()
|
connect( timer, &QTimer::timeout, this, [ this ]()
|
||||||
{
|
{
|
||||||
auto speedometerValue = m_speedometer->value() + qrand() % 3 - 0.95;
|
auto speedometerValue = m_speedometer->value() + std::rand() % 3 - 0.95;
|
||||||
m_speedometer->setValue( speedometerValue );
|
m_speedometer->setValue( speedometerValue );
|
||||||
|
|
||||||
auto fuelGaugeValue = 0.99997 * m_fuelGauge->value();
|
auto fuelGaugeValue = 0.99997 * m_fuelGauge->value();
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
#define HIDE_NODES 1
|
#define HIDE_NODES 1
|
||||||
|
|
||||||
const int gridSize = 20;
|
const int gridSize = 20;
|
||||||
@ -53,13 +55,13 @@ static QColor randomColor()
|
|||||||
"DarkSlateGray"
|
"DarkSlateGray"
|
||||||
};
|
};
|
||||||
|
|
||||||
const int index = qrand() % int( ( sizeof( colors ) / sizeof( colors[ 0 ] ) ) );
|
const int index = std::rand() % int( ( sizeof( colors ) / sizeof( colors[ 0 ] ) ) );
|
||||||
return QColor( colors[ index ] );
|
return QColor( colors[ index ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int randomShape()
|
static int randomShape()
|
||||||
{
|
{
|
||||||
return qrand() % SkinnyShapeFactory::ShapeCount;
|
return std::rand() % SkinnyShapeFactory::ShapeCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Thumbnail : public QskPushButton
|
class Thumbnail : public QskPushButton
|
||||||
|
Loading…
x
Reference in New Issue
Block a user