forked from qt-creator/qt-creator
QmlDesigner.nodeInstanceView: adding parameter pathToQt
The NodeInstanceView is now informed about the build pathToQt. Change-Id: I728c9c356354ccf73599950c1c0bf4a96bd0a628 Reviewed-on: http://codereview.qt.nokia.com/437 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Marco Bubke <marco.bubke@nokia.com>
This commit is contained in:
@@ -437,6 +437,7 @@ void DesignDocumentController::loadCurrentModel()
|
||||
Q_ASSERT(m_d->model);
|
||||
m_d->model->setMasterModel(m_d->masterModel.data());
|
||||
|
||||
m_d->nodeInstanceView->setPathToQt(pathToQt());
|
||||
m_d->model->attachView(m_d->nodeInstanceView.data());
|
||||
m_d->model->attachView(m_d->navigator.data());
|
||||
m_d->itemLibraryView->widget()->setResourcePath(QFileInfo(m_d->fileName).absolutePath());
|
||||
@@ -822,8 +823,13 @@ void DesignDocumentController::activeQtVersionChanged()
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_d->qt_versionId == newQtVersion->uniqueId())
|
||||
return;
|
||||
|
||||
m_d->qt_versionId = newQtVersion->uniqueId();
|
||||
|
||||
if (m_d->nodeInstanceView)
|
||||
m_d->nodeInstanceView->setPathToQt(pathToQt());
|
||||
}
|
||||
|
||||
#ifdef ENABLE_TEXT_VIEW
|
||||
|
||||
@@ -138,6 +138,8 @@ public:
|
||||
|
||||
QImage statePreviewImage(const ModelNode &stateNode) const;
|
||||
|
||||
void setPathToQt(const QString &pathToQt);
|
||||
|
||||
signals:
|
||||
void qmlPuppetCrashed();
|
||||
|
||||
@@ -195,6 +197,7 @@ private: //variables
|
||||
QImage m_baseStatePreviewImage;
|
||||
QTime m_lastCrashTime;
|
||||
NodeInstanceServerInterface::RunModus m_runModus;
|
||||
QString m_pathToQt;
|
||||
};
|
||||
|
||||
} // namespace ProxyNodeInstanceView
|
||||
|
||||
@@ -88,7 +88,7 @@ static bool hasQtQuick1(NodeInstanceView *nodeInstanceView)
|
||||
return false;
|
||||
}
|
||||
|
||||
NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceView, RunModus runModus)
|
||||
NodeInstanceServerProxy::NodeInstanceServerProxy(NodeInstanceView *nodeInstanceView, RunModus runModus, const QString &pathToQt)
|
||||
: NodeInstanceServerInterface(nodeInstanceView),
|
||||
m_localServer(new QLocalServer(this)),
|
||||
m_nodeInstanceView(nodeInstanceView),
|
||||
|
||||
@@ -55,7 +55,7 @@ class NodeInstanceServerProxy : public NodeInstanceServerInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NodeInstanceServerProxy(NodeInstanceView *nodeInstanceView, RunModus runModus = NormalModus);
|
||||
explicit NodeInstanceServerProxy(NodeInstanceView *nodeInstanceView, RunModus runModus = NormalModus, const QString &pathToQt = QString());
|
||||
~NodeInstanceServerProxy();
|
||||
void createInstances(const CreateInstancesCommand &command);
|
||||
void changeFileUrl(const ChangeFileUrlCommand &command);
|
||||
|
||||
@@ -164,7 +164,7 @@ bool isSkippedNode(const ModelNode &node)
|
||||
void NodeInstanceView::modelAttached(Model *model)
|
||||
{
|
||||
AbstractView::modelAttached(model);
|
||||
m_nodeInstanceServer = new NodeInstanceServerProxy(this, m_runModus);
|
||||
m_nodeInstanceServer = new NodeInstanceServerProxy(this, m_runModus, m_pathToQt);
|
||||
m_lastCrashTime.start();
|
||||
connect(m_nodeInstanceServer.data(), SIGNAL(processCrashed()), this, SLOT(handleChrash()));
|
||||
|
||||
@@ -203,7 +203,7 @@ void NodeInstanceView::restartProcess()
|
||||
if (model()) {
|
||||
delete nodeInstanceServer();
|
||||
|
||||
m_nodeInstanceServer = new NodeInstanceServerProxy(this, m_runModus);
|
||||
m_nodeInstanceServer = new NodeInstanceServerProxy(this, m_runModus, m_pathToQt);
|
||||
connect(m_nodeInstanceServer.data(), SIGNAL(processCrashed()), this, SLOT(handleChrash()));
|
||||
|
||||
if (!isSkippedRootNode(rootModelNode()))
|
||||
@@ -1076,6 +1076,12 @@ QImage NodeInstanceView::statePreviewImage(const ModelNode &stateNode) const
|
||||
return m_statePreviewImage.value(stateNode);
|
||||
}
|
||||
|
||||
void NodeInstanceView::setPathToQt(const QString &pathToQt)
|
||||
{
|
||||
m_pathToQt = pathToQt;
|
||||
restartProcess();
|
||||
}
|
||||
|
||||
void NodeInstanceView::statePreviewImagesChanged(const StatePreviewImageChangedCommand &command)
|
||||
{
|
||||
if (!model())
|
||||
|
||||
Reference in New Issue
Block a user