Commit 6b11c398 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: speedup loading of QmlDesigner

The creation of property pages is now delayed
parent a9a7f045
......@@ -269,7 +269,8 @@ PropertyEditor::PropertyEditor(QWidget *parent) :
m_timerId(0),
m_stackedWidget(new StackedWidget(parent)),
m_currentType(0),
m_locked(false)
m_locked(false),
m_setupCompleted(false)
{
m_updateShortcut = new QShortcut(QKeySequence("F5"), m_stackedWidget);
connect(m_updateShortcut, SIGNAL(activated()), this, SLOT(reloadQml()));
......@@ -334,7 +335,6 @@ void PropertyEditor::setupPane(const QString &typeName)
type->initialSetup(typeName, qmlSpecificsFile, this);
ctxt->setContextProperty("finishedNotify", QVariant(true) );
}
m_stackedWidget->setCurrentWidget(type->m_view);
}
void PropertyEditor::changeValue(const QString &propertyName)
......@@ -501,6 +501,22 @@ void PropertyEditor::updateSize()
frame->resize(m_stackedWidget->size());
}
void PropertyEditor::setupPanes()
{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
setupPane("Qt/Rectangle");
QApplication::processEvents();
setupPane("Qt/Text");
QApplication::processEvents();
setupPane("Qt/TextInput");
QApplication::processEvents();
setupPane("Qt/TextEdit");
QApplication::processEvents();
resetView();
m_setupCompleted = true;
QApplication::restoreOverrideCursor();
}
void PropertyEditor::otherPropertyChanged(const QmlObjectNode &fxObjectNode, const QString &propertyName)
{
QmlModelView::otherPropertyChanged(fxObjectNode, propertyName);
......@@ -723,11 +739,9 @@ void PropertyEditor::modelAttached(Model *model)
m_locked = true;
setupPane("Qt/Rectangle");
setupPane("Qt/Text");
setupPane("Qt/TextInput");
setupPane("Qt/TextEdit");
resetView();
if (!m_setupCompleted)
QTimer::singleShot(1000, this, SLOT(setupPanes()));
m_locked = false;
}
......
......@@ -117,6 +117,7 @@ private slots:
void changeValue(const QString &name);
void changeExpression(const QString &name);
void updateSize();
void setupPanes();
private: //functions
QString qmlFileName(const NodeMetaInfo &nodeInfo) const;
......@@ -139,6 +140,7 @@ private: //variables
QHash<QString, NodeType *> m_typeHash;
NodeType *m_currentType;
bool m_locked;
bool m_setupCompleted;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment