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>
This commit is contained in:
Thomas Hartmann
2017-01-10 16:36:55 +01:00
committed by Tim Jenssen
parent 8b67458a95
commit 759db2b7b6
30 changed files with 383 additions and 114 deletions

View File

@@ -34,6 +34,7 @@
namespace QmlDesigner {
class TextEditorView;
class TextEditorStatusBar;
class TextEditorWidget : public QWidget {
@@ -51,6 +52,10 @@ public:
QString contextHelpId() const;
void jumpTextCursorToSelectedModelNode();
void gotoCursorPosition(int line, int column);
void setStatusText(const QString &text);
void clearStatusBar();
private:
void updateSelectionByCursorPosition();
@@ -58,6 +63,7 @@ private:
std::unique_ptr<TextEditor::BaseTextEditor> m_textEditor;
QPointer<TextEditorView> m_textEditorView;
QTimer m_updateSelectionTimer;
TextEditorStatusBar *m_statusBar;
};
} // namespace QmlDesigner