Merge remote-tracking branch 'origin/3.6'

Change-Id: Ic4d3d94feaaa588c6244509bb3dd14c5cb646fe7
This commit is contained in:
Eike Ziller
2016-02-01 16:15:48 +01:00
8 changed files with 141 additions and 113 deletions

4
.gitignore vendored
View File

@@ -34,6 +34,10 @@ Thumbs.db
*.embed.manifest *.embed.manifest
/.qmake.cache /.qmake.cache
/.qmake.stash /.qmake.stash
*_wrapper.sh
*_wrapper.bat
wrapper.sh
wrapper.bat
# qtcreator generated files # qtcreator generated files
*.pro.user* *.pro.user*

View File

@@ -3752,40 +3752,6 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<translation>Находится в %1</translation> <translation>Находится в %1</translation>
</message> </message>
</context> </context>
<context>
<name>ClangCodeModel::Internal::ClangProjectSettingsPropertiesPage</name>
<message>
<source>Pre-compiled headers:</source>
<translation>Предкомпиляция:</translation>
</message>
<message>
<source>None</source>
<translation>Нет</translation>
</message>
<message>
<source>Build system (exact)</source>
<translation>Система сборки (точно)</translation>
</message>
<message>
<source>Build system (fuzzy)</source>
<translation>Система сборки (приближённо)</translation>
</message>
<message>
<source>Custom</source>
<translation>Особая</translation>
</message>
<message>
<source>Choose...</source>
<translation>Выбрать...</translation>
</message>
</context>
<context>
<name>ClangCodeModel::Internal::ClangProjectSettingsWidget</name>
<message>
<source>Clang Settings</source>
<translation>Настройки Clang</translation>
</message>
</context>
<context> <context>
<name>ClangCodeModel::Internal::ModelManagerSupport</name> <name>ClangCodeModel::Internal::ModelManagerSupport</name>
<message> <message>
@@ -13230,10 +13196,6 @@ Do you want to retry?</source>
<source>Start Watching</source> <source>Start Watching</source>
<translation>Начинать наблюдение</translation> <translation>Начинать наблюдение</translation>
</message> </message>
<message>
<source>Close</source>
<translation>Закрыть</translation>
</message>
<message> <message>
<source>Kit: </source> <source>Kit: </source>
<translation>Комплект:</translation> <translation>Комплект:</translation>
@@ -24082,6 +24044,10 @@ Preselects a desktop Qt for building the application if available.</source>
<source>Qt Canvas 3D Application</source> <source>Qt Canvas 3D Application</source>
<translation>Приложение Qt Canvas 3D</translation> <translation>Приложение Qt Canvas 3D</translation>
</message> </message>
<message>
<source>Qt 5.6</source>
<translation>Qt 5.6</translation>
</message>
<message> <message>
<source>Qt 5.5</source> <source>Qt 5.5</source>
<translation>Qt 5.5</translation> <translation>Qt 5.5</translation>
@@ -28819,10 +28785,6 @@ This is independent of the visibility property in QML.</source>
</context> </context>
<context> <context>
<name>QmlDesigner::QmlDesignerPlugin</name> <name>QmlDesigner::QmlDesignerPlugin</name>
<message>
<source>Cannot create OpenGL context.</source>
<translation>Не удалось создать контекст OpenGL.</translation>
</message>
<message> <message>
<source>Switch Text/Design</source> <source>Switch Text/Design</source>
<translation>Переключить текст/дизайн</translation> <translation>Переключить текст/дизайн</translation>
@@ -29784,10 +29746,6 @@ Please build the qmldump application on the Qt version options page.</source>
<source>Major version different from 1 not supported.</source> <source>Major version different from 1 not supported.</source>
<translation>Версия с основным номером отличным от 1 не поддерживается.</translation> <translation>Версия с основным номером отличным от 1 не поддерживается.</translation>
</message> </message>
<message>
<source>Reading only version 1.1 parts.</source>
<translation>Чтение разделов версии 1.1.</translation>
</message>
<message> <message>
<source>Expected document to contain a single object definition.</source> <source>Expected document to contain a single object definition.</source>
<translation>Требуется определение в документе ровно одного объекта.</translation> <translation>Требуется определение в документе ровно одного объекта.</translation>
@@ -29796,10 +29754,6 @@ Please build the qmldump application on the Qt version options page.</source>
<source>Expected document to contain a Module {} member.</source> <source>Expected document to contain a Module {} member.</source>
<translation>В документе требуется наличие члена Module {}.</translation> <translation>В документе требуется наличие члена Module {}.</translation>
</message> </message>
<message>
<source>Expected only Component and ModuleApi object definitions.</source>
<translation>Допустимы только определения объектов Component и ModuleApi.</translation>
</message>
<message> <message>
<source>Expected only Property, Method, Signal and Enum object definitions, not &quot;%1&quot;.</source> <source>Expected only Property, Method, Signal and Enum object definitions, not &quot;%1&quot;.</source>
<translation>Допустимы только определения объектов Property, Method, Signal и Enum, а не «%1».</translation> <translation>Допустимы только определения объектов Property, Method, Signal и Enum, а не «%1».</translation>
@@ -30595,10 +30549,6 @@ references to elements in other files, loops, and so on.)</source>
</context> </context>
<context> <context>
<name>QmlProfiler::Internal::QmlProfilerPlugin</name> <name>QmlProfiler::Internal::QmlProfilerPlugin</name>
<message>
<source>Cannot create OpenGL context.</source>
<translation>Не удалось создать контекст OpenGL.</translation>
</message>
<message> <message>
<source>QML Profiler</source> <source>QML Profiler</source>
<translation>Профайлер QML</translation> <translation>Профайлер QML</translation>
@@ -31825,6 +31775,13 @@ cannot be found in the path.</source>
<translation>Журнал сборки помощника отладчика</translation> <translation>Журнал сборки помощника отладчика</translation>
</message> </message>
</context> </context>
<context>
<name>QtSupport::ProMessageHandler</name>
<message>
<source>[Inexact] </source>
<translation>[Примерно] </translation>
</message>
</context>
<context> <context>
<name>QtSupport::QtKitInformation</name> <name>QtSupport::QtKitInformation</name>
<message> <message>
@@ -38685,13 +38642,6 @@ should a repository require SSH-authentication (see documentation on SSH and the
<translation>Ошибка загрузки режима приветствия</translation> <translation>Ошибка загрузки режима приветствия</translation>
</message> </message>
</context> </context>
<context>
<name>Welcome::Internal::WelcomePlugin</name>
<message>
<source>Cannot create OpenGL context.</source>
<translation>Не удалось создать контекст OpenGL.</translation>
</message>
</context>
<context> <context>
<name>WidgetPluginManager</name> <name>WidgetPluginManager</name>
<message> <message>

View File

@@ -1,5 +1,5 @@
DEFINES += CORE_LIBRARY DEFINES += CORE_LIBRARY
QT += gui-private \ QT += \
help \ help \
network \ network \
printsupport \ printsupport \

View File

@@ -540,6 +540,45 @@ static ToolChain *findOrCreateToolChain(const QList<ToolChain *> &alreadyKnown,
return tc; return tc;
} }
// Detect build tools introduced with MSVC2015
static void detectCppBuildTools(QList<ToolChain *> *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<ToolChain *> MsvcToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown) QList<ToolChain *> MsvcToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
{ {
QList<ToolChain *> results; QList<ToolChain *> results;
@@ -630,6 +669,8 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect(const QList<ToolChain *> &al
} }
} }
detectCppBuildTools(&results);
return results; return results;
} }

