diff options
author | Janne Kangas <janne.kangas@qt.io> | 2018-04-25 14:27:19 +0300 |
---|---|---|
committer | Janne Kangas <janne.kangas@qt.io> | 2018-05-04 09:12:15 +0000 |
commit | 8a53e7004fc78a590bb55de30039b06231bfc33f (patch) | |
tree | a2e2302660d561ab8823972458bd98bbddcf7994 | |
parent | ed8d477a0ac7c3a19da20462c85ebffce1aeb36e (diff) |
Disable Evaluator Datainput
Disable evaluator from Studio UI. Also remove use of evaluator from
example.
Task-ID: QT3DS-1500
Change-Id: I9e8557d3a3aec3d0e2f3c64a8a2447220ac5fbed
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
9 files changed, 28 insertions, 30 deletions
diff --git a/examples/studio3d/qmldatainput/presentation/datainput.uia b/examples/studio3d/qmldatainput/presentation/datainput.uia index b6bb808d..d2522cde 100644 --- a/examples/studio3d/qmldatainput/presentation/datainput.uia +++ b/examples/studio3d/qmldatainput/presentation/datainput.uia @@ -9,7 +9,6 @@ <dataInput name="variantInput" type="Variant"/> <dataInput name="vec3Input2" type="Vector3"/> <dataInput name="vec3Input3" type="Vector3"/> - <dataInput name="evaluatorInput" type="Evaluator" evaluator="(function(rangeInput, evaluatorInput) { return Math.abs((rangeInput - evaluatorInput)) % 100 ; })"/> </assets> <statemachine ref="#logic"> <visual-states> diff --git a/examples/studio3d/qmldatainput/presentation/datainput.uip b/examples/studio3d/qmldatainput/presentation/datainput.uip index ec1089f2..56b4e5bf 100644 --- a/examples/studio3d/qmldatainput/presentation/datainput.uip +++ b/examples/studio3d/qmldatainput/presentation/datainput.uip @@ -14,13 +14,9 @@ <Model id="Cone" > <Material id="Default" name="Default" /> </Model> - <Model id="Cube" > - <Material id="Default_001" name="Default" /> - </Model> <Model id="Cylinder" > <Material id="Default_002" name="Default" /> </Model> - <Text id="Text5" /> <Text id="Text6" /> <Text id="Text8" /> <Model id="Cube2" > @@ -28,8 +24,6 @@ </Model> <Text id="Text3" /> <Text id="Text4" /> - <Text id="Text7" /> - <Text id="Text9" /> <Text id="Text10" /> <Text id="Text11" /> </Layer> @@ -49,19 +43,14 @@ <Add ref="#Text2" name="Text2" controlledproperty="" font="TitilliumWeb-Regular" position="259.808 217.95 0" scale="1 1 1" size="26" textstring="Text control Rotation animation control via datainput timeline control" /> <Add ref="#Cone" name="Cone" controlledproperty="$vec3Input scale" position="-417.135 -225.166 0" sourcepath="#Cone" /> <Add ref="#Default" /> - <Add ref="#Cube" name="Cube" controlledproperty="$evaluatorInput opacity" opacity="60" position="-147.224 -184.752 0" sourcepath="#Cube" /> - <Add ref="#Default_001" /> <Add ref="#Cylinder" name="Cylinder" controlledproperty="$variantInput opacity" position="131.347 -180.422 0" sourcepath="#Cylinder" /> <Add ref="#Default_002" /> - <Add ref="#Text5" name="Text5" font="TitilliumWeb-Regular" position="-158.772 -301.665 0" textstring="Opacity control (Evaluator type)" /> <Add ref="#Text6" name="Text6" font="TitilliumWeb-Regular" position="135.678 -300.019 -8.28656" textstring="Opacity control (Variant type)" /> <Add ref="#Text8" name="Text8" font="TitilliumWeb-Regular" position="-428.683 -290.118 0" textstring="Scale control" /> <Add ref="#Cube2" name="Cube2" controlledproperty="$vec3Input rotation" position="409.919 -177.535 0" sourcepath="#Cube" /> <Add ref="#Default_003" controlledproperty="$vec3Input2 diffuse" /> <Add ref="#Text3" name="Text3" font="TitilliumWeb-Regular" position="434.456 -304.552 0" textstring="Rotation control Diffuse color control" /> <Add ref="#Text4" name="Text4" font="TitilliumWeb-Regular" position="-381.051 290.118 0" textstring="Directional light color and Camera xy rotation controlled via Datainput" /> - <Add ref="#Text7" name="Text7" font="TitilliumWeb-Regular" position="-150.111 -69.2816 0" textstring="Opacity" /> - <Add ref="#Text9" name="Text9" controlledproperty="$evaluatorInput textstring" font="TitilliumWeb-Regular" position="-150.111 -106.809 0" /> <Add ref="#Text10" name="Text10" font="TitilliumWeb-Regular" position="138.564 -66.3953 0" textstring="Opacity" /> <Add ref="#Text11" name="Text11" controlledproperty="$variantInput textstring" font="TitilliumWeb-Regular" position="138.564 -103.923 0" /> </State> diff --git a/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml b/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml index 4812e644..5a29a808 100644 --- a/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml +++ b/examples/studio3d/qmldatainput/qml/qmldatainput/main.qml @@ -73,7 +73,6 @@ Item { property string inputString: "" property int inputFloat: 0.0 property variant inputVariant: 0 - property real inputEvaluator: 0.0 // A changing property to demonstrate DataInput NumberAnimation { target: studio3D @@ -138,15 +137,6 @@ Item { loops: Animation.Infinite running: true } - NumberAnimation { - target: studio3D - property: "inputEvaluator" - duration: 8000 - from: 10.0 - to: 50.0 - loops: Animation.Infinite - running: true - } // ViewerSettings item is used to specify presentation independent viewer settings. ViewerSettings { @@ -187,10 +177,6 @@ Item { name: "variantInput" value: studio3D.inputVariant } - DataInput { - name: "evaluatorInput" - value: studio3D.inputEvaluator - } } //![1] } diff --git a/src/Authoring/Client/Code/Core/Doc/Doc.cpp b/src/Authoring/Client/Code/Core/Doc/Doc.cpp index e9b841ad..b64ceea7 100644 --- a/src/Authoring/Client/Code/Core/Doc/Doc.cpp +++ b/src/Authoring/Client/Code/Core/Doc/Doc.cpp @@ -2829,12 +2829,15 @@ void CDoc::LoadUIADataInputs(const QString &uiaFile, item->type = EDataType::DataTypeVector2; } else if (!QString(type.c_str()).compare(QStringLiteral("Variant"))) { item->type = EDataType::DataTypeVariant; - } else if (!QString(type.c_str()) + } +#ifdef DATAINPUT_EVALUATOR_ENABLED + else if (!QString(type.c_str()) .compare(QStringLiteral("Evaluator"))) { item->type = EDataType::DataTypeEvaluator; if (theReader->Att("evaluator", evaluator)) item->valueString = evaluator.c_str(); } +#endif } datainputs.push_back(item); diff --git a/src/Authoring/Studio/Application/DataInputDlg.cpp b/src/Authoring/Studio/Application/DataInputDlg.cpp index 03febb71..d428d1a2 100644 --- a/src/Authoring/Studio/Application/DataInputDlg.cpp +++ b/src/Authoring/Studio/Application/DataInputDlg.cpp @@ -51,7 +51,9 @@ CDataInputDlg::CDataInputDlg(CDataInputDialogItem **datainput, QStandardItemMode m_ui->comboBoxTypeList->setItemDelegate(itemDelegate); m_ui->comboBoxTypeList->addItem(tr("Boolean")); +#ifdef DATAINPUT_EVALUATOR_ENABLED m_ui->comboBoxTypeList->addItem(tr("Evaluator")); +#endif m_ui->comboBoxTypeList->addItem(tr("Float")); m_ui->comboBoxTypeList->addItem(tr("Ranged Number")); m_ui->comboBoxTypeList->addItem(tr("String")); @@ -96,9 +98,11 @@ void CDataInputDlg::initDialog() m_min = m_dataInput->minValue; m_max = m_dataInput->maxValue; } +#ifdef DATAINPUT_EVALUATOR_ENABLED else if (m_type == DataTypeEvaluator) { m_ui->lineEditEvaluation->setText(m_dataInput->valueString); } +#endif } else { m_name = getUniqueId(tr("newDataInput")); m_ui->lineEditInputName->setText(m_name); @@ -115,9 +119,11 @@ void CDataInputDlg::on_buttonBox_accepted() m_dataInput->minValue = m_min; m_dataInput->maxValue = m_max; } +#ifdef DATAINPUT_EVALUATOR_ENABLED else if (m_type == DataTypeEvaluator) { m_dataInput->valueString = m_text; } +#endif QDialog::accept(); } @@ -183,15 +189,18 @@ void CDataInputDlg::updateVisibility(int type) m_ui->doubleSpinBoxMin->setVisible(false); m_ui->doubleSpinBoxMax->setVisible(false); } - +#ifdef DATAINPUT_EVALUATOR_ENABLED if (type == DataTypeEvaluator) { m_ui->lineEditEvaluation->setVisible(true); m_ui->labelEvaluation->setVisible(true); - } else { m_ui->lineEditEvaluation->setVisible(false); m_ui->labelEvaluation->setVisible(false); } +#else + m_ui->lineEditEvaluation->setVisible(false); + m_ui->labelEvaluation->setVisible(false); +#endif } const bool CDataInputDlg::isEquivalentDataType(int dlgType, @@ -214,7 +223,11 @@ const bool CDataInputDlg::isEquivalentDataType(int dlgType, // Variant can be bound to any property type. // Allow also Evaluator binding to any property as we only know the evaluation // result type at runtime. - || dlgType == EDataType::DataTypeVariant || dlgType == EDataType::DataTypeEvaluator) { + || dlgType == EDataType::DataTypeVariant +#ifdef DATAINPUT_EVALUATOR_ENABLED + || dlgType == EDataType::DataTypeEvaluator +#endif + ) { return true; } diff --git a/src/Authoring/Studio/Application/DataInputDlg.h b/src/Authoring/Studio/Application/DataInputDlg.h index 0af8e743..e38ee8b8 100644 --- a/src/Authoring/Studio/Application/DataInputDlg.h +++ b/src/Authoring/Studio/Application/DataInputDlg.h @@ -48,7 +48,9 @@ QT_FORWARD_DECLARE_CLASS(QStandardItemModel) enum EDataType { DataTypeBoolean = 0, +#ifdef DATAINPUT_EVALUATOR_ENABLED DataTypeEvaluator, +#endif DataTypeFloat, DataTypeRangedNumber, DataTypeString, diff --git a/src/Authoring/Studio/Application/DataInputListDlg.cpp b/src/Authoring/Studio/Application/DataInputListDlg.cpp index 8ef2a895..a80e8fce 100644 --- a/src/Authoring/Studio/Application/DataInputListDlg.cpp +++ b/src/Authoring/Studio/Application/DataInputListDlg.cpp @@ -164,9 +164,11 @@ void CDataInputListDlg::updateContents() dataInput.append(new QStandardItem(tr("String"))); } else if (dataInputType == DataTypeFloat) { dataInput.append(new QStandardItem(tr("Float"))); +#ifdef DATAINPUT_EVALUATOR_ENABLED } else if (dataInputType == DataTypeEvaluator) { dataInput.append(new QStandardItem(tr("Evaluator"))); dataInput.append(new QStandardItem(m_dataInputs.at(i)->valueString)); +#endif } else if (dataInputType == DataTypeBoolean) { dataInput.append(new QStandardItem(tr("Boolean"))); } else if (dataInputType == DataTypeVector3) { diff --git a/src/Authoring/Studio/Application/DataInputSelectView.cpp b/src/Authoring/Studio/Application/DataInputSelectView.cpp index 852bdbb2..468930af 100644 --- a/src/Authoring/Studio/Application/DataInputSelectView.cpp +++ b/src/Authoring/Studio/Application/DataInputSelectView.cpp @@ -85,9 +85,11 @@ QString DataInputSelectView::getDiTypeStr(int type) case EDataType::DataTypeBoolean: return tr("Boolean"); break; +#ifdef DATAINPUT_EVALUATOR_ENABLED case EDataType::DataTypeEvaluator: return tr("Evaluator"); break; +#endif case EDataType::DataTypeFloat: return tr("Float"); break; diff --git a/src/Authoring/Studio/_Win/Application/StudioApp.cpp b/src/Authoring/Studio/_Win/Application/StudioApp.cpp index 02a1413d..c5ece20d 100644 --- a/src/Authoring/Studio/_Win/Application/StudioApp.cpp +++ b/src/Authoring/Studio/_Win/Application/StudioApp.cpp @@ -1553,8 +1553,10 @@ void CStudioApp::SaveUIAFile(bool subpresentations) list.append(QStringLiteral("Vector3")); else if (item->type == EDataType::DataTypeVector2) list.append(QStringLiteral("Vector2")); +#ifdef DATAINPUT_EVALUATOR_ENABLED else if (item->type == EDataType::DataTypeEvaluator) list.append(QStringLiteral("Evaluator")); +#endif else if (item->type == EDataType::DataTypeVariant) list.append(QStringLiteral("Variant")); |