Skip to content
Permalink
Browse files

Revert "Explicitly state in temporal controller dock that the visible"

This reverts commit 11d0adb
and fixes it up to put the <= t < label in the correct place (it
refers to the frame time, not the overall animation extent)
  • Loading branch information
nyalldawson committed Mar 30, 2021
1 parent 0f54df6 commit a38be2c7fbb9e42aca4ef280720486b5455475b4
Showing with 20 additions and 12 deletions.
  1. +6 −6 src/gui/qgstemporalcontrollerwidget.cpp
  2. +14 −6 src/ui/qgstemporalcontrollerwidgetbase.ui
@@ -489,19 +489,19 @@ void QgsTemporalControllerWidget::updateSlider( const QgsDateTimeRange &range )

void QgsTemporalControllerWidget::updateRangeLabel( const QgsDateTimeRange &range )
{
QString timeFrameFormat = "yyyy-MM-dd HH:mm:ss";
QString timeFrameFormat = QStringLiteral( "yyyy-MM-dd HH:mm:ss" );
// but if timesteps are < 1 second (as: in milliseconds), add milliseconds to the format
if ( mTimeStepsComboBox->currentIndex() == mTimeStepsComboBox->findData( QgsUnitTypes::TemporalMilliseconds ) )
timeFrameFormat = "yyyy-MM-dd HH:mm:ss.zzz";
timeFrameFormat = QStringLiteral( "yyyy-MM-dd HH:mm:ss.zzz" );
switch ( mNavigationObject->navigationMode() )
{
case QgsTemporalNavigationObject::Animated:
mCurrentRangeLabel->setText( tr( "Frame: %1 to %2" ).arg(
mCurrentRangeLabel->setText( tr( "Frame: %1 ≤ <i>t</i> &lt; %2" ).arg(
range.begin().toString( timeFrameFormat ),
range.end().toString( timeFrameFormat ) ) );
break;
case QgsTemporalNavigationObject::FixedRange:
mCurrentRangeLabel->setText( tr( "Range: %1 to %2" ).arg(
mCurrentRangeLabel->setText( tr( "Range: %1 ≤ <i>t</i> &lt; %2" ).arg(
range.begin().toString( timeFrameFormat ),
range.end().toString( timeFrameFormat ) ) );
break;
@@ -627,10 +627,10 @@ void QgsTemporalControllerWidget::updateTimeStepInputs( const QgsInterval &timeS
if ( ! timeStep.isValid() || timeStep.seconds() <= 0.0001 )
return;

QString timeDisplayFormat = "yyyy-MM-dd HH:mm:ss";
QString timeDisplayFormat = QStringLiteral( "yyyy-MM-dd HH:mm:ss" );
if ( QgsUnitTypes::TemporalMilliseconds == timeStep.originalUnit() )
{
timeDisplayFormat = "yyyy-MM-dd HH:mm:ss.zzz";
timeDisplayFormat = QStringLiteral( "yyyy-MM-dd HH:mm:ss.zzz" );
// very big change that you have to update the range too, as defaulting to NOT handling millis
updateTemporalExtent();
}
@@ -2,6 +2,14 @@
<ui version="4.0">
<class>QgsTemporalControllerWidgetBase</class>
<widget class="QgsPanelWidget" name="QgsTemporalControllerWidgetBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>703</width>
<height>118</height>
</rect>
</property>
<property name="windowTitle">
<string>QgsDockWidget</string>
</property>
@@ -115,7 +123,7 @@
<item>
<widget class="QStackedWidget" name="mNavigationModeStackedWidget">
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="p1">
<layout class="QVBoxLayout" name="verticalLayoutP1">
@@ -179,7 +187,7 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -202,7 +210,7 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -439,7 +447,7 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -457,12 +465,12 @@
<item>
<widget class="QLabel" name="mRangeToLabel">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;t&lt;/span&gt; &amp;lt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>to</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>

0 comments on commit a38be2c

Please sign in to comment.