forked from qt-creator/qt-creator
QML Designer: reload QML puppet when adding fonts
Automatically reload QML when importing fonts, so that the newly added font can be viewed in 2D preview right away. Note, this causes a visible flicker in the 2D preview. If anyone has ideas how to make it smoother, I'm open to suggestions. Fixes: QDS-14900 Change-Id: Ib7a354d0e25a087aabe690ebdafbf131b579dd40 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -1129,7 +1129,11 @@ static QString getAssetDefaultDirectory(const QString &assetDir, const QString &
|
|||||||
|
|
||||||
AddFilesResult addFontToProject(const QStringList &fileNames, const QString &defaultDir, bool showDialog)
|
AddFilesResult addFontToProject(const QStringList &fileNames, const QString &defaultDir, bool showDialog)
|
||||||
{
|
{
|
||||||
return addFilesToProject(fileNames, getAssetDefaultDirectory("fonts", defaultDir), showDialog);
|
const AddFilesResult result = addFilesToProject(fileNames,
|
||||||
|
getAssetDefaultDirectory("fonts", defaultDir),
|
||||||
|
showDialog);
|
||||||
|
QmlDesignerPlugin::viewManager().view()->resetPuppet();
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddFilesResult addSoundToProject(const QStringList &fileNames, const QString &defaultDir, bool showDialog)
|
AddFilesResult addSoundToProject(const QStringList &fileNames, const QString &defaultDir, bool showDialog)
|
||||||
|
@@ -512,6 +512,11 @@ const AbstractView *ViewManager::view() const
|
|||||||
return &d->nodeInstanceView;
|
return &d->nodeInstanceView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AbstractView *ViewManager::view()
|
||||||
|
{
|
||||||
|
return &d->nodeInstanceView;
|
||||||
|
}
|
||||||
|
|
||||||
TextEditorView *ViewManager::textEditorView()
|
TextEditorView *ViewManager::textEditorView()
|
||||||
{
|
{
|
||||||
return &d->textEditorView;
|
return &d->textEditorView;
|
||||||
|
@@ -72,6 +72,7 @@ public:
|
|||||||
void nextFileIsCalledInternally();
|
void nextFileIsCalledInternally();
|
||||||
|
|
||||||
const AbstractView *view() const;
|
const AbstractView *view() const;
|
||||||
|
AbstractView *view();
|
||||||
TextEditorView *textEditorView();
|
TextEditorView *textEditorView();
|
||||||
|
|
||||||
void emitCustomNotification(const QString &identifier, const QList<ModelNode> &nodeList,
|
void emitCustomNotification(const QString &identifier, const QList<ModelNode> &nodeList,
|
||||||
|
Reference in New Issue
Block a user