summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/Palettes/Slide
diff options
context:
space:
mode:
authorJanne Kangas <janne.kangas@qt.io>2018-04-03 14:06:25 +0300
committerJanne Kangas <janne.kangas@qt.io>2018-04-05 05:28:33 +0000
commit83cccff54159dbaef93669deab59eff1030ff2f4 (patch)
tree3e38e7644d35ed095a49009722a6465719234288 /src/Authoring/Studio/Palettes/Slide
parent17722c2cfcadb954d6959d70845d715e9188e8c4 (diff)
Add '$' prefix to datainput names in UIP file
Differentiate between controller datainput and property with similar name by using a special character prefix for the controller. Disallow using special characters in datainput addition dialog. Update example to follow convention. Task-ID: QT3DS-1360 Change-Id: I40b8b5f36b24b96b14798eddb594f897ed9ef624 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes/Slide')
-rw-r--r--src/Authoring/Studio/Palettes/Slide/SlideView.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
index 4016b4d4..38aba9b1 100644
--- a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
+++ b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp
@@ -294,7 +294,7 @@ void SlideView::onDataInputChange(int handle, int instance, const QString &dataI
QString fullSlideControlStr;
if (dataInputName != m_dataInputSelector->getNoneString()) {
- fullSlideControlStr = dataInputName + " @slide";
+ fullSlideControlStr = "$" + dataInputName + " @slide";
m_controlled = true;
m_currentController = dataInputName;
m_toolTip = tr("Slide Controller:\n") + m_currentController;
@@ -327,9 +327,9 @@ void SlideView::onDataInputChange(int handle, int instance, const QString &dataI
if (existingCtrl.contains("@slide")) {
int slideStrPos = existingCtrl.indexOf("@slide");
// find the controlling datainput name and build the string to replace
- int ctrStrPos = existingCtrl.lastIndexOf(" ", slideStrPos - 2);
- QString prevCtrler = existingCtrl.mid(ctrStrPos + 1, slideStrPos - ctrStrPos - 1);
- existingCtrl.replace(prevCtrler + "@slide", fullSlideControlStr);
+ int ctrStrPos = existingCtrl.lastIndexOf("$", slideStrPos - 2);
+ QString prevCtrler = existingCtrl.mid(ctrStrPos, slideStrPos - ctrStrPos - 1);
+ existingCtrl.replace(prevCtrler + " @slide", fullSlideControlStr);
} else {
(!existingCtrl.isEmpty() && m_controlled) ? existingCtrl.append(" ") : 0;
existingCtrl.append(fullSlideControlStr);
@@ -377,7 +377,7 @@ void SlideView::updateDataInputStatus(bool isViaDispatch)
auto existingCtrl = qt3dsdm::get<QString>(controlledPropertyVal);
if (existingCtrl.contains("@slide")) {
int slideStrPos = existingCtrl.indexOf("@slide");
- int ctrStrPos = existingCtrl.lastIndexOf(" ", slideStrPos - 2);
+ int ctrStrPos = existingCtrl.lastIndexOf("$", slideStrPos - 2);
m_currentController = existingCtrl.mid(ctrStrPos + 1, slideStrPos - ctrStrPos - 2);
m_toolTip = tr("Slide Controller:\n") + m_currentController;
m_controlled = true;