From e8a6c7e9c50215213db5ae2f580306b74364b063 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 30 Aug 2017 18:58:50 +0200 Subject: [PATCH] Clang: Add placeholder text to Clang Query Task-number: QTCREATORBUG-18815 Change-Id: Ie5d53f0b3f2464408bb09022483a3a6258e8173d Reviewed-by: Tim Jenssen --- .../clangqueryexampletexteditorwidget.cpp | 1 + .../clangqueryprojectsfindfilter.ui | 35 ++++++++++++++++--- .../clangquerytexteditorwidget.cpp | 1 + 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/src/plugins/clangrefactoring/clangqueryexampletexteditorwidget.cpp b/src/plugins/clangrefactoring/clangqueryexampletexteditorwidget.cpp index 19273d5ede..79ff5576b9 100644 --- a/src/plugins/clangrefactoring/clangqueryexampletexteditorwidget.cpp +++ b/src/plugins/clangrefactoring/clangqueryexampletexteditorwidget.cpp @@ -36,6 +36,7 @@ ClangQueryExampleTextEditorWidget::ClangQueryExampleTextEditorWidget(QWidget *pa { m_syntaxHighlighter = new ClangQueryExampleHighlighter; textDocument()->setSyntaxHighlighter(m_syntaxHighlighter); + textDocument()->setPlainText("class Foo {\n void function() { int local; }\n int field;\n};"); } ClangQueryExampleHighlighter *ClangQueryExampleTextEditorWidget::syntaxHighlighter() const diff --git a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.ui b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.ui index 9fbad01f0b..819fae485d 100644 --- a/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.ui +++ b/src/plugins/clangrefactoring/clangqueryprojectsfindfilter.ui @@ -6,14 +6,29 @@ 0 0 - 1241 - 471 + 512 + 390 + + + 1 + 1 + + + + + 512 + 0 + + Form + + QLayout::SetMinimumSize + 0 @@ -30,20 +45,32 @@ - 0 + 1 3 + + class Foo { void function() { int x; } }; + - 0 + 1 1 + + + 700 + 0 + + + + functionDecl() + diff --git a/src/plugins/clangrefactoring/clangquerytexteditorwidget.cpp b/src/plugins/clangrefactoring/clangquerytexteditorwidget.cpp index 2d0552680c..e24d6eab5e 100644 --- a/src/plugins/clangrefactoring/clangquerytexteditorwidget.cpp +++ b/src/plugins/clangrefactoring/clangquerytexteditorwidget.cpp @@ -38,6 +38,7 @@ ClangQueryTextEditorWidget::ClangQueryTextEditorWidget(QWidget *parent) m_hoverHandler(std::make_unique(m_syntaxHighlighter)) { textDocument()->setSyntaxHighlighter(m_syntaxHighlighter); + textDocument()->setPlainText("functionDecl()"); addHoverHandler(m_hoverHandler.get()); } -- GitLab