From 82693c8abbafbd978873d2a7516054c62e1801ed Mon Sep 17 00:00:00 2001 From: Sergey Belyashov Date: Wed, 27 Jan 2016 14:45:12 +0300 Subject: [PATCH 1/8] Update Russian translation Change-Id: I20b894139b8d21b3c90c018a4866f96b6c45ac33 Reviewed-by: Denis Shienkov Reviewed-by: Oswald Buddenhagen --- share/qtcreator/translations/qtcreator_ru.ts | 72 +++----------------- 1 file changed, 11 insertions(+), 61 deletions(-) diff --git a/share/qtcreator/translations/qtcreator_ru.ts b/share/qtcreator/translations/qtcreator_ru.ts index 0154b6c420f..ddd6ece543f 100644 --- a/share/qtcreator/translations/qtcreator_ru.ts +++ b/share/qtcreator/translations/qtcreator_ru.ts @@ -3752,40 +3752,6 @@ For example, "Revision: 15" will leave the branch at revision 15.Находится в %1 - - ClangCodeModel::Internal::ClangProjectSettingsPropertiesPage - - Pre-compiled headers: - Предкомпиляция: - - - None - Нет - - - Build system (exact) - Система сборки (точно) - - - Build system (fuzzy) - Система сборки (приближённо) - - - Custom - Особая - - - Choose... - Выбрать... - - - - ClangCodeModel::Internal::ClangProjectSettingsWidget - - Clang Settings - Настройки Clang - - ClangCodeModel::Internal::ModelManagerSupport @@ -13230,10 +13196,6 @@ Do you want to retry? Start Watching Начинать наблюдение - - Close - Закрыть - Kit: Комплект: @@ -24082,6 +24044,10 @@ Preselects a desktop Qt for building the application if available. Qt Canvas 3D Application Приложение Qt Canvas 3D + + Qt 5.6 + Qt 5.6 + Qt 5.5 Qt 5.5 @@ -28819,10 +28785,6 @@ This is independent of the visibility property in QML. QmlDesigner::QmlDesignerPlugin - - Cannot create OpenGL context. - Не удалось создать контекст OpenGL. - Switch Text/Design Переключить текст/дизайн @@ -29784,10 +29746,6 @@ Please build the qmldump application on the Qt version options page. Major version different from 1 not supported. Версия с основным номером отличным от 1 не поддерживается. - - Reading only version 1.1 parts. - Чтение разделов версии 1.1. - Expected document to contain a single object definition. Требуется определение в документе ровно одного объекта. @@ -29796,10 +29754,6 @@ Please build the qmldump application on the Qt version options page. Expected document to contain a Module {} member. В документе требуется наличие члена Module {}. - - Expected only Component and ModuleApi object definitions. - Допустимы только определения объектов Component и ModuleApi. - Expected only Property, Method, Signal and Enum object definitions, not "%1". Допустимы только определения объектов Property, Method, Signal и Enum, а не «%1». @@ -30595,10 +30549,6 @@ references to elements in other files, loops, and so on.) QmlProfiler::Internal::QmlProfilerPlugin - - Cannot create OpenGL context. - Не удалось создать контекст OpenGL. - QML Profiler Профайлер QML @@ -31825,6 +31775,13 @@ cannot be found in the path. Журнал сборки помощника отладчика + + QtSupport::ProMessageHandler + + [Inexact] + [Примерно] + + QtSupport::QtKitInformation @@ -38685,13 +38642,6 @@ should a repository require SSH-authentication (see documentation on SSH and the Ошибка загрузки режима приветствия - - Welcome::Internal::WelcomePlugin - - Cannot create OpenGL context. - Не удалось создать контекст OpenGL. - - WidgetPluginManager From 9dabbdceb77fc1194eadf3eff7936bbfda795c4c Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Wed, 27 Jan 2016 17:44:54 +0100 Subject: [PATCH 2/8] TextEditor: Show new zoom factor when resetting ...mainly to not show the old zoom factor anymore. Change-Id: I01c3050ff38b0b328774e6d05bcc2fe913ee4f56 Reviewed-by: Eike Ziller --- src/plugins/texteditor/texteditorsettings.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/plugins/texteditor/texteditorsettings.cpp b/src/plugins/texteditor/texteditorsettings.cpp index 689842add07..30ab4f13baa 100644 --- a/src/plugins/texteditor/texteditorsettings.cpp +++ b/src/plugins/texteditor/texteditorsettings.cpp @@ -509,6 +509,16 @@ Core::Id TextEditorSettings::languageId(const QString &mimeType) return d->m_mimeTypeToLanguage.value(mimeType); } +void showZoomIndicator(QWidget *editor, const int newZoom) +{ + if (editor) { + Utils::FadingIndicator::showText(editor, + QCoreApplication::translate("TextEditor::TextEditorSettings", + "Zoom: %1%").arg(newZoom), + Utils::FadingIndicator::SmallText); + } +} + void TextEditorSettings::fontZoomRequested(int zoom) { FontSettings &fs = const_cast(d->m_fontSettingsPage->fontSettings()); @@ -517,11 +527,7 @@ void TextEditorSettings::fontZoomRequested(int zoom) if (newZoom == previousZoom) return; fs.setFontZoom(newZoom); - if (QWidget *editor = qobject_cast(sender())) { - Utils::FadingIndicator::showText(editor, - tr("Zoom: %1%").arg(newZoom), - Utils::FadingIndicator::SmallText); - } + showZoomIndicator(qobject_cast(sender()), newZoom); d->m_fontSettingsPage->saveSettings(); } @@ -529,5 +535,6 @@ void TextEditorSettings::zoomResetRequested() { FontSettings &fs = const_cast(d->m_fontSettingsPage->fontSettings()); fs.setFontZoom(100); + showZoomIndicator(qobject_cast(sender()), 100); d->m_fontSettingsPage->saveSettings(); } From f64d7e6ad403f7223e0aa693f26ca2792895a780 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 27 Jan 2016 11:52:42 +0100 Subject: [PATCH 3/8] Add qmake-generated wrapper scripts to .gitignore Change-Id: Idb82c78436335db70bc6caf906b9aa1ea212c68b Reviewed-by: Oswald Buddenhagen --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index c1e0548149a..067d81b8729 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,10 @@ Thumbs.db *.embed.manifest /.qmake.cache /.qmake.stash +*_wrapper.sh +*_wrapper.bat +wrapper.sh +wrapper.bat # qtcreator generated files *.pro.user* From 6844d3f277e773441e78eb1d44c2b51b53507ece Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 29 Jan 2016 11:00:56 +0100 Subject: [PATCH 4/8] Find: Remove use of unsual QTextCursor constructors Change-Id: If3b86d49c5b87974f7d40fcfa75e4a303ba55c1a Reviewed-by: Eike Ziller (cherry picked from commit 1edd6193ba1bdf39c70e071bc267960b6387863e) --- src/plugins/coreplugin/find/basetextfind.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/plugins/coreplugin/find/basetextfind.cpp b/src/plugins/coreplugin/find/basetextfind.cpp index f331d6206a4..2c08e6cfd03 100644 --- a/src/plugins/coreplugin/find/basetextfind.cpp +++ b/src/plugins/coreplugin/find/basetextfind.cpp @@ -39,10 +39,6 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) -#include -#endif - namespace Core { struct BaseTextFindPrivate @@ -396,13 +392,10 @@ void BaseTextFind::defineFindScope() { QTextCursor cursor = textCursor(); if (cursor.hasSelection() && cursor.block() != cursor.document()->findBlock(cursor.anchor())) { -#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) - d->m_findScopeStart = QTextCursorPrivate::fromPosition(document()->docHandle(), qMax(0, cursor.selectionStart())); - d->m_findScopeEnd = QTextCursorPrivate::fromPosition(document()->docHandle(), cursor.selectionEnd()); -#else - d->m_findScopeStart = QTextCursor(document()->docHandle(), qMax(0, cursor.selectionStart())); - d->m_findScopeEnd = QTextCursor(document()->docHandle(), cursor.selectionEnd()); -#endif + d->m_findScopeStart = cursor; + d->m_findScopeStart.setPosition(qMax(0, cursor.selectionStart())); + d->m_findScopeEnd = cursor; + d->m_findScopeEnd.setPosition(cursor.selectionEnd()); d->m_findScopeVerticalBlockSelectionFirstColumn = -1; d->m_findScopeVerticalBlockSelectionLastColumn = -1; From 0fd3b3d60db73843c386c46ac060f9a8bff6bba1 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 29 Jan 2016 14:15:59 +0100 Subject: [PATCH 5/8] Core: Remove dependency on gui-private again Change-Id: Ia4a716e3cccb0accac9c1998a854824195c3583e Reviewed-by: Eike Ziller --- src/plugins/coreplugin/coreplugin.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index 91fdff08167..f7767d579e3 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -1,5 +1,5 @@ DEFINES += CORE_LIBRARY -QT += gui-private \ +QT += \ help \ network \ printsupport \ From a2342fa492207d45a2f99ae2b5ebcaf0e3ab91df Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Sat, 30 Jan 2016 17:00:00 +0100 Subject: [PATCH 6/8] MsvcToolChain: Detect Microsoft Visual C++ Build Tools. Check the standard installation location of the Microsoft Visual C C++ Build Tools introduced with MSVC2015 for the presence of the bat file and add the toolchains. Change-Id: Ia2b7770ed50c51132c88330ff1448900b0b06c1e Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/msvctoolchain.cpp | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index 16633ecc4e2..4709d3197f8 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -545,6 +545,45 @@ static ToolChain *findOrCreateToolChain(const QList &alreadyKnown, return tc; } +// Detect build tools introduced with MSVC2015 +static void detectCppBuildTools(QList *list) +{ + struct Entry { + const char *postFix; + const char *varsBatArg; + Abi::Architecture architecture; + Abi::BinaryFormat format; + unsigned char wordSize; + }; + + const Entry entries[] = { + {" (x86)", "x86", Abi::X86Architecture, Abi::PEFormat, 32}, + {" (x64)", "amd64", Abi::X86Architecture, Abi::PEFormat, 64}, + {" (x86_arm)", "x86_arm", Abi::ArmArchitecture, Abi::PEFormat, 32}, + {" (x64_arm)", "amd64_arm", Abi::ArmArchitecture, Abi::PEFormat, 64} + }; + +#ifdef Q_OS_WIN64 + const char programFilesC[] = "ProgramFiles(x86)"; +#else + const char programFilesC[] = "ProgramFiles"; +#endif + const QString name = QStringLiteral("Microsoft Visual C++ Build Tools"); + const QString vcVarsBat = QFile::decodeName(qgetenv(programFilesC)) + + QLatin1Char('/') + name + QStringLiteral("/vcbuildtools.bat"); + if (!QFileInfo(vcVarsBat).isFile()) + return; + const size_t count = sizeof(entries) / sizeof(entries[0]); + for (size_t i = 0; i < count; ++i) { + const Entry &e = entries[i]; + const Abi abi(e.architecture, Abi::WindowsOS, Abi::WindowsMsvc2015Flavor, + e.format, e.wordSize); + list->append(new MsvcToolChain(name + QLatin1String(e.postFix), abi, + vcVarsBat, QLatin1String(e.varsBatArg), + ToolChain::AutoDetection)); + } +} + QList MsvcToolChainFactory::autoDetect(const QList &alreadyKnown) { QList results; @@ -635,6 +674,8 @@ QList MsvcToolChainFactory::autoDetect(const QList &al } } + detectCppBuildTools(&results); + return results; } From 7114ee9149f825ba5f75236e61f3c0c0c540d340 Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Mon, 1 Feb 2016 12:01:36 +0100 Subject: [PATCH 7/8] Squish: Run tst_CSUP01 on clang code model, too Change-Id: Ic2424cc9d962feff06baadc23a5fdf121bf2a11d Reviewed-by: Christian Stenger --- tests/system/shared/suites_qtta.py | 9 ++- tests/system/suite_CSUP/tst_CSUP01/test.py | 89 ++++++++++++---------- 2 files changed, 55 insertions(+), 43 deletions(-) diff --git a/tests/system/shared/suites_qtta.py b/tests/system/shared/suites_qtta.py index 6a5e5ea6f9b..de3bbd4e5ce 100755 --- a/tests/system/shared/suites_qtta.py +++ b/tests/system/shared/suites_qtta.py @@ -64,12 +64,15 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True): return False # change autocomplete options to manual -def changeAutocompleteToManual(): +def changeAutocompleteToManual(toManual=True): invokeMenuItem("Tools", "Options...") mouseClick(waitForObjectItem(":Options_QListView", "Text Editor"), 5, 5, 0, Qt.LeftButton) clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Completion") - ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), False) - selectFromCombo(":Behavior.completionTrigger_QComboBox", "Manually") + ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), not toManual) + activateCompletion = "Always" + if toManual: + activateCompletion = "Manually" + selectFromCombo(":Behavior.completionTrigger_QComboBox", activateCompletion) verifyEnabled(":Options.OK_QPushButton") clickButton(waitForObject(":Options.OK_QPushButton")) diff --git a/tests/system/suite_CSUP/tst_CSUP01/test.py b/tests/system/suite_CSUP/tst_CSUP01/test.py index 137c958fd5a..209c0dc1597 100644 --- a/tests/system/suite_CSUP/tst_CSUP01/test.py +++ b/tests/system/suite_CSUP/tst_CSUP01/test.py @@ -48,57 +48,66 @@ def triggerCompletion(editorWidget): # entry of test def main(): - startApplication("qtcreator" + SettingsPath) + clangLoaded = startCreatorTryingClang() if not startedWithoutPluginError(): return # create qt quick application # Step 1: Open test .pro project. createNewQtQuickApplication(tempDir(), "SampleApp") + for useClang in set([False, clangLoaded]): + selectClangCodeModel(clangLoaded, useClang) + changeAutocompleteToManual(False) # Step 2: Open .cpp file in Edit mode. - if not openDocument("SampleApp.Sources.main\\.cpp"): - test.fatal("Could not open main.cpp") - invokeMenuItem("File", "Exit") - return - test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), - "Step 2: Verifying if: .cpp file is opened in Edit mode.") + if not openDocument("SampleApp.Sources.main\\.cpp"): + test.fatal("Could not open main.cpp") + invokeMenuItem("File", "Exit") + return + test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), + "Step 2: Verifying if: .cpp file is opened in Edit mode.") # Step 3: Insert text "re" to new line in Editor mode and press Ctrl+Space. - editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") - if not placeCursorToLine(editorWidget, "QGuiApplication app(argc, argv);"): - earlyExit("Did not find first line in function block.") - return - type(editorWidget, "") - type(editorWidget, "re") - triggerCompletion(editorWidget) - waitForObjectItem(":popupFrame_Proposal_QListView", "register") - doubleClickItem(":popupFrame_Proposal_QListView", "register", 5, 5, 0, Qt.LeftButton) - test.compare(str(lineUnderCursor(editorWidget)).strip(), "register", - "Step 3: Verifying if: The list of suggestions is opened. It is " - "possible to select one of the suggestions.") + editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") + if not placeCursorToLine(editorWidget, "QGuiApplication app(argc, argv);"): + earlyExit("Did not find first line in function block.") + return + type(editorWidget, "") + type(editorWidget, "re") + triggerCompletion(editorWidget) + waitForObjectItem(":popupFrame_Proposal_QListView", "realloc") + doubleClickItem(":popupFrame_Proposal_QListView", "realloc", 5, 5, 0, Qt.LeftButton) + test.compare(str(lineUnderCursor(editorWidget)).strip(), "realloc()", + "Step 3: Verifying if: The list of suggestions is opened. It is " + "possible to select one of the suggestions.") # Step 4: Insert text "voi" to new line and press Tab. - resetLine(editorWidget) - type(editorWidget, "voi") - waitForObjectItem(":popupFrame_Proposal_QListView", "void") - type(waitForObject(":popupFrame_Proposal_QListView"), "") - test.compare(str(lineUnderCursor(editorWidget)).strip(), "void", - "Step 4: Verifying if: Word 'void' is completed because only one option is available.") + resetLine(editorWidget) + type(editorWidget, "voi") + waitForObjectItem(":popupFrame_Proposal_QListView", "void") + type(waitForObject(":popupFrame_Proposal_QListView"), "") + test.compare(str(lineUnderCursor(editorWidget)).strip(), "void", + "Step 4: Verifying if: Word 'void' is completed because only one option is available.") # Step 5: From "Tools -> Options -> Text Editor -> Completion" select Activate completion Manually, # uncheck Autocomplete common prefix and press Apply and then Ok . Return to Edit mode. - test.log("Step 5: Change Code Completion settings") - changeAutocompleteToManual() + test.log("Step 5: Change Code Completion settings") + changeAutocompleteToManual() # Step 6: Insert text "ret" and press Ctrl+Space. - editorWidget = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") - resetLine(editorWidget) - type(editorWidget, "ret") - triggerCompletion(editorWidget) - try: - waitForObjectItem(":popupFrame_Proposal_QListView", "return") - except: - test.fail("Could not find proposal popup.") - type(editorWidget, "") - type(editorWidget, "") - test.compare(str(lineUnderCursor(editorWidget)).strip(), "ret", - "Step 6: Verifying if: Suggestion is displayed but text is not " - "completed automatically even there is only one suggestion.") + editorWidget = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") + resetLine(editorWidget) + type(editorWidget, "retu") + triggerCompletion(editorWidget) + try: + proposal = "return" + if useClang: + # clang adds a whitespace because the function needs to return a value + proposal += " " + waitForObjectItem(":popupFrame_Proposal_QListView", proposal) + except: + test.fail("Could not find proposal popup.") + type(editorWidget, "") + type(editorWidget, "") + test.compare(str(lineUnderCursor(editorWidget)).strip(), "retu", + "Step 6: Verifying if: Suggestion is displayed but text is not " + "completed automatically even there is only one suggestion.") + invokeMenuItem('File', 'Revert "main.cpp" to Saved') + clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton")) # exit qt creator invokeMenuItem("File", "Save All") invokeMenuItem("File", "Exit") From f38d29133956c4196fbfd66895f3a31fad5f9948 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 1 Feb 2016 09:56:12 +0100 Subject: [PATCH 8/8] ClangBackEnd: Use QCommandLineParser. Output a proper usage message instead of a cryptic "wrong argument count" when launching it from the shell for testing. Change-Id: Iedb6b1062c9d246a514aefb05220942e4a6341df Reviewed-by: Marco Bubke --- src/tools/clangbackend/clangbackendmain.cpp | 24 ++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/tools/clangbackend/clangbackendmain.cpp b/src/tools/clangbackend/clangbackendmain.cpp index 33a6c1660e5..95b4931361e 100644 --- a/src/tools/clangbackend/clangbackendmain.cpp +++ b/src/tools/clangbackend/clangbackendmain.cpp @@ -28,6 +28,7 @@ ** ****************************************************************************/ +#include #include #include @@ -35,6 +36,22 @@ #include #include +QString processArguments(QCoreApplication &application) +{ + QCommandLineParser parser; + parser.setApplicationDescription(QStringLiteral("Qt Creator Clang backend process.")); + parser.addHelpOption(); + parser.addVersionOption(); + parser.addPositionalArgument(QStringLiteral("connection"), QStringLiteral("Connection")); + + parser.process(application); + + if (parser.positionalArguments().isEmpty()) + parser.showHelp(1); + + return parser.positionalArguments().first(); +} + int main(int argc, char *argv[]) { QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false")); @@ -46,10 +63,7 @@ int main(int argc, char *argv[]) QCoreApplication application(argc, argv); - if (application.arguments().count() != 2) { - qWarning() << "wrong argument count"; - return 1; - } + const QString connection = processArguments(application); ClangBackEnd::Messages::registerMessages(); @@ -57,7 +71,7 @@ int main(int argc, char *argv[]) clang_enableStackTraces(); ClangBackEnd::ClangIpcServer clangIpcServer; - ClangBackEnd::ConnectionServer connectionServer(application.arguments()[1]); + ClangBackEnd::ConnectionServer connectionServer(connection); connectionServer.start(); connectionServer.setIpcServer(&clangIpcServer);