summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2020-02-13 13:38:27 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2020-02-14 15:31:35 +0000
commit9af4b8694f82aa455ce844368c4f9c00b6f907b9 (patch)
treeae9bf3f57720075bbfb408d0a1846aa83f04709e
parent0ffc029d70f048d05fedcbf047acc84313304317 (diff)
downloadqt-creator-9af4b8694f82aa455ce844368c4f9c00b6f907b9.tar.gz
QmlDesigner: Remove duration from TimelineForm
The timeline has an end and start. There was an invisble spinbox for duration that I removed. Change-Id: I5ab8c888db650f97dbb3dac08b5b202fa681d291 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelineform.cpp6
-rw-r--r--src/plugins/qmldesigner/components/timelineeditor/timelineform.ui190
2 files changed, 79 insertions, 117 deletions
diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineform.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelineform.cpp
index eb63ad4883..db9e8a8ef6 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/timelineform.cpp
+++ b/src/plugins/qmldesigner/components/timelineeditor/timelineform.cpp
@@ -47,8 +47,6 @@ TimelineForm::TimelineForm(QWidget *parent)
{
ui->setupUi(this);
- ui->duration->setVisible(false);
-
connect(ui->expressionBindingLineEdit, &QLineEdit::editingFinished, [this]() {
QTC_ASSERT(m_timeline.isValid(), return );
@@ -135,13 +133,10 @@ void TimelineForm::setTimeline(const QmlTimeline &timeline)
if (m_timeline.isValid()) {
ui->idLineEdit->setText(m_timeline.modelNode().displayName());
- ui->duration->setValue(qRound(m_timeline.duration()));
ui->startFrame->setValue(
m_timeline.modelNode().variantProperty("startFrame").value().toInt());
ui->endFrame->setValue(m_timeline.modelNode().variantProperty("endFrame").value().toInt());
- ui->duration->setValue(qRound(m_timeline.duration()));
-
if (m_timeline.modelNode().hasBindingProperty("currentFrame")) {
ui->expressionBindingLineEdit->setText(
m_timeline.modelNode().bindingProperty("currentFrame").expression());
@@ -173,7 +168,6 @@ void TimelineForm::setProperty(const PropertyName &propertyName, const QVariant
} catch (const Exception &e) {
e.showException();
}
- ui->duration->setValue(qRound(m_timeline.duration()));
}
void TimelineForm::connectSpinBox(QSpinBox *spinBox, const PropertyName &propertyName)
diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelineform.ui b/src/plugins/qmldesigner/components/timelineeditor/timelineform.ui
index d962608b11..370a6f8154 100644
--- a/src/plugins/qmldesigner/components/timelineeditor/timelineform.ui
+++ b/src/plugins/qmldesigner/components/timelineeditor/timelineform.ui
@@ -11,11 +11,14 @@
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
- <item row="1" column="8" colspan="2">
- <spacer name="horizontalSpacer_11">
+ <item row="3" column="6" colspan="2">
+ <spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Expanding</enum>
+ </property>
<property name="sizeHint" stdset="0">
<size>
<width>49</width>
@@ -24,25 +27,36 @@
</property>
</spacer>
</item>
- <item row="2" column="5">
- <widget class="QSpinBox" name="endFrame">
- <property name="minimumSize">
- <size>
- <width>80</width>
- <height>0</height>
- </size>
+ <item row="1" column="6" colspan="2">
+ <spacer name="horizontalSpacer_11">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="maximumSize">
+ <property name="sizeHint" stdset="0">
<size>
- <width>80</width>
- <height>16777215</height>
+ <width>49</width>
+ <height>20</height>
</size>
</property>
- <property name="minimum">
- <number>-100000</number>
+ </spacer>
+ </item>
+ <item row="2" column="4">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>End frame:</string>
</property>
- <property name="maximum">
- <number>100000</number>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Start frame:</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
@@ -68,46 +82,42 @@
</property>
</widget>
</item>
- <item row="2" column="6">
- <widget class="QLabel" name="label_9">
- <property name="text">
- <string>Duration</string>
+ <item row="3" column="1" colspan="2">
+ <widget class="QRadioButton" name="expressionBinding">
+ <property name="enabled">
+ <bool>false</bool>
</property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ <property name="text">
+ <string>Expression binding</string>
</property>
</widget>
</item>
- <item row="4" column="0">
- <widget class="QLabel" name="label_8">
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_5">
<property name="text">
- <string>Expression binding:</string>
+ <string>Timeline ID:</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="2" column="8" colspan="2">
- <spacer name="horizontalSpacer_10">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="minimumSize">
<size>
- <width>49</width>
- <height>20</height>
+ <width>160</width>
+ <height>0</height>
</size>
</property>
- </spacer>
- </item>
- <item row="2" column="4">
- <widget class="QLabel" name="label_7">
- <property name="text">
- <string>End frame:</string>
+ <property name="font">
+ <font>
+ <weight>75</weight>
+ <bold>true</bold>
+ </font>
</property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ <property name="text">
+ <string>Timeline Settings</string>
</property>
</widget>
</item>
@@ -124,8 +134,8 @@
</property>
</widget>
</item>
- <item row="3" column="8" colspan="2">
- <spacer name="horizontalSpacer_12">
+ <item row="4" column="6" colspan="2">
+ <spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
@@ -140,37 +150,18 @@
</property>
</spacer>
</item>
- <item row="4" column="1" colspan="5">
- <widget class="QLineEdit" name="expressionBindingLineEdit">
- <property name="enabled">
- <bool>true</bool>
+ <item row="4" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>Expression binding:</string>
</property>
- <property name="minimumSize">
- <size>
- <width>240</width>
- <height>0</height>
- </size>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
- <item row="4" column="8" colspan="2">
- <spacer name="horizontalSpacer_9">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Expanding</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>49</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="7">
- <widget class="QSpinBox" name="duration">
+ <item row="2" column="5">
+ <widget class="QSpinBox" name="endFrame">
<property name="minimumSize">
<size>
<width>80</width>
@@ -183,21 +174,11 @@
<height>16777215</height>
</size>
</property>
- <property name="readOnly">
- <bool>true</bool>
+ <property name="minimum">
+ <number>-100000</number>
</property>
<property name="maximum">
- <number>200000</number>
- </property>
- </widget>
- </item>
- <item row="3" column="1" colspan="2">
- <widget class="QRadioButton" name="expressionBinding">
- <property name="enabled">
- <bool>false</bool>
- </property>
- <property name="text">
- <string>Expression binding</string>
+ <number>100000</number>
</property>
</widget>
</item>
@@ -208,44 +189,31 @@
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="label_5">
- <property name="text">
- <string>Timeline ID:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ <item row="4" column="1" colspan="5">
+ <widget class="QLineEdit" name="expressionBindingLineEdit">
+ <property name="enabled">
+ <bool>true</bool>
</property>
- </widget>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="label">
<property name="minimumSize">
<size>
- <width>160</width>
+ <width>240</width>
<height>0</height>
</size>
</property>
- <property name="font">
- <font>
- <weight>75</weight>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>Timeline Settings</string>
- </property>
</widget>
</item>
- <item row="2" column="1">
- <widget class="QLabel" name="label_6">
- <property name="text">
- <string>Start frame:</string>
+ <item row="2" column="6" colspan="2">
+ <spacer name="horizontalSpacer_10">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="alignment">
- <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>49</width>
+ <height>20</height>
+ </size>
</property>
- </widget>
+ </spacer>
</item>
</layout>
</widget>