View File

@@ -5488,6 +5488,14 @@ void TextEditorWidget::wheelEvent(QWheelEvent *e)
QPlainTextEdit::wheelEvent(e); QPlainTextEdit::wheelEvent(e);
} }
static void showZoomIndicator(QWidget *editor, const int newZoom)
{
Utils::FadingIndicator::showText(editor,
QCoreApplication::translate("TextEditor::TextEditorWidget",
"Zoom: %1%").arg(newZoom),
Utils::FadingIndicator::SmallText);
}
void TextEditorWidget::zoomF(float delta) void TextEditorWidget::zoomF(float delta)
{ {
d->clearVisibleFoldedBlock(); d->clearVisibleFoldedBlock();
@@ -5499,14 +5507,13 @@ void TextEditorWidget::zoomF(float delta)
step = -1; step = -1;
const int newZoom = TextEditorSettings::instance()->increaseFontZoom(int(step)); const int newZoom = TextEditorSettings::instance()->increaseFontZoom(int(step));
Utils::FadingIndicator::showText(this, showZoomIndicator(this, newZoom);
tr("Zoom: %1%").arg(newZoom),
Utils::FadingIndicator::SmallText);
} }
void TextEditorWidget::zoomReset() void TextEditorWidget::zoomReset()
{ {
TextEditorSettings::instance()->resetFontZoom(); TextEditorSettings::instance()->resetFontZoom();
showZoomIndicator(this, 100);
} }
TextEditorWidget::Link TextEditorWidget::findLinkAt(const QTextCursor &, bool, bool) TextEditorWidget::Link TextEditorWidget::findLinkAt(const QTextCursor &, bool, bool)

