Commit 5952165c authored by Eike Ziller's avatar Eike Ziller
Browse files

Merge remote-tracking branch 'origin/3.6'

Change-Id: Ic4d3d94feaaa588c6244509bb3dd14c5cb646fe7
parents bb3b7307 f38d2913
......@@ -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*
......
......@@ -3752,40 +3752,6 @@ For example, &quot;Revision: 15&quot; will leave the branch at revision 15.</sou
<translation>Находится в %1</translation>
</message>
</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>
<name>ClangCodeModel::Internal::ModelManagerSupport</name>
<message>
......@@ -13230,10 +13196,6 @@ Do you want to retry?</source>
<source>Start Watching</source>
<translation>Начинать наблюдение</translation>
</message>
<message>
<source>Close</source>
<translation>Закрыть</translation>
</message>
<message>
<source>Kit: </source>
<translation>Комплект:</translation>
......@@ -24082,6 +24044,10 @@ Preselects a desktop Qt for building the application if available.</source>
<source>Qt Canvas 3D Application</source>
<translation>Приложение Qt Canvas 3D</translation>
</message>
<message>
<source>Qt 5.6</source>
<translation>Qt 5.6</translation>
</message>
<message>
<source>Qt 5.5</source>
<translation>Qt 5.5</translation>
......@@ -28819,10 +28785,6 @@ This is independent of the visibility property in QML.</source>
</context>
<context>
<name>QmlDesigner::QmlDesignerPlugin</name>
<message>
<source>Cannot create OpenGL context.</source>
<translation>Не удалось создать контекст OpenGL.</translation>
</message>
<message>
<source>Switch Text/Design</source>
<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>
<translation>Версия с основным номером отличным от 1 не поддерживается.</translation>
</message>
<message>
<source>Reading only version 1.1 parts.</source>
<translation>Чтение разделов версии 1.1.</translation>
</message>
<message>
<source>Expected document to contain a single object definition.</source>
<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>
<translation>В документе требуется наличие члена Module {}.</translation>
</message>
<message>
<source>Expected only Component and ModuleApi object definitions.</source>
<translation>Допустимы только определения объектов Component и ModuleApi.</translation>
</message>
<message>
<source>Expected only Property, Method, Signal and Enum object definitions, not &quot;%1&quot;.</source>
<translation>Допустимы только определения объектов Property, Method, Signal и Enum, а не «%1».</translation>
......@@ -30595,10 +30549,6 @@ references to elements in other files, loops, and so on.)</source>
</context>
<context>
<name>QmlProfiler::Internal::QmlProfilerPlugin</name>
<message>
<source>Cannot create OpenGL context.</source>
<translation>Не удалось создать контекст OpenGL.</translation>
</message>
<message>
<source>QML Profiler</source>
<translation>Профайлер QML</translation>
......@@ -31825,6 +31775,13 @@ cannot be found in the path.</source>
<translation>Журнал сборки помощника отладчика</translation>
</message>
</context>
<context>
<name>QtSupport::ProMessageHandler</name>
<message>
<source>[Inexact] </source>
<translation>[Примерно] </translation>
</message>
</context>
<context>
<name>QtSupport::QtKitInformation</name>
<message>
......@@ -38685,13 +38642,6 @@ should a repository require SSH-authentication (see documentation on SSH and the
<translation>Ошибка загрузки режима приветствия</translation>
</message>
</context>
<context>
<name>Welcome::Internal::WelcomePlugin</name>
<message>
<source>Cannot create OpenGL context.</source>
<translation>Не удалось создать контекст OpenGL.</translation>
</message>
</context>
<context>
<name>WidgetPluginManager</name>
<message>
DEFINES += CORE_LIBRARY
QT += gui-private \
QT += \
help \
network \
printsupport \
......
......@@ -540,6 +540,45 @@ static ToolChain *findOrCreateToolChain(const QList<ToolChain *> &alreadyKnown,
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 *> results;
......@@ -630,6 +669,8 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect(const QList<ToolChain *> &al
}
}
detectCppBuildTools(&results);
return results;
}
......
......@@ -5488,6 +5488,14 @@ void TextEditorWidget::wheelEvent(QWheelEvent *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)
{
d->clearVisibleFoldedBlock();
......@@ -5499,14 +5507,13 @@ void TextEditorWidget::zoomF(float delta)
step = -1;
const int newZoom = TextEditorSettings::instance()->increaseFontZoom(int(step));
Utils::FadingIndicator::showText(this,
tr("Zoom: %1%").arg(newZoom),
Utils::FadingIndicator::SmallText);
showZoomIndicator(this, newZoom);
}
void TextEditorWidget::zoomReset()
{
TextEditorSettings::instance()->resetFontZoom();
showZoomIndicator(this, 100);
}
TextEditorWidget::Link TextEditorWidget::findLinkAt(const QTextCursor &, bool, bool)
......
......@@ -23,6 +23,7 @@
**
****************************************************************************/
#include <QCommandLineParser>
#include <QCoreApplication>
#include <QLoggingCategory>
......@@ -30,6 +31,22 @@
#include <cmbmessages.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[])
{
QLoggingCategory::setFilterRules(QStringLiteral("*.debug=false"));
......@@ -41,10 +58,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();
......@@ -52,7 +66,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);
......
......@@ -59,12 +59,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"))
......
......@@ -43,57 +43,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, "<Return>")
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, "<Return>")
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"), "<Tab>")
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"), "<Tab>")
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, "<Right>")
type(editorWidget, "<Backspace>")
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, "<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
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment