Skip to content
Permalink
Browse files

fix bad QTime constructor

  • Loading branch information
vcloarec authored and nyalldawson committed Nov 3, 2020
1 parent 6d52771 commit 9a7efe029bb69e2bed15d0a0bafb42397577e8fb
@@ -5653,7 +5653,7 @@ QgsMeshLayer *QgisApp::addMeshLayerPrivate( const QString &url, const QString &b

QDateTime referenceTime = QgsProject::instance()->timeSettings()->temporalRange().begin();
if ( !referenceTime.isValid() ) // If project reference time is invalid, use current date
referenceTime = QDateTime( QDate::currentDate(), QTime( 0, 0, 0, Qt::UTC ), Qt::UTC );
referenceTime = QDateTime( QDate::currentDate(), QTime( 0, 0, 0 ), Qt::UTC );

if ( ! layer || ( !layer->isValid() && layer->subLayers().isEmpty() ) )
{
@@ -207,7 +207,7 @@ bool QgsMeshLayer::addDatasets( const QString &path, const QDateTime &defaultRef
{
QDateTime referenceTime = defaultReferenceTime;
if ( !defaultReferenceTime.isValid() ) // If project reference time is invalid, use current date
referenceTime = QDateTime( QDate::currentDate(), QTime( 0, 0, 0, Qt::UTC ), Qt::UTC );
referenceTime = QDateTime( QDate::currentDate(), QTime( 0, 0, 0 ), Qt::UTC );
temporalProperties->setReferenceTime( referenceTime, dataProvider()->temporalCapabilities() );
}

@@ -434,9 +434,9 @@ void QgsTemporalControllerWidget::onProjectCleared()
mNavigationObject->setNavigationMode( QgsTemporalNavigationObject::NavigationOff );
setWidgetStateFromNavigationMode( QgsTemporalNavigationObject::NavigationOff );

whileBlocking( mStartDateTime )->setDateTime( QDateTime( QDate::currentDate(), QTime( 0, 0, 0, Qt::UTC ) ) );
whileBlocking( mStartDateTime )->setDateTime( QDateTime( QDate::currentDate(), QTime( 0, 0, 0 ), Qt::UTC ) );
whileBlocking( mEndDateTime )->setDateTime( mStartDateTime->dateTime() );
whileBlocking( mFixedRangeStartDateTime )->setDateTime( QDateTime( QDate::currentDate(), QTime( 0, 0, 0, Qt::UTC ) ) );
whileBlocking( mFixedRangeStartDateTime )->setDateTime( QDateTime( QDate::currentDate(), QTime( 0, 0, 0 ), Qt::UTC ) );
whileBlocking( mFixedRangeEndDateTime )->setDateTime( mStartDateTime->dateTime() );
updateTemporalExtent();
mTimeStepsComboBox->setCurrentIndex( mTimeStepsComboBox->findData( QgsUnitTypes::TemporalHours ) );
@@ -127,7 +127,7 @@ void TestQgsLayout3DMap::testBasic()

QVERIFY( !map->isTemporal() );

QDateTime begin( QDate( 2020, 01, 01 ), QTime( 10, 0, 0, Qt::UTC ) );
QDateTime begin( QDate( 2020, 01, 01 ), QTime( 10, 0, 0 ), Qt::UTC );
QDateTime end = begin.addSecs( 3600 );
map3dItem->setTemporalRange( QgsDateTimeRange( begin, end ) );

@@ -624,7 +624,7 @@ void TestQgsMapToolIdentifyAction::identifyMesh()
tempLayer->dataProvider()->addDataset( vectorDs );
static_cast<QgsMeshLayerTemporalProperties *>(
tempLayer->temporalProperties() )->setReferenceTime(
QDateTime( QDate( 1950, 01, 01 ), QTime( 0, 0, 0, Qt::UTC ), Qt::UTC ), tempLayer->dataProvider()->temporalCapabilities() );
QDateTime( QDate( 1950, 01, 01 ), QTime( 0, 0, 0 ), Qt::UTC ), tempLayer->dataProvider()->temporalCapabilities() );

// we need to setup renderer otherwise triangular mesh
// will not be populated and identify will not work
@@ -658,8 +658,8 @@ void TestQgsMapToolIdentifyAction::identifyMesh()
QCOMPARE( results[1].mDerivedAttributes[QStringLiteral( "Snapped Vertex Position X" )], QStringLiteral( "2000" ) );
QCOMPARE( results[1].mDerivedAttributes[QStringLiteral( "Snapped Vertex Position Y" )], QStringLiteral( "3000" ) );

canvas->setTemporalRange( QgsDateTimeRange( QDateTime( QDate( 1950, 01, 01 ), QTime( 0, 0, 0, Qt::UTC ), Qt::UTC ),
QDateTime( QDate( 1950, 01, 01 ), QTime( 1, 0, 0, Qt::UTC ), Qt::UTC ) ) );
canvas->setTemporalRange( QgsDateTimeRange( QDateTime( QDate( 1950, 01, 01 ), QTime( 0, 0, 0 ), Qt::UTC ),
QDateTime( QDate( 1950, 01, 01 ), QTime( 1, 0, 0 ), Qt::UTC ) ) );

tempLayer->temporalProperties()->setIsActive( true );
results = testIdentifyMesh( tempLayer, 2400, 2400 );
@@ -1931,7 +1931,7 @@ void TestQgsLayoutMap::testTemporal()
{
QgsLayout l( QgsProject::instance( ) );
QgsLayoutItemMap *map = new QgsLayoutItemMap( &l );
QDateTime begin( QDate( 2020, 01, 01 ), QTime( 10, 0, 0, Qt::UTC ) );
QDateTime begin( QDate( 2020, 01, 01 ), QTime( 10, 0, 0 ), Qt::UTC );
QDateTime end = begin.addSecs( 3600 );

QgsMapSettings settings = map->mapSettings( map->extent(), QSize( 512, 512 ), 72, false );

0 comments on commit 9a7efe0

Please sign in to comment.
You can’t perform that action at this time.