summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/Application/ProjectFile.h
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2019-02-11 10:06:28 +0200
committerMahmoud Badri <mahmoud.badri@qt.io>2019-02-11 19:40:36 +0000
commit5884818826458539e9e959947051bd845d6acce4 (patch)
treee41e15fd8ad9ce59bc7ed5dd10c870f130fd7157 /src/Authoring/Studio/Application/ProjectFile.h
parent89390421091d40b4dd8f34c5419257b3418ab57f (diff)
Implement variants tags inspector work
Implemented features: - UI for the variants tags in the inspector. - adding, renaming, and deleting tags. - adding, renaming, and deleting tag groups. - adding, renaming tags/groups is checked for name uniqueness across project. - deleting tags/groups checked for in-use across the project. - toggling tags state. - tags are synced with the UIA/UIP. - changing group color. - the variants property in saved in the <Graph> part of the UIP. Remaining tasks: - implement import and export. - issue: renaming a selected tag, toggle it unselected till next project load. - issue: update the property after deleting a group that is in-use in the property in the currently open doc but not saved. - thorough test and tweaking. Task-no: QT3DS-2983 Change-Id: Iecbb6c854a00ec75864de5dd0f31f6ca3721c8ec Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Application/ProjectFile.h')
-rw-r--r--src/Authoring/Studio/Application/ProjectFile.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Authoring/Studio/Application/ProjectFile.h b/src/Authoring/Studio/Application/ProjectFile.h
index 3e47da28..390ccb4c 100644
--- a/src/Authoring/Studio/Application/ProjectFile.h
+++ b/src/Authoring/Studio/Application/ProjectFile.h
@@ -46,6 +46,12 @@ class ProjectFile : public QObject
public:
ProjectFile();
+ struct VariantGroup {
+ QString m_title;
+ QString m_color;
+ QStringList m_tags;
+ };
+
void create(const QString &uiaPath);
void ensureProjectFile();
void initProjectFile(const QString &presPath);
@@ -81,6 +87,19 @@ public:
void deletePresentationFile(const QString &filePath);
void renameMaterial(const QString &oldName, const QString &newName);
bool duplicatePresentation(const QString &oldPres, const QString &newPres);
+ void loadVariants();
+ void addVariantTag(const QString &group, const QString &newTag);
+ void renameVariantTag(const QString &group, const QString &oldTag, const QString &newTag);
+ void deleteVariantTag(const QString &group, const QString &tag);
+ void addVariantGroup(const QString &newGroup);
+ void renameVariantGroup(const QString &oldGroup, const QString &newGroup);
+ void deleteVariantGroup(const QString &group);
+ void changeVariantGroupColor(const QString &group, const QString &newColor);
+ bool isVariantGroupUnique(const QString &group) const;
+ bool isVariantTagUnique(const QString &group, const QString &tag) const;
+
+ QVector<VariantGroup> variantsDef() const { return m_variantsDef; }
+
Q_SIGNALS:
void presentationIdChanged(const QString &path, const QString &id);
@@ -88,9 +107,17 @@ Q_SIGNALS:
private:
QString ensureUniquePresentationId(const QString &id) const;
+ bool tagExistsInUip(const QString &src, const QString &group, const QString &tag) const;
+ bool groupExistsInUip(const QString &src, const QString &group) const;
+ void deleteTagFromUip(const QString &src, const QString &group, const QString &tag);
+ void deleteGroupFromUip(const QString &src, const QString &group);
+ void renameTagInUip(const QString &src, const QString &group, const QString &tag,
+ const QString &newName);
+ void renameGroupInUip(const QString &src, const QString &group, const QString &newName);
QFileInfo m_fileInfo; // uia file info
QString m_initialPresentation;
+ QVector<VariantGroup> m_variantsDef; // definition of variants
};
#endif // PROJECTFILE_H