forked from qt-creator/qt-creator
QmlDesigner: Show qrc mapping in debug view
Change-Id: I0fcf35877042e1c3c53258f3a44ce76bd18e727d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -395,7 +395,10 @@ void DebugView::instancesChildrenChanged(const QVector<ModelNode> & nodeList)
|
|||||||
|
|
||||||
void DebugView::customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data)
|
void DebugView::customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data)
|
||||||
{
|
{
|
||||||
if (isDebugViewEnabled()) {
|
if (identifier == "PuppetStatus" && data.count() == 1) {
|
||||||
|
m_debugViewWidget->setPuppetStatus(data.first().toString());
|
||||||
|
|
||||||
|
} else if (isDebugViewEnabled()) {
|
||||||
QTextStream message;
|
QTextStream message;
|
||||||
QString string;
|
QString string;
|
||||||
message.setString(&string);
|
message.setString(&string);
|
||||||
|
|||||||
@@ -87,6 +87,11 @@ void DebugViewWidget::addLogInstanceMessage(const QString &topic, const QString
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DebugViewWidget::setPuppetStatus(const QString &text)
|
||||||
|
{
|
||||||
|
m_ui.instanceStatus->setPlainText(text);
|
||||||
|
}
|
||||||
|
|
||||||
void DebugViewWidget::setDebugViewEnabled(bool b)
|
void DebugViewWidget::setDebugViewEnabled(bool b)
|
||||||
{
|
{
|
||||||
if (m_ui.enabledCheckBox->isChecked() != b)
|
if (m_ui.enabledCheckBox->isChecked() != b)
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public:
|
|||||||
void addLogMessage(const QString &topic, const QString &message, bool highlight = false);
|
void addLogMessage(const QString &topic, const QString &message, bool highlight = false);
|
||||||
void addErrorMessage(const QString &topic, const QString &message);
|
void addErrorMessage(const QString &topic, const QString &message);
|
||||||
void addLogInstanceMessage(const QString &topic, const QString &message, bool highlight = false);
|
void addLogInstanceMessage(const QString &topic, const QString &message, bool highlight = false);
|
||||||
|
void setPuppetStatus(const QString &text);
|
||||||
|
|
||||||
void setDebugViewEnabled(bool b);
|
void setDebugViewEnabled(bool b);
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="instanceLog_2">
|
<widget class="QTabWidget" name="instanceLog_2">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab">
|
<widget class="QWidget" name="tab">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>2</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QPlainTextEdit" name="instanceLog">
|
<widget class="QPlainTextEdit" name="instanceLog">
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@@ -187,6 +187,22 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QPlainTextEdit" name="instanceStatus">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>42</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tab_2">
|
<widget class="QWidget" name="tab_2">
|
||||||
|
|||||||
@@ -32,6 +32,7 @@
|
|||||||
#include <qmldesignerplugin.h>
|
#include <qmldesignerplugin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <nodeinstanceview.h>
|
||||||
|
|
||||||
#include <projectexplorer/kit.h>
|
#include <projectexplorer/kit.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
@@ -461,6 +462,9 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
|
|||||||
if (!m_qrcMapping.isEmpty()) {
|
if (!m_qrcMapping.isEmpty()) {
|
||||||
environment.set(QLatin1String("QMLDESIGNER_RC_PATHS"), m_qrcMapping);
|
environment.set(QLatin1String("QMLDESIGNER_RC_PATHS"), m_qrcMapping);
|
||||||
}
|
}
|
||||||
|
#ifndef QMLDESIGNER_TEST
|
||||||
|
QmlDesignerPlugin::instance()->viewManager().nodeInstanceView()->emitCustomNotification("PuppetStatus", {}, {QVariant(m_qrcMapping)});
|
||||||
|
#endif
|
||||||
|
|
||||||
QStringList importPaths = m_model->importPaths();
|
QStringList importPaths = m_model->importPaths();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user