View File

@@ -23,6 +23,7 @@
** **
****************************************************************************/ ****************************************************************************/
#include <QCommandLineParser>
#include <QCoreApplication> #include <QCoreApplication>
#include <QLoggingCategory> #include <QLoggingCategory>
@@ -30,6 +31,22 @@
#include <cmbmessages.h> #include <cmbmessages.h>
#include <clangipcserver.h> #include <clangipcserver.h>
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[]) int main(int argc, char *argv[])
{ {
QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false")); QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false"));
@@ -41,10 +58,7 @@ int main(int argc, char *argv[])
QCoreApplication application(argc, argv); QCoreApplication application(argc, argv);
if (application.arguments().count() != 2) { const QString connection = processArguments(application);
qWarning() << "wrong argument count";
return 1;
}
ClangBackEnd::Messages::registerMessages(); ClangBackEnd::Messages::registerMessages();
@@ -52,7 +66,7 @@ int main(int argc, char *argv[])
clang_enableStackTraces(); clang_enableStackTraces();
ClangBackEnd::ClangIpcServer clangIpcServer; ClangBackEnd::ClangIpcServer clangIpcServer;
ClangBackEnd::ConnectionServer connectionServer(application.arguments()[1]); ClangBackEnd::ConnectionServer connectionServer(connection);
connectionServer.start(); connectionServer.start();
connectionServer.setIpcServer(&clangIpcServer); connectionServer.setIpcServer(&clangIpcServer);

View File

@@ -59,12 +59,15 @@ def checkSyntaxError(issuesView, expectedTextsArray, warnIfMoreIssues = True):
return False return False
# change autocomplete options to manual # change autocomplete options to manual
def changeAutocompleteToManual(): def changeAutocompleteToManual(toManual=True):
invokeMenuItem("Tools", "Options...") invokeMenuItem("Tools", "Options...")
mouseClick(waitForObjectItem(":Options_QListView", "Text Editor"), 5, 5, 0, Qt.LeftButton) mouseClick(waitForObjectItem(":Options_QListView", "Text Editor"), 5, 5, 0, Qt.LeftButton)
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Completion") clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Completion")
ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), False) ensureChecked(waitForObject(":Behavior.Autocomplete common prefix_QCheckBox"), not toManual)
selectFromCombo(":Behavior.completionTrigger_QComboBox", "Manually") activateCompletion = "Always"
if toManual:
activateCompletion = "Manually"
selectFromCombo(":Behavior.completionTrigger_QComboBox", activateCompletion)
verifyEnabled(":Options.OK_QPushButton") verifyEnabled(":Options.OK_QPushButton")
clickButton(waitForObject(":Options.OK_QPushButton")) clickButton(waitForObject(":Options.OK_QPushButton"))

View File

@@ -43,57 +43,66 @@ def triggerCompletion(editorWidget):
# entry of test # entry of test
def main(): def main():
startApplication("qtcreator" + SettingsPath) clangLoaded = startCreatorTryingClang()
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
# create qt quick application # create qt quick application
# Step 1: Open test .pro project. # Step 1: Open test .pro project.
createNewQtQuickApplication(tempDir(), "SampleApp") createNewQtQuickApplication(tempDir(), "SampleApp")
for useClang in set([False, clangLoaded]):
selectClangCodeModel(clangLoaded, useClang)
changeAutocompleteToManual(False)
# Step 2: Open .cpp file in Edit mode. # Step 2: Open .cpp file in Edit mode.
if not openDocument("SampleApp.Sources.main\\.cpp"): if not openDocument("SampleApp.Sources.main\\.cpp"):
test.fatal("Could not open main.cpp") test.fatal("Could not open main.cpp")
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")
return return
test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"),
"Step 2: Verifying if: .cpp file is opened in Edit mode.") "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. # Step 3: Insert text "re" to new line in Editor mode and press Ctrl+Space.
editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
if not placeCursorToLine(editorWidget, "QGuiApplication app(argc, argv);"): if not placeCursorToLine(editorWidget, "QGuiApplication app(argc, argv);"):
earlyExit("Did not find first line in function block.") earlyExit("Did not find first line in function block.")
return return
type(editorWidget, "<Return>") type(editorWidget, "<Return>")
type(editorWidget, "re") type(editorWidget, "re")
triggerCompletion(editorWidget) triggerCompletion(editorWidget)
waitForObjectItem(":popupFrame_Proposal_QListView", "register") waitForObjectItem(":popupFrame_Proposal_QListView", "realloc")
doubleClickItem(":popupFrame_Proposal_QListView", "register", 5, 5, 0, Qt.LeftButton) doubleClickItem(":popupFrame_Proposal_QListView", "realloc", 5, 5, 0, Qt.LeftButton)
test.compare(str(lineUnderCursor(editorWidget)).strip(), "register", test.compare(str(lineUnderCursor(editorWidget)).strip(), "realloc()",
"Step 3: Verifying if: The list of suggestions is opened. It is " "Step 3: Verifying if: The list of suggestions is opened. It is "
"possible to select one of the suggestions.") "possible to select one of the suggestions.")
# Step 4: Insert text "voi" to new line and press Tab. # Step 4: Insert text "voi" to new line and press Tab.
resetLine(editorWidget) resetLine(editorWidget)
type(editorWidget, "voi") type(editorWidget, "voi")
waitForObjectItem(":popupFrame_Proposal_QListView", "void") waitForObjectItem(":popupFrame_Proposal_QListView", "void")
type(waitForObject(":popupFrame_Proposal_QListView"), "<Tab>") type(waitForObject(":popupFrame_Proposal_QListView"), "<Tab>")
test.compare(str(lineUnderCursor(editorWidget)).strip(), "void", test.compare(str(lineUnderCursor(editorWidget)).strip(), "void",
"Step 4: Verifying if: Word 'void' is completed because only one option is available.") "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, # 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. # uncheck Autocomplete common prefix and press Apply and then Ok . Return to Edit mode.
test.log("Step 5: Change Code Completion settings") test.log("Step 5: Change Code Completion settings")
changeAutocompleteToManual() changeAutocompleteToManual()
# Step 6: Insert text "ret" and press Ctrl+Space. # Step 6: Insert text "ret" and press Ctrl+Space.
editorWidget = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") editorWidget = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
resetLine(editorWidget) resetLine(editorWidget)
type(editorWidget, "ret") type(editorWidget, "retu")
triggerCompletion(editorWidget) triggerCompletion(editorWidget)
try: try:
waitForObjectItem(":popupFrame_Proposal_QListView", "return") proposal = "return"
except: if useClang:
test.fail("Could not find proposal popup.") # clang adds a whitespace because the function needs to return a value
type(editorWidget, "<Right>") proposal += " "
type(editorWidget, "<Backspace>") waitForObjectItem(":popupFrame_Proposal_QListView", proposal)
test.compare(str(lineUnderCursor(editorWidget)).strip(), "ret", except:
"Step 6: Verifying if: Suggestion is displayed but text is not " test.fail("Could not find proposal popup.")
"completed automatically even there is only one suggestion.") type(editorWidget, "<Right>")
type(editorWidget, "<Backspace>")
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 # exit qt creator
invokeMenuItem("File", "Save All") invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit") invokeMenuItem("File", "Exit")