getting rid of deprecated calls
This commit is contained in:
parent
7044bced9e
commit
b2537351ad
@ -15,6 +15,8 @@
|
||||
#include <QTimer>
|
||||
#include <QtGlobal>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
||||
: QskControl( parent )
|
||||
, m_box( new QskLinearBox( Qt::Horizontal, this ) )
|
||||
@ -25,7 +27,7 @@ SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
||||
, m_fuelGauge( new Speedometer( m_box ) )
|
||||
, 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 );
|
||||
|
||||
@ -67,7 +69,7 @@ SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
||||
|
||||
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 );
|
||||
|
||||
auto fuelGaugeValue = 0.99997 * m_fuelGauge->value();
|
||||
|
@ -22,6 +22,8 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QPainter>
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#define HIDE_NODES 1
|
||||
|
||||
const int gridSize = 20;
|
||||
@ -53,13 +55,13 @@ static QColor randomColor()
|
||||
"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 ] );
|
||||
}
|
||||
|
||||
static int randomShape()
|
||||
{
|
||||
return qrand() % SkinnyShapeFactory::ShapeCount;
|
||||
return std::rand() % SkinnyShapeFactory::ShapeCount;
|
||||
}
|
||||
|
||||
class Thumbnail : public QskPushButton
|
||||
|
Loading…
x
Reference in New Issue
Block a user