aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/documentwarningwidget.cpp
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2017-01-10 16:36:55 +0100
committerTim Jenssen <tim.jenssen@qt.io>2017-01-10 15:58:36 +0000
commit759db2b7b6914ee6a58aa5be107275725468fae6 (patch)
tree09407e0a33c01193774d2c5539cc174a9d0c9255 /src/plugins/qmldesigner/documentwarningwidget.cpp
parent8b67458a9567fe4f83d3658916f5534617316b02 (diff)
QmlDesigner: Polish error handling for integrated text editor
The integrated text editor requires a couple of fixes and features in the error handling. The errors are now handled by the model and not the document management anymore. The text editor does not get disabled if there is an error. Instead we show the error in a status bar. The form editor is blocked if there is a QML an error and we show the error message inside the form editor. Change-Id: I4bfb9b33b09e444ec1de31dd531ce83b32cbcf88 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/documentwarningwidget.cpp')
-rw-r--r--src/plugins/qmldesigner/documentwarningwidget.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/plugins/qmldesigner/documentwarningwidget.cpp b/src/plugins/qmldesigner/documentwarningwidget.cpp
index 50ea460b13..475ab5c3dd 100644
--- a/src/plugins/qmldesigner/documentwarningwidget.cpp
+++ b/src/plugins/qmldesigner/documentwarningwidget.cpp
@@ -46,8 +46,6 @@ static QString errorToString(const RewriterError &error)
return QString("Line: %1: %2").arg(error.line()).arg(error.description());
}
-namespace Internal {
-
DocumentWarningWidget::DocumentWarningWidget(QWidget *parent)
: Utils::FakeToolTip(parent)
, m_headerLabel(new QLabel(this))
@@ -69,7 +67,6 @@ DocumentWarningWidget::DocumentWarningWidget(QWidget *parent)
connect(m_navigateLabel, &QLabel::linkActivated, this, [=](const QString &link) {
if (link == QLatin1String("goToCode")) {
- hide();
emitGotoCodeClicked(m_messages.at(m_currentMessage));
} else if (link == QLatin1String("previous")) {
--m_currentMessage;
@@ -81,9 +78,10 @@ DocumentWarningWidget::DocumentWarningWidget(QWidget *parent)
});
connect(m_continueButton, &QPushButton::clicked, this, [=]() {
- hide();
if (m_mode == ErrorMode)
emitGotoCodeClicked(m_messages.at(m_currentMessage));
+ else
+ hide();
});
connect(m_ignoreWarningsCheckBox, &QCheckBox::toggled, this, &DocumentWarningWidget::ignoreCheckBoxToggled);
@@ -233,5 +231,4 @@ void DocumentWarningWidget::setMessages(const QList<RewriterError> &messages)
refreshContent();
}
-} // namespace Internal
} // namespace Designer