diff --git a/src/translations/Dyt_zh_CN.ts b/src/translations/Dyt_zh_CN.ts
index 1e032312..d2e2fcdb 100644
--- a/src/translations/Dyt_zh_CN.ts
+++ b/src/translations/Dyt_zh_CN.ts
@@ -853,12 +853,12 @@
-
+
ModelBase
-
+
color base
@@ -866,12 +866,25 @@
QFilePathEdit
-
+
Open File
-
+
+ All Files (*)
+
+
+
+
+ QModelFilePathEdit
+
+
+ Open File
+
+
+
+
All Files (*)
@@ -917,15 +930,15 @@
QtBoolEdit
-
-
-
+
+
+
True
-
-
+
+
False
@@ -933,12 +946,12 @@
QtBoolPropertyManager
-
+
True
-
+
False
@@ -946,7 +959,7 @@
QtCharEdit
-
+
Clear Char
@@ -954,7 +967,7 @@
QtColorEditWidget
-
+
...
...
@@ -962,22 +975,22 @@
QtColorPropertyManager
-
+
Red
-
+
Green
-
+
Blue
-
+
Alpha
@@ -985,43 +998,43 @@
QtConeWaveComponentManager
-
-
+
+
ConeWaveComponent
-
+
Height
-
+
Radius
-
+
levelCount
-
+
levelHeight
-
+
Color1
-
+
Color2
-
+
Color3
@@ -1029,97 +1042,97 @@
QtCursorDatabase
-
+
Arrow
-
+
Up Arrow
-
+
Cross
-
+
Wait
-
+
IBeam
-
+
Size Vertical
-
+
Size Horizontal
-
+
Size Backslash
-
+
Size Slash
-
+
Size All
-
+
Blank
-
+
Split Vertical
-
+
Split Horizontal
-
+
Pointing Hand
-
+
Forbidden
-
+
Open Hand
-
+
Closed Hand
-
+
What's This
-
+
Busy
@@ -1127,28 +1140,28 @@
QtDashedLineComponentManager
-
-
+
+
DashedLineComponent
-
+
Start
-
+
End
-
+
Radius
-
+
Color
@@ -1156,7 +1169,7 @@
QtEntityEditWidget
-
+
...
...
@@ -1164,12 +1177,12 @@
QtEntityPropertyManager
-
+
Name
名称
-
+
Transform
@@ -1177,12 +1190,12 @@
QtFontEditWidget
-
+
...
...
-
+
Select Font
@@ -1190,37 +1203,37 @@
QtFontPropertyManager
-
+
Family
-
+
Point Size
-
+
Bold
-
+
Italic
-
+
Underline
-
+
Strikeout
-
+
Kerning
@@ -1228,22 +1241,22 @@
QtLocalePropertyManager
-
+
<Invalid>
-
+
%1, %2
-
+
Language
-
+
Country
@@ -1251,13 +1264,13 @@
QtMeshComponetManager
-
-
+
+
MeshComponent
-
+
Mesh
@@ -1265,22 +1278,22 @@
QtModelBasePropertyManager
-
+
Name
名称
-
+
Description
-
+
Inflow
-
+
InnerBottomElevation
@@ -1301,13 +1314,13 @@
QtPathComponentManager
-
-
+
+
PathComponent
-
+
Path
路径
@@ -1315,17 +1328,17 @@
QtPointFPropertyManager
-
+
(%1, %2)
-
+
X
-
+
Y
@@ -1333,17 +1346,17 @@
QtPointPropertyManager
-
+
(%1, %2)
-
+
X
-
+
Y
@@ -1351,22 +1364,22 @@
QtPropertyBrowserUtils
-
+
[%1, %2, %3] (%4)
-
+
[%1, %2]
-
+
[%1, %2, %3]
-
+
[%1, %2, %3] [%4, %5, %6] [%7, %8, %9]
@@ -1374,27 +1387,27 @@
QtRectFPropertyManager
-
+
[(%1, %2), %3 x %4]
-
+
X
-
+
Y
-
+
Width
-
+
Height
@@ -1402,27 +1415,27 @@
QtRectPropertyManager
-
+
[(%1, %2), %3 x %4]
-
+
X
-
+
Y
-
+
Width
-
+
Height
@@ -1430,17 +1443,17 @@
QtSizeFPropertyManager
-
+
%1 x %2
-
+
Width
-
+
Height
@@ -1448,33 +1461,33 @@
QtSizePolicyPropertyManager
-
-
+
+
<Invalid>
-
+
[%1, %2, %3, %4]
-
+
Horizontal Policy
-
+
Vertical Policy
-
+
Horizontal Stretch
-
+
Vertical Stretch
@@ -1482,17 +1495,17 @@
QtSizePropertyManager
-
+
%1 x %2
-
+
Width
-
+
Height
@@ -1500,7 +1513,7 @@
QtTransfromEditWidget
-
+
...
...
@@ -1508,17 +1521,17 @@
QtTransfromPropertyManager
-
+
Location
-
+
Rotation
-
+
Scale
@@ -1539,17 +1552,17 @@
QtVec3PropertyManager
-
+
X
-
+
Y
-
+
Z
@@ -1557,17 +1570,17 @@
QtWorkspacePropertyManager
-
+
Name
名称
-
+
Description
-
+
Timestep
diff --git a/src/ui/PropertyBrowser.cpp b/src/ui/PropertyBrowser.cpp
index 5aeb557c..bacf5490 100644
--- a/src/ui/PropertyBrowser.cpp
+++ b/src/ui/PropertyBrowser.cpp
@@ -161,10 +161,11 @@ void PropertyBrowser::InitComponentPropertyManager() {
QtLineEditFactory* lineEditFactory = new QtLineEditFactory(this);
QtColorEditorFactory* colorFactory = new QtColorEditorFactory(this);
QtFilePathFactory* filePathFactory = new QtFilePathFactory(this);
+ QtModelFilePathFactory* modelFileFactory = new QtModelFilePathFactory(this);
QtEntityUUIDEditorFactory* entityUUIDFactory = new QtEntityUUIDEditorFactory(this);
QtMeshComponetManager* meshComponentManager = new QtMeshComponetManager(this);
- browser_->setFactoryForManager(meshComponentManager->subStringProperyManager(), lineEditFactory);
+ browser_->setFactoryForManager(meshComponentManager->subModelFileProperyManager(), modelFileFactory);
componetManager_[meshComponentManager->GetPropertyId()] = meshComponentManager;
QtPathComponentManager* pathComponentManager = new QtPathComponentManager(this);
diff --git a/src/ui/PropertyBrowser/qteditorfactory.cpp b/src/ui/PropertyBrowser/qteditorfactory.cpp
index 27fd60d0..31b571a2 100644
--- a/src/ui/PropertyBrowser/qteditorfactory.cpp
+++ b/src/ui/PropertyBrowser/qteditorfactory.cpp
@@ -1171,6 +1171,115 @@ void QtFilePathFactory::disconnectPropertyManager(QtFilesPropertyManager* manage
#pragma endregion
+
+// QtModelFilePathFactory
+#pragma region QtModelFilePathFactory
+
+class QtModelFilePathFactoryPrivate : public EditorFactoryPrivate {
+ QtModelFilePathFactory* q_ptr;
+ Q_DECLARE_PUBLIC(QtModelFilePathFactory)
+public:
+
+ void slotPropertyChanged(QtProperty* property, const QString& value);
+ void slotSetValue(const QString& value);
+};
+
+void QtModelFilePathFactoryPrivate::slotPropertyChanged(QtProperty* property,
+ const QString& value) {
+ const auto it = m_createdEditors.constFind(property);
+ if (it == m_createdEditors.constEnd())
+ return;
+
+ for (QModelFilePathEdit* editor : it.value()) {
+ if (editor->filePath() != value)
+ editor->setFilePath(value);
+ }
+}
+
+void QtModelFilePathFactoryPrivate::slotSetValue(const QString& value) {
+ QObject* object = q_ptr->sender();
+ const QMap::ConstIterator ecend = m_editorToProperty.constEnd();
+ for (QMap::ConstIterator itEditor = m_editorToProperty.constBegin(); itEditor != ecend; ++itEditor)
+ if (itEditor.key() == object) {
+ QtProperty* property = itEditor.value();
+ QtModelFilesPropertyManager* manager = q_ptr->propertyManager(property);
+ if (!manager)
+ return;
+ manager->setValue(property, value);
+ return;
+ }
+}
+
+/*!
+ \class QtLineEditFactory
+ \internal
+ \inmodule QtDesigner
+ \since 4.4
+
+ \brief The QtLineEditFactory class provides QLineEdit widgets for
+ properties created by QtStringPropertyManager objects.
+
+ \sa QtAbstractEditorFactory, QtStringPropertyManager
+*/
+
+/*!
+ Creates a factory with the given \a parent.
+*/
+QtModelFilePathFactory::QtModelFilePathFactory(QObject* parent)
+ : QtAbstractEditorFactory(parent), d_ptr(new QtModelFilePathFactoryPrivate()) {
+ d_ptr->q_ptr = this;
+
+}
+
+/*!
+ Destroys this factory, and all the widgets it has created.
+*/
+QtModelFilePathFactory::~QtModelFilePathFactory() {
+ qDeleteAll(d_ptr->m_editorToProperty.keys());
+}
+
+/*!
+ \internal
+
+ Reimplemented from the QtAbstractEditorFactory class.
+*/
+void QtModelFilePathFactory::connectPropertyManager(QtModelFilesPropertyManager* manager) {
+ connect(manager, SIGNAL(valueChanged(QtProperty*, QString)),
+ this, SLOT(slotPropertyChanged(QtProperty*, QString)));
+}
+
+/*!
+ \internal
+
+ Reimplemented from the QtAbstractEditorFactory class.
+*/
+QWidget* QtModelFilePathFactory::createEditor(QtModelFilesPropertyManager* manager,
+ QtProperty* property, QWidget* parent) {
+ QModelFilePathEdit* editor = d_ptr->createEditor(property, parent);
+ editor->setFilePath(manager->value(property));
+ editor->setInitialText(manager->initialValue(property));
+
+ connect(editor, SIGNAL(textEdited(QString)),
+ this, SLOT(slotSetValue(QString)));
+ connect(editor, SIGNAL(textChanged(QString)),
+ this, SLOT(slotSetValue(QString)));
+ connect(editor, SIGNAL(destroyed(QObject*)),
+ this, SLOT(slotEditorDestroyed(QObject*)));
+ return editor;
+}
+
+/*!
+ \internal
+
+ Reimplemented from the QtAbstractEditorFactory class.
+*/
+void QtModelFilePathFactory::disconnectPropertyManager(QtModelFilesPropertyManager* manager) {
+ disconnect(manager, SIGNAL(valueChanged(QtProperty*, QString)),
+ this, SLOT(slotPropertyChanged(QtProperty*, QString)));
+}
+
+#pragma endregion
+
// QtDateEditFactory
#pragma region QtDateEditFactory
diff --git a/src/ui/PropertyBrowser/qteditorfactory.h b/src/ui/PropertyBrowser/qteditorfactory.h
index b6c84b0e..022a9dcb 100644
--- a/src/ui/PropertyBrowser/qteditorfactory.h
+++ b/src/ui/PropertyBrowser/qteditorfactory.h
@@ -210,6 +210,28 @@ private:
Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
};
+class QtModelFilePathFactoryPrivate;
+
+class QtModelFilePathFactory : public QtAbstractEditorFactory
+{
+ Q_OBJECT
+public:
+ QtModelFilePathFactory(QObject *parent = 0);
+ ~QtModelFilePathFactory();
+protected:
+ void connectPropertyManager(QtModelFilesPropertyManager*manager) override;
+ QWidget *createEditor(QtModelFilesPropertyManager*manager, QtProperty *property,
+ QWidget *parent) override;
+ void disconnectPropertyManager(QtModelFilesPropertyManager*manager) override;
+private:
+ QScopedPointer d_ptr;
+ Q_DECLARE_PRIVATE(QtModelFilePathFactory)
+ Q_DISABLE_COPY_MOVE(QtModelFilePathFactory)
+ Q_PRIVATE_SLOT(d_func(), void slotPropertyChanged(QtProperty *, const QString &))
+ Q_PRIVATE_SLOT(d_func(), void slotSetValue(const QString &))
+ Q_PRIVATE_SLOT(d_func(), void slotEditorDestroyed(QObject *))
+};
+
class QtDateEditFactoryPrivate;
class QtDateEditFactory : public QtAbstractEditorFactory
diff --git a/src/ui/PropertyBrowser/qtpropertybrowserutils.cpp b/src/ui/PropertyBrowser/qtpropertybrowserutils.cpp
index b2d25da7..155a0f99 100644
--- a/src/ui/PropertyBrowser/qtpropertybrowserutils.cpp
+++ b/src/ui/PropertyBrowser/qtpropertybrowserutils.cpp
@@ -52,6 +52,7 @@
#include "workspace/WorkSpace.h"
#include "workspace/WorkSpaceManager.h"
#include "utils/FileUtils.h"
+#include "common/RecourceHelper.h"
QT_BEGIN_NAMESPACE
@@ -763,4 +764,63 @@ void QFilePathEdit::onFileSelect() {
#pragma endregion
+
+#pragma region QModelFilePathEdit
+
+QModelFilePathEdit::QModelFilePathEdit(QWidget* parent) :
+ QWidget(parent),
+ m_stringEdit(new QLineEdit(this)),
+ m_button(new QPushButton(this)) {
+ m_button->setIcon(QIcon(QLatin1String(":/qt-project.org/qtpropertybrowser/images/button-reset.ico")));
+ m_button->setMaximumWidth(15);
+
+ m_stringEdit->setReadOnly(true);
+
+ QHBoxLayout* lt = new QHBoxLayout;
+ lt->setContentsMargins(0, 0, 0, 0);
+ lt->setSpacing(1);
+ lt->addWidget(m_stringEdit);
+ lt->addWidget(m_button);
+ lt->setStretch(0, 1);
+ lt->setStretch(1, 0);
+ setLayout(lt);
+
+
+ connect(m_stringEdit, &QLineEdit::textChanged, this, &QModelFilePathEdit::textChanged);
+ connect(m_stringEdit, &QLineEdit::textEdited, this, &QModelFilePathEdit::textEdited);
+ connect(m_stringEdit, &QLineEdit::textChanged, this, [&] { m_button->setEnabled(m_initialvalue != m_stringEdit->text()); });
+ connect(m_stringEdit, &QLineEdit::textEdited, this, [&] { m_button->setEnabled(m_initialvalue != m_stringEdit->text()); });
+ connect(m_button, &QPushButton::clicked, this, &QModelFilePathEdit::onFileSelect);
+ setFocusProxy(m_stringEdit);
+}
+
+QString QModelFilePathEdit::filePath() {
+ return m_stringEdit->text();
+}
+
+QString QModelFilePathEdit::fileName() {
+ return m_fileName;
+}
+
+void QModelFilePathEdit::setFilePath(const QString& val) {
+ m_stringEdit->setText(val);
+}
+
+void QModelFilePathEdit::setInitialText(const QString& val) {
+ m_initialvalue = val;
+}
+
+void QModelFilePathEdit::onFileSelect() {
+ const QString path = QString("%1/resources/model").arg(RecourceHelper::Get().GetBasePath());
+ QString filePath = QFileDialog::getOpenFileName(this, tr("Open File"), path, tr("All Files (*)"));
+ if (!filePath.isEmpty()) {
+ m_fileName = filePath.right(filePath.length() - path.length() - 1);
+
+ m_initialvalue = m_fileName;
+ m_stringEdit->setText(m_fileName);
+ }
+}
+
+#pragma endregion
+
QT_END_NAMESPACE
diff --git a/src/ui/PropertyBrowser/qtpropertybrowserutils_p.h b/src/ui/PropertyBrowser/qtpropertybrowserutils_p.h
index c12c433b..6f11cf77 100644
--- a/src/ui/PropertyBrowser/qtpropertybrowserutils_p.h
+++ b/src/ui/PropertyBrowser/qtpropertybrowserutils_p.h
@@ -286,7 +286,7 @@ private:
#pragma endregion
-#pragma region QFileSelectEdit
+#pragma region QFilePathEdit
class QFilePathEdit : public QWidget {
Q_OBJECT
@@ -314,6 +314,34 @@ private:
#pragma endregion
+#pragma region QModelFilePathEdit
+
+class QModelFilePathEdit : public QWidget {
+ Q_OBJECT
+public:
+ QModelFilePathEdit(QWidget* parent = Q_NULLPTR);
+
+ QString filePath();
+ QString fileName();
+ void setFilePath(const QString&);
+ void setInitialText(const QString&);
+
+Q_SIGNALS:
+ void textChanged(QString);
+ void textEdited(QString);
+
+protected:
+ void onFileSelect();
+
+private:
+ QLineEdit* m_stringEdit;
+ QPushButton* m_button;
+ QString m_initialvalue;
+ QString m_fileName;
+};
+
+#pragma endregion
+
QT_END_NAMESPACE
diff --git a/src/ui/PropertyBrowser/qtpropertymanager.cpp b/src/ui/PropertyBrowser/qtpropertymanager.cpp
index 38b54b3b..2e6f7f72 100644
--- a/src/ui/PropertyBrowser/qtpropertymanager.cpp
+++ b/src/ui/PropertyBrowser/qtpropertymanager.cpp
@@ -1703,6 +1703,176 @@ void QtFilesPropertyManager::uninitializeProperty(QtProperty* property) {
#pragma endregion
+// QtModelFilesPropertyManager
+#pragma region QtModelFilesPropertyManager
+
+class QtModelFilesPropertyManagerPrivate {
+ QtModelFilesPropertyManager* q_ptr;
+ Q_DECLARE_PUBLIC(QtModelFilesPropertyManager)
+public:
+
+ struct Data {
+ QString val;
+ QString initVal;
+ bool isInitialed;
+ };
+
+ typedef QMap PropertyValueMap;
+ QMap m_values;
+};
+
+/*!
+ \class QtStringPropertyManager
+ \internal
+ \inmodule QtDesigner
+ \since 4.4
+
+ \brief The QtStringPropertyManager provides and manages QString properties.
+
+ A string property's value can be retrieved using the value()
+ function, and set using the setValue() slot.
+
+ The current value can be checked against a regular expression. To
+ set the regular expression use the setRegExp() slot, use the
+ regExp() function to retrieve the currently set expression.
+
+ In addition, QtStringPropertyManager provides the valueChanged() signal
+ which is emitted whenever a property created by this manager
+ changes, and the regExpChanged() signal which is emitted whenever
+ such a property changes its currently set regular expression.
+
+ \sa QtAbstractPropertyManager, QtLineEditFactory
+*/
+
+/*!
+ \fn void QtStringPropertyManager::valueChanged(QtProperty *property, const QString &value)
+
+ This signal is emitted whenever a property created by this manager
+ changes its value, passing a pointer to the \a property and the
+ new \a value as parameters.
+
+ \sa setValue()
+*/
+
+/*!
+ \fn void QtStringPropertyManager::regExpChanged(QtProperty *property, const QRegularExpression ®Exp)
+
+ This signal is emitted whenever a property created by this manager
+ changes its currenlty set regular expression, passing a pointer to
+ the \a property and the new \a regExp as parameters.
+
+ \sa setRegExp()
+*/
+
+/*!
+ Creates a manager with the given \a parent.
+*/
+QtModelFilesPropertyManager::QtModelFilesPropertyManager(QObject* parent)
+ : QtAbstractPropertyManager(parent), d_ptr(new QtModelFilesPropertyManagerPrivate) {
+ d_ptr->q_ptr = this;
+}
+
+/*!
+ Destroys this manager, and all the properties it has created.
+*/
+QtModelFilesPropertyManager::~QtModelFilesPropertyManager() {
+ clear();
+}
+
+/*!
+ Returns the given \a property's value.
+
+ If the given property is not managed by this manager, this
+ function returns an empty string.
+
+ \sa setValue()
+*/
+QString QtModelFilesPropertyManager::value(const QtProperty* property) const {
+ return getValue(d_ptr->m_values, property);
+}
+
+QString QtModelFilesPropertyManager::initialValue(const QtProperty* property) const {
+ return getData(d_ptr->m_values, &QtModelFilesPropertyManagerPrivate::Data::initVal, property, QString());
+}
+
+/*!
+ \reimp
+*/
+QString QtModelFilesPropertyManager::valueText(const QtProperty* property) const {
+ const QtModelFilesPropertyManagerPrivate::PropertyValueMap::const_iterator it = d_ptr->m_values.constFind(property);
+ if (it == d_ptr->m_values.constEnd())
+ return QString();
+ return it.value().val;
+}
+
+/*!
+ \fn void QtStringPropertyManager::setValue(QtProperty *property, const QString &value)
+
+ Sets the value of the given \a property to \a value.
+
+ If the specified \a value doesn't match the given \a property's
+ regular expression, this function does nothing.
+
+ \sa value(), setRegExp(), valueChanged()
+*/
+void QtModelFilesPropertyManager::setValue(QtProperty* property, const QString& val) {
+ const QtModelFilesPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->m_values.find(property);
+ if (it == d_ptr->m_values.end())
+ return;
+
+ QtModelFilesPropertyManagerPrivate::Data data = it.value();
+
+ if (data.val == val)
+ return;
+
+ if (!data.isInitialed) {
+ data.initVal = val;
+ data.isInitialed = true;
+ }
+
+ data.val = val;
+
+ it.value() = data;
+
+ emit propertyChanged(property);
+ emit valueChanged(property, data.val);
+}
+
+void QtModelFilesPropertyManager::setValueOnly(QtProperty* property, const QString& val) {
+ const QtModelFilesPropertyManagerPrivate::PropertyValueMap::iterator it = d_ptr->m_values.find(property);
+ if (it == d_ptr->m_values.end())
+ return;
+
+ QtModelFilesPropertyManagerPrivate::Data data = it.value();
+
+ if (data.val == val)
+ return;
+
+ data.val = val;
+ data.initVal = val;
+
+ it.value() = data;
+
+ emit propertyChanged(property);
+ emit valueChanged(property, data.val);
+}
+
+/*!
+ \reimp
+*/
+void QtModelFilesPropertyManager::initializeProperty(QtProperty* property) {
+ d_ptr->m_values[property] = QtModelFilesPropertyManagerPrivate::Data();
+}
+
+/*!
+ \reimp
+*/
+void QtModelFilesPropertyManager::uninitializeProperty(QtProperty* property) {
+ d_ptr->m_values.remove(property);
+}
+
+#pragma endregion
+
// QtBoolPropertyManager
#pragma region QtBoolPropertyManager
@@ -8112,7 +8282,7 @@ public:
PropertyValueMap m_values;
- QtStringPropertyManager* m_stringProperyManager;
+ QtModelFilesPropertyManager* m_modelFileProperyManager;
QMap m_properyToMesh;
@@ -8140,8 +8310,8 @@ QtMeshComponetManager::QtMeshComponetManager(QObject* parent)
: QtComponentPropertyManager(parent), d_ptr(new QtMeshComponetManagerPrivate) {
d_ptr->q_ptr = this;
- d_ptr->m_stringProperyManager = new QtStringPropertyManager(this);
- connect(d_ptr->m_stringProperyManager, SIGNAL(valueChanged(QtProperty*, QString)),
+ d_ptr->m_modelFileProperyManager = new QtModelFilesPropertyManager(this);
+ connect(d_ptr->m_modelFileProperyManager, SIGNAL(valueChanged(QtProperty*, QString)),
this, SLOT(slotStringChanged(QtProperty*, QString)));
}
@@ -8177,8 +8347,8 @@ QMeshComponentAttribute QtMeshComponetManager::value(const QtProperty* property)
return d_ptr->m_values.value(property, QMeshComponentAttribute());
}
-QtStringPropertyManager* QtMeshComponetManager::subStringProperyManager() const {
- return d_ptr->m_stringProperyManager;
+QtModelFilesPropertyManager* QtMeshComponetManager::subModelFileProperyManager() const {
+ return d_ptr->m_modelFileProperyManager;
}
/*!
@@ -8221,7 +8391,7 @@ void QtMeshComponetManager::setValue(QtProperty* property, const QMeshComponentA
it.value() = value;
- d_ptr->m_stringProperyManager->setValue(d_ptr->m_properyToMesh[property], value.GetMesh());
+ d_ptr->m_modelFileProperyManager->setValue(d_ptr->m_properyToMesh[property], value.GetMesh());
emit propertyChanged(property);
emit valueChanged(property, value);
@@ -8234,9 +8404,9 @@ void QtMeshComponetManager::initializeProperty(QtProperty* property) {
QMeshComponentAttribute val;
d_ptr->m_values[property] = val;
- QtProperty* prop = d_ptr->m_stringProperyManager->addProperty();
+ QtProperty* prop = d_ptr->m_modelFileProperyManager->addProperty();
prop->setPropertyName(tr("Mesh"));
- d_ptr->m_stringProperyManager->setValueOnly(prop, val.GetMesh());
+ d_ptr->m_modelFileProperyManager->setValueOnly(prop, val.GetMesh());
d_ptr->m_properyToMesh[property] = prop;
d_ptr->m_meshToPropery[prop] = property;
property->addSubProperty(prop);
diff --git a/src/ui/PropertyBrowser/qtpropertymanager.h b/src/ui/PropertyBrowser/qtpropertymanager.h
index dd98c12a..cd0131a1 100644
--- a/src/ui/PropertyBrowser/qtpropertymanager.h
+++ b/src/ui/PropertyBrowser/qtpropertymanager.h
@@ -249,6 +249,36 @@ private:
#pragma endregion
+#pragma region QtModelFilesPropertyManager
+
+class QtModelFilesPropertyManagerPrivate;
+
+class QtModelFilesPropertyManager : public QtAbstractPropertyManager {
+ Q_OBJECT
+public:
+ QtModelFilesPropertyManager(QObject* parent = 0);
+ ~QtModelFilesPropertyManager();
+
+ QString value(const QtProperty* property) const;
+ QString initialValue(const QtProperty* property) const;
+
+public Q_SLOTS:
+ void setValue(QtProperty* property, const QString& val);
+ void setValueOnly(QtProperty* property, const QString& val);
+Q_SIGNALS:
+ void valueChanged(QtProperty* property, const QString& val);
+protected:
+ QString valueText(const QtProperty* property) const override;
+ void initializeProperty(QtProperty* property) override;
+ void uninitializeProperty(QtProperty* property) override;
+private:
+ QScopedPointer d_ptr;
+ Q_DECLARE_PRIVATE(QtModelFilesPropertyManager)
+ Q_DISABLE_COPY_MOVE(QtModelFilesPropertyManager)
+};
+
+#pragma endregion
+
#pragma region QtDatePropertyManager
class QtDatePropertyManagerPrivate;
@@ -1079,7 +1109,7 @@ public:
QMeshComponentAttribute value(const QtProperty* property) const;
- QtStringPropertyManager* subStringProperyManager() const;
+ QtModelFilesPropertyManager* subModelFileProperyManager() const;
public Q_SLOTS:
void setValue(QtProperty* property, const QMeshComponentAttribute& val);