QmlDesigner: Rewriters parses immediately

The rewriter needs to parse the file immediately and not use the timer.

Change-Id: I6399edc23201d301dcb7d8d33d1bd956dd087b4c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Marco Bubke
2022-10-18 22:23:35 +02:00
parent d554bf5e2a
commit c2208fecfd
5 changed files with 9 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ public:
virtual bool isQt6Import() const = 0; virtual bool isQt6Import() const = 0;
virtual bool hasStartupTarget() const = 0; virtual bool hasStartupTarget() const = 0;
virtual PuppetStartData puppetStartData(const class Model &model) const = 0; virtual PuppetStartData puppetStartData(const class Model &model) const = 0;
virtual bool instantQmlTextUpdate() const = 0;
}; };
} // namespace QmlDesigner } // namespace QmlDesigner

View File

@@ -1084,7 +1084,7 @@ void RewriterView::qmlTextChanged()
} }
case Amend: { case Amend: {
if (m_instantQmlTextUpdate) { if (m_instantQmlTextUpdate || externalDependencies().instantQmlTextUpdate()) {
amendQmlText(); amendQmlText();
} else { } else {
if (externalDependencies().viewManagerUsesRewriterView(this)) { if (externalDependencies().viewManagerUsesRewriterView(this)) {

View File

@@ -231,4 +231,9 @@ PuppetStartData ExternalDependencies::puppetStartData(const Model &model) const
return data; return data;
} }
bool ExternalDependencies::instantQmlTextUpdate() const
{
return false;
}
} // namespace QmlDesigner } // namespace QmlDesigner

View File

@@ -34,6 +34,7 @@ public:
bool isQt6Import() const override; bool isQt6Import() const override;
bool hasStartupTarget() const override; bool hasStartupTarget() const override;
PuppetStartData puppetStartData(const class Model &model) const override; PuppetStartData puppetStartData(const class Model &model) const override;
bool instantQmlTextUpdate() const override;
private: private:
const DesignerSettings &m_designerSettings; const DesignerSettings &m_designerSettings;

View File

@@ -158,6 +158,7 @@ public:
bool isQt6Import() const override { return true; } bool isQt6Import() const override { return true; }
bool hasStartupTarget() const override { return true; } bool hasStartupTarget() const override { return true; }
PuppetStartData puppetStartData(const class Model &) const override { return {}; } PuppetStartData puppetStartData(const class Model &) const override { return {}; }
bool instantQmlTextUpdate() const override { return true; }
public: public:
QSettings qsettings; QSettings qsettings;