forked from qt-creator/qt-creator
QmlDesigner: Create default effects folder in assets library
Task-number: QDS-8166 Change-Id: I12bf86ec5983642295a20d254f06d0a4ab6ccdb1 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -1677,7 +1677,7 @@ void openEffectMaker(const QString &filePath)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePath getEffectsDirectory()
|
Utils::FilePath getEffectsImportDirectory()
|
||||||
{
|
{
|
||||||
QString defaultDir = "asset_imports/Effects";
|
QString defaultDir = "asset_imports/Effects";
|
||||||
Utils::FilePath projectPath = QmlDesignerPlugin::instance()->documentManager().currentProjectDirPath();
|
Utils::FilePath projectPath = QmlDesignerPlugin::instance()->documentManager().currentProjectDirPath();
|
||||||
@@ -1691,6 +1691,11 @@ Utils::FilePath getEffectsDirectory()
|
|||||||
return effectsPath;
|
return effectsPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString getEffectsDefaultDirectory(const QString &defaultDir)
|
||||||
|
{
|
||||||
|
return getAssetDefaultDirectory("effects", defaultDir);
|
||||||
|
}
|
||||||
|
|
||||||
QString getEffectIcon(const QString &effectPath)
|
QString getEffectIcon(const QString &effectPath)
|
||||||
{
|
{
|
||||||
const ProjectExplorer::Target *target = ProjectExplorer::ProjectTree::currentTarget();
|
const ProjectExplorer::Target *target = ProjectExplorer::ProjectTree::currentTarget();
|
||||||
@@ -1718,7 +1723,7 @@ bool useLayerEffect()
|
|||||||
bool validateEffect(const QString &effectPath)
|
bool validateEffect(const QString &effectPath)
|
||||||
{
|
{
|
||||||
const QString effectName = QFileInfo(effectPath).baseName();
|
const QString effectName = QFileInfo(effectPath).baseName();
|
||||||
Utils::FilePath effectsResDir = ModelNodeOperations::getEffectsDirectory();
|
Utils::FilePath effectsResDir = ModelNodeOperations::getEffectsImportDirectory();
|
||||||
Utils::FilePath qmlPath = effectsResDir.resolvePath(effectName + "/" + effectName + ".qml");
|
Utils::FilePath qmlPath = effectsResDir.resolvePath(effectName + "/" + effectName + ".qml");
|
||||||
if (!qmlPath.exists()) {
|
if (!qmlPath.exists()) {
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
|
@@ -119,7 +119,8 @@ void addMouseAreaFill(const SelectionContext &selectionContext);
|
|||||||
void openSignalDialog(const SelectionContext &selectionContext);
|
void openSignalDialog(const SelectionContext &selectionContext);
|
||||||
void updateImported3DAsset(const SelectionContext &selectionContext);
|
void updateImported3DAsset(const SelectionContext &selectionContext);
|
||||||
|
|
||||||
QMLDESIGNERCORE_EXPORT Utils::FilePath getEffectsDirectory();
|
QMLDESIGNERCORE_EXPORT Utils::FilePath getEffectsImportDirectory();
|
||||||
|
QMLDESIGNERCORE_EXPORT QString getEffectsDefaultDirectory(const QString &defaultDir);
|
||||||
void openEffectMaker(const QString &filePath);
|
void openEffectMaker(const QString &filePath);
|
||||||
QString getEffectIcon(const QString &effectPath);
|
QString getEffectIcon(const QString &effectPath);
|
||||||
bool useLayerEffect();
|
bool useLayerEffect();
|
||||||
|
Reference in New Issue
Block a user