Merge remote-tracking branch 'origin/3.1'

This commit is contained in:
Eike Ziller
2014-05-28 11:03:18 +02:00
26 changed files with 13755 additions and 5291 deletions

View File

@@ -7,23 +7,23 @@ imagedirs = $SRCDIR/images $SRCDIR/templates/images
outputdir = $OUTDIR
exampledirs = $SRCDIR/examples \
$SRCDIR/snippets
indexes += $QT_INSTALL_DOCS/qtwidgets/qtwidgets.index \
$QT_INSTALL_DOCS/qtcore/qtcore.index \
$QT_INSTALL_DOCS/qtqml/qtqml.index \
$QT_INSTALL_DOCS/qtquick/qtquick.index \
$QT_INSTALL_DOCS/qmake/qmake.index \
$QT_INSTALL_DOCS/qtdesigner/qtdesigner.index \
$QT_INSTALL_DOCS/qtdoc/qtdoc.index \
$QT_INSTALL_DOCS/qtgui/qtgui.index \
$QT_INSTALL_DOCS/qthelp/qthelp.index \
$QT_INSTALL_DOCS/qtquickcontrols/qtquickcontrols.index \
$QT_INSTALL_DOCS/qtquicklayouts/qtquicklayouts.index \
$QT_INSTALL_DOCS/qtlinguist/qtlinguist.index \
$QT_INSTALL_DOCS/qtscript/qtscript.index \
$QT_INSTALL_DOCS/qtsensors/qtsensors.index \
$QT_INSTALL_DOCS/qtuitools/qtuitools.index \
$QT_INSTALL_DOCS/qtwebkit/qtwebkit.index \
$QT_INSTALL_DOCS/qtxml/qtxml.index
indexes += $QDOC_INDEX_DIR/qtwidgets/qtwidgets.index \
$QDOC_INDEX_DIR/qtcore/qtcore.index \
$QDOC_INDEX_DIR/qtqml/qtqml.index \
$QDOC_INDEX_DIR/qtquick/qtquick.index \
$QDOC_INDEX_DIR/qmake/qmake.index \
$QDOC_INDEX_DIR/qtdesigner/qtdesigner.index \
$QDOC_INDEX_DIR/qtdoc/qtdoc.index \
$QDOC_INDEX_DIR/qtgui/qtgui.index \
$QDOC_INDEX_DIR/qthelp/qthelp.index \
$QDOC_INDEX_DIR/qtquickcontrols/qtquickcontrols.index \
$QDOC_INDEX_DIR/qtquicklayouts/qtquicklayouts.index \
$QDOC_INDEX_DIR/qtlinguist/qtlinguist.index \
$QDOC_INDEX_DIR/qtscript/qtscript.index \
$QDOC_INDEX_DIR/qtsensors/qtsensors.index \
$QDOC_INDEX_DIR/qtuitools/qtuitools.index \
$QDOC_INDEX_DIR/qtwebkit/qtwebkit.index \
$QDOC_INDEX_DIR/qtxml/qtxml.index
include(macros.qdocconf)
include(qt-cpp-ignore.qdocconf)

View File

@@ -1,10 +1,12 @@
greaterThan(QT_MAJOR_VERSION, 4) {
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
QDOC_GLOBAL = QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS/src] QDOC_INDEX_DIR=$$[QT_INSTALL_DOCS]
COMPAT =
} else {
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator)
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc3)
QDOC_GLOBAL = QDOC_INDEX_DIR=dummy # this will be ignored. we don't link qt4 docs any more.
COMPAT = -qt4
}
@@ -23,7 +25,7 @@ defineReplace(cmdEnv) {
}
defineReplace(qdoc) {
return("$$cmdEnv(SRCDIR=$$PWD OUTDIR=$$1 QTC_VERSION=$$QTCREATOR_VERSION QTC_VERSION_TAG=$$VERSION_TAG QTC_LICENSE_TYPE=$$LICENSE_TYPE QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS]) $$QDOC_BIN")
return("$$cmdEnv(SRCDIR=$$PWD OUTDIR=$$1 QTC_VERSION=$$QTCREATOR_VERSION QTC_VERSION_TAG=$$VERSION_TAG QTC_LICENSE_TYPE=$$LICENSE_TYPE $$QDOC_GLOBAL) $$QDOC_BIN")
}
QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp

File diff suppressed because it is too large Load Diff

View File

@@ -123,7 +123,8 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
// Save text to temporary file
QFileInfo fi(fileName);
Utils::TempFileSaver sourceFile(QLatin1String("qtc_beautifier_XXXXXXXX.") + fi.suffix());
Utils::TempFileSaver sourceFile(fi.absolutePath() + QLatin1String("/qtc_beautifier_XXXXXXXX.")
+ fi.suffix());
sourceFile.setAutoRemove(true);
sourceFile.write(text.toUtf8());
if (!sourceFile.finalize()) {

View File

@@ -108,6 +108,7 @@ GerritOptionsWidget::GerritOptionsWidget(QWidget *parent)
"Determines the protocol used to form a URL in case\n"
"\"canonicalWebUrl\" is not configured in the file\n"
"\"gerrit.config\"."));
setTabOrder(m_sshChooser, m_portSpinBox);
}
GerritParameters GerritOptionsWidget::parameters() const

View File

@@ -258,6 +258,19 @@ void BlackBerryConfigurationManager::emitSettingsChanged()
emit settingsChanged();
}
#ifdef WITH_TESTS
void BlackBerryConfigurationManager::initUnitTest()
{
foreach (BlackBerryApiLevelConfiguration *apiLevel, m_apiLevels)
removeApiLevel(apiLevel);
foreach (BlackBerryRuntimeConfiguration *runtime, m_runtimes)
removeRuntime(runtime);
m_defaultConfiguration = 0;
}
#endif
void BlackBerryConfigurationManager::setKitsAutoDetectionSource()
{
foreach (Kit *kit, KitManager::kits()) {

View File

@@ -87,6 +87,10 @@ public:
void emitSettingsChanged();
#ifdef WITH_TESTS
void initUnitTest();
#endif
public slots:
void loadSettings();
void saveSettings();

View File

@@ -488,6 +488,7 @@ void QnxPlugin::testConfigurationManager_data()
void QnxPlugin::testConfigurationManager()
{
BlackBerryConfigurationManager *manager = BlackBerryConfigurationManager::instance();
manager->initUnitTest();
QCOMPARE(manager->apiLevels().count(), 0);
QCOMPARE(manager->activeApiLevels().count(), 0);

View File

@@ -721,6 +721,7 @@ QString BaseQtVersion::findQtBinary(Binaries binary) const
else
possibleCommands << QLatin1String("qmlscene");
}
break;
case QmlViewer: {
if (HostOsInfo::isWindowsHost())
possibleCommands << QLatin1String("qmlviewer.exe");

View File

@@ -67,10 +67,12 @@ QString DesktopQtVersion::type() const
QStringList DesktopQtVersion::warningReason() const
{
QStringList ret = BaseQtVersion::warningReason();
if (qtVersion() >= QtVersionNumber(5, 0, 0) && qmlsceneCommand().isEmpty())
if (qtVersion() >= QtVersionNumber(5, 0, 0)) {
if (qmlsceneCommand().isEmpty())
ret << QCoreApplication::translate("QtVersion", "No qmlscene installed.");
if (qtVersion() >= QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
} else if (qtVersion() >= QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty()) {
ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
}
return ret;
}

View File

@@ -18,7 +18,7 @@ Fourth - you'll have to provide some additional repositories (and for the hookin
These additional repositories are located inside ~/QtSDK/src or C:\QtSDK\src (depending on the OS you're on).
You can also just provide them inside a different folder and specify the folder with the environment variable SYSTEST_SRCPATH.
This folder must contain the following:
* a QtCreator repository (or source copy) of tag v2.5.0 named 'creator'
* a QtCreator repository (or source copy) of tag v3.1.0 named 'creator' including the submodule src/shared/qbs
* a subfolder called 'creator-test-data'
* a speedcrunch 0.11 repository (or source copy) inside 'creator-test-data' named 'speedcrunch'
* additional Squish versions for hooking into subprocesses inside different folders inside 'creator-test-data' following the information below

View File

@@ -81,7 +81,10 @@
:Form.Startup_QGroupBox {container=':qt_tabwidget_stackedwidget.Form_QWidget' name='startupGroupBox' title='Startup' type='QGroupBox' visible='1'}
:FormEditorStack.CheckBox_QCheckBox {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='checkBox' text='CheckBox' type='QCheckBox' visible='1'}
:FormEditorStack.PushButton_QPushButton {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='pushButton' text='PushButton' type='QPushButton' visible='1'}
:FormEditorStack.__qt__passive_editor_QLineEdit {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='__qt__passive_editor' type='QLineEdit' visible='1'}
:FormEditorStack.centralWidget_QDesignerWidget {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='centralWidget' type='QDesignerWidget' visible='1'}
:FormEditorStack.comboBox_QComboBox {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='comboBox' type='QComboBox' visible='1'}
:FormEditorStack.menuBar_QDesignerMenuBar {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' name='menuBar' type='QDesignerMenuBar' visible='1'}
:FormEditorStack_qdesigner_internal::FormWindow {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' type='qdesigner_internal::FormWindow' unnamed='1' visible='1'}
:FormEditorStack_qdesigner_internal::PropertyLineEdit {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' type='qdesigner_internal::PropertyLineEdit' unnamed='1' visible='1'}
:Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'}

View File

@@ -43,8 +43,9 @@ def checkLastBuild(expectedToFail=False, createTasksFileOnError=True):
ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton")
model = waitForObject(":Qt Creator.Issues_QListView").model()
buildIssues = dumpBuildIssues(model)
errors = len(filter(lambda i: i[5] == "1", buildIssues))
warnings = len(filter(lambda i: i[5] == "2", buildIssues))
types = map(lambda i: i[5], buildIssues)
errors = types.count("1")
warnings = types.count("2")
gotErrors = errors != 0
if not (gotErrors ^ expectedToFail):
test.passes("Errors: %s | Warnings: %s" % (errors, warnings))

View File

@@ -406,7 +406,7 @@ def replaceLine(fileSpec, oldLine, newLine):
if openDocumentPlaceCursor(fileSpec, oldLine) == None:
return False
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
for i in range(len(oldLine)):
for _ in oldLine:
type(editor, "<Backspace>")
type(editor, newLine)
return True

View File

@@ -105,6 +105,7 @@ def main():
editor = getEditorForFileSuffix("%s.h" % className.lower())
oldContent = str(editor.plainText)
placeCursorToLine(editor, "class %s.*" % className, True)
snooze(1) # avoid timing issue with the parser
invokeContextMenuItem(editor, "Refactor", "Insert Virtual Functions of Base Classes")
handleInsertVirtualFunctions(["keys() const = 0 : QStringList",
"create(const QString &, const QString &) = 0 : QObject *"])

View File

@@ -79,7 +79,7 @@ class Tree:
def countChildOccurrences(self, name):
if not self.__children__:
return 0
return len(filter(lambda x: x.getName() == name, self.__children__))
return map(lambda x: x.getName(), self.__children__).count(name)
# internal functions
def __repr__(self):

View File

@@ -1,9 +1,9 @@
"filename"
"creator/README"
"creator/qtcreator.pri"
"creator/doc/snippets/qml/list-of-transitions.qml"
"creator/tests/manual/qml/testfiles_quick2/views.qml"
"creator/share/qtcreator/glsl/glsl_120.frag"
"creator/tests/manual/cplusplus-frontend/conf.c++"
"creator/tests/system/suite_editors/shared/testdata/main.c++"
"creator/src/plugins/coreplugin/basefilewizard.cpp"
"creator/src/plugins/coreplugin/basefilewizard.h"
"creator/tests/system/suite_debugger/tst_simple_debug/test.py"
1 filename
2 creator/README
3 creator/qtcreator.pri
4 creator/doc/snippets/qml/list-of-transitions.qml creator/tests/manual/qml/testfiles_quick2/views.qml
5 creator/share/qtcreator/glsl/glsl_120.frag
6 creator/tests/manual/cplusplus-frontend/conf.c++ creator/tests/system/suite_editors/shared/testdata/main.c++
7 creator/src/plugins/coreplugin/basefilewizard.cpp
8 creator/src/plugins/coreplugin/basefilewizard.h
9 creator/tests/system/suite_debugger/tst_simple_debug/test.py

View File

@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAP=../objects.map
TEST_CASES=tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard tst_default_settings tst_installed_languages tst_openqt_creator tst_rename_file tst_save_before_build tst_session_handling
TEST_CASES=tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard tst_default_settings tst_installed_languages tst_openqt_creator tst_rename_file tst_save_before_build tst_session_handling tst_tasks_handling
VERSION=2
WRAPPERS=Qt

View File

@@ -48,6 +48,8 @@ def main():
invokeMenuItem("File", "Exit")
return
progressBarWait(30000)
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
compareProjectTree(naviTreeView % "speedcrunch( \[\S+\])?", "projecttree_speedcrunch.tsv")
# Invoke a rebuild of the application
invokeMenuItem("Build", "Rebuild All")

View File

@@ -0,0 +1,99 @@
"text" "nestinglevel"
"cmake_uninstall.cmake.in" "0"
"CMakeLists.txt" "0"
"SourceFiles.cmake" "0"
"core" "0"
"book.cpp" "1"
"book.h" "1"
"constants.cpp" "1"
"constants.h" "1"
"evaluator.cpp" "1"
"evaluator.h" "1"
"functions.cpp" "1"
"functions.h" "1"
"numberformatter.cpp" "1"
"numberformatter.h" "1"
"settings.cpp" "1"
"settings.h" "1"
"gui" "0"
"aboutbox.cpp" "1"
"aboutbox.h" "1"
"application.cpp" "1"
"application.h" "1"
"autohidelabel.cpp" "1"
"autohidelabel.h" "1"
"bookdock.cpp" "1"
"bookdock.h" "1"
"constantsdock.cpp" "1"
"constantsdock.h" "1"
"constantswidget.cpp" "1"
"constantswidget.h" "1"
"editor.cpp" "1"
"editor.h" "1"
"functionsdock.cpp" "1"
"functionsdock.h" "1"
"functionswidget.cpp" "1"
"functionswidget.h" "1"
"historydock.cpp" "1"
"historydock.h" "1"
"historywidget.cpp" "1"
"historywidget.h" "1"
"mainwindow.cpp" "1"
"mainwindow.h" "1"
"resultdisplay.cpp" "1"
"resultdisplay.h" "1"
"syntaxhighlighter.cpp" "1"
"syntaxhighlighter.h" "1"
"tipwidget.cpp" "1"
"tipwidget.h" "1"
"variablelistwidget.cpp" "1"
"variablelistwidget.h" "1"
"variablesdock.cpp" "1"
"variablesdock.h" "1"
"math" "0"
"floatcommon.c" "1"
"floatcommon.h" "1"
"floatconst.c" "1"
"floatconst.h" "1"
"floatconvert.c" "1"
"floatconvert.h" "1"
"floaterf.c" "1"
"floaterf.h" "1"
"floatexp.c" "1"
"floatexp.h" "1"
"floatgamma.c" "1"
"floatgamma.h" "1"
"floathmath.c" "1"
"floathmath.h" "1"
"floatio.c" "1"
"floatio.h" "1"
"floatipower.c" "1"
"floatipower.h" "1"
"floatlog.c" "1"
"floatlog.h" "1"
"floatlogic.c" "1"
"floatlogic.h" "1"
"floatlong.c" "1"
"floatlong.h" "1"
"floatnum.c" "1"
"floatnum.h" "1"
"floatpower.c" "1"
"floatpower.h" "1"
"floatseries.c" "1"
"floatseries.h" "1"
"floattrig.c" "1"
"floattrig.h" "1"
"hmath.cpp" "1"
"hmath.h" "1"
"number.c" "1"
"number.h" "1"
"resources" "0"
"speedcrunch.qrc" "1"
"tests" "0"
"testevaluator.cpp" "1"
"testfloatnum.c" "1"
"testhmath.cpp" "1"
"thirdparty" "0"
"binreloc.c" "1"
"binreloc.h" "1"
"main.cpp" "0"
1 text nestinglevel
2 cmake_uninstall.cmake.in 0
3 CMakeLists.txt 0
4 SourceFiles.cmake 0
5 core 0
6 book.cpp 1
7 book.h 1
8 constants.cpp 1
9 constants.h 1
10 evaluator.cpp 1
11 evaluator.h 1
12 functions.cpp 1
13 functions.h 1
14 numberformatter.cpp 1
15 numberformatter.h 1
16 settings.cpp 1
17 settings.h 1
18 gui 0
19 aboutbox.cpp 1
20 aboutbox.h 1
21 application.cpp 1
22 application.h 1
23 autohidelabel.cpp 1
24 autohidelabel.h 1
25 bookdock.cpp 1
26 bookdock.h 1
27 constantsdock.cpp 1
28 constantsdock.h 1
29 constantswidget.cpp 1
30 constantswidget.h 1
31 editor.cpp 1
32 editor.h 1
33 functionsdock.cpp 1
34 functionsdock.h 1
35 functionswidget.cpp 1
36 functionswidget.h 1
37 historydock.cpp 1
38 historydock.h 1
39 historywidget.cpp 1
40 historywidget.h 1
41 mainwindow.cpp 1
42 mainwindow.h 1
43 resultdisplay.cpp 1
44 resultdisplay.h 1
45 syntaxhighlighter.cpp 1
46 syntaxhighlighter.h 1
47 tipwidget.cpp 1
48 tipwidget.h 1
49 variablelistwidget.cpp 1
50 variablelistwidget.h 1
51 variablesdock.cpp 1
52 variablesdock.h 1
53 math 0
54 floatcommon.c 1
55 floatcommon.h 1
56 floatconst.c 1
57 floatconst.h 1
58 floatconvert.c 1
59 floatconvert.h 1
60 floaterf.c 1
61 floaterf.h 1
62 floatexp.c 1
63 floatexp.h 1
64 floatgamma.c 1
65 floatgamma.h 1
66 floathmath.c 1
67 floathmath.h 1
68 floatio.c 1
69 floatio.h 1
70 floatipower.c 1
71 floatipower.h 1
72 floatlog.c 1
73 floatlog.h 1
74 floatlogic.c 1
75 floatlogic.h 1
76 floatlong.c 1
77 floatlong.h 1
78 floatnum.c 1
79 floatnum.h 1
80 floatpower.c 1
81 floatpower.h 1
82 floatseries.c 1
83 floatseries.h 1
84 floattrig.c 1
85 floattrig.h 1
86 hmath.cpp 1
87 hmath.h 1
88 number.c 1
89 number.h 1
90 resources 0
91 speedcrunch.qrc 1
92 tests 0
93 testevaluator.cpp 1
94 testfloatnum.c 1
95 testhmath.cpp 1
96 thirdparty 0
97 binreloc.c 1
98 binreloc.h 1
99 main.cpp 0

View File

@@ -47,8 +47,8 @@ def main():
progressBarWait(300000)
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
compareProjectTree(naviTreeView % "speedcrunch( \(\S+\))?", "projecttree_speedcrunch.tsv")
compareProjectTree(naviTreeView % "qtcreator( \(\S+\))?", "projecttree_creator.tsv")
compareProjectTree(naviTreeView % "speedcrunch( \[\S+\])?", "projecttree_speedcrunch.tsv")
compareProjectTree(naviTreeView % "qtcreator( \[\S+\])?", "projecttree_creator.tsv")
# Now check some basic lookups in the search box
selectFromLocator(": Qlist::QList", "QList::QList")

File diff suppressed because it is too large Load Diff

View File

@@ -53,23 +53,25 @@ def main():
if isQt4Build and platform.system() == 'Darwin':
# avoid QTCREATORBUG-9197
filtered = [filenames[0]]
for i in range(1, len(filenames)):
if filenames[i].lower() != filtered[-1].lower():
filtered.append(filenames[i])
for filename in filenames[1:]:
if filename.lower() != filtered[-1].lower():
filtered.append(filename)
filenames = filtered
for i in range(len(filenames)):
previous = filenames[-1]
for filename in filenames:
tempFiletype = filetype
if filetype == "QML" and filenames[i - 1][-4:] != ".qml":
if filetype == "QML" and previous[-4:] != ".qml":
tempFiletype = "Other files"
# following is necessary due to QTCREATORBUG-10179
# will be fixed when Qt5's MIME type database can be used
if ((filenames[-1] in ("main.cpp", "utility.cpp") and filenames[i - 1][-4:] != ".cpp")
or (filenames[-1] == "utility.h" and filenames[i - 1][-2:].lower() != ".h")
or (filetype == "Resources" and filenames[i - 1][-4:] != ".qrc")):
if ((filenames[-1] in ("main.cpp", "utility.cpp") and previous[-4:] != ".cpp")
or (filenames[-1] == "utility.h" and previous[-2:].lower() != ".h")
or (filetype == "Resources" and previous[-4:] != ".qrc")):
tempFiletype = "Other files"
# end of handling QTCREATORBUG-10179
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
filenames[i - 1], filenames[i])
previous, filename)
previous = filename
invokeMenuItem("File", "Exit")
def renameFile(projectDir, proFile, branch, oldname, newname):

View File

@@ -0,0 +1,155 @@
#############################################################################
##
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Digia. For licensing terms and
## conditions see http://qt.digia.com/licensing. For further information
## use the contact form at http://qt.digia.com/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
## In addition, as a special exception, Digia gives you certain additional
## rights. These rights are described in the Digia Qt LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
#############################################################################
import random
import string
source("../../shared/qtcreator.py")
toolButton = ("{toolTip='%s' type='QToolButton' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}")
def generateRandomFilePath(isWin, isHeader):
# generate random (fake) file path
filePath = ''.join(random.choice(string.ascii_letters + string.digits + "/")
for _ in range(random.randint(3, 15)))
if not filePath.startswith("/"):
filePath = "/" + filePath
if isWin:
filePath = "C:" + filePath
if isHeader:
filePath += ".h"
else:
filePath += ".cpp"
return filePath
def generateRandomTaskType():
ranType = random.randint(1, 100)
if ranType <= 45:
return 0
if ranType <= 90:
return 1
return 2
def generateMockTasksFile():
descriptions = ["", "dummy information", "unknown error", "not found", "syntax error",
"missing information", "unused"]
tasks = ["warn", "error", "other"]
isWin = platform.system() in ('Microsoft', 'Windows')
fileName = os.path.join(tempDir(), "dummy_taskfile.tasks")
tFile = open(fileName, "w")
tasksCount = [0, 0, 0]
for counter in range(1100):
fData = generateRandomFilePath(isWin, counter % 2 == 0)
lData = random.randint(-1, 10000)
tasksType = generateRandomTaskType()
tasksCount[tasksType] += 1
tData = tasks[tasksType]
dData = descriptions[random.randint(0, 6)]
tFile.write("%s\t%d\t%s\t%s\n" % (fData, lData, tData, dData))
tFile.close()
test.log("Wrote tasks file with %d warnings, %d errors and %d other tasks." % tuple(tasksCount))
return fileName, tasksCount
def checkOrUncheckMyTasks():
filterButton = waitForObject(toolButton % 'Filter by categories')
clickButton(filterButton)
if platform.system() == 'Darwin':
waitFor("macHackActivateContextMenuItem('My Tasks')", 5000)
else:
activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}",
"My Tasks"))
def getBuildIssuesTypeCounts(model):
issueTypes = map(lambda x: x.data(Qt.UserRole + 5).toInt(), dumpIndices(model))
result = [issueTypes.count(0), issueTypes.count(1), issueTypes.count(2)]
if len(issueTypes) != sum(result):
test.fatal("Found unexpected value(s) for TaskType...")
return result
def main():
tasksFile, issueTypes = generateMockTasksFile()
issuesLabel = ("{text='%d' type='QLabel' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}" % (sum(issueTypes)))
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
invokeMenuItem("File", "Open File or Project...")
selectFromFileDialog(tasksFile)
starttime = datetime.utcnow()
waitFor("object.exists(issuesLabel)", 10000)
endtime = datetime.utcnow()
differenceMS = (endtime - starttime).microseconds + (endtime - starttime).seconds * 1000000
test.verify(differenceMS < 2000000, "Verifying whether loading the tasks "
"file took less than 2s. (%dµs)" % differenceMS)
ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton")
model = waitForObject(":Qt Creator.Issues_QListView").model()
others, errors, warnings = getBuildIssuesTypeCounts(model)
test.compare(issueTypes, [warnings, errors, others],
"Verifying whether all expected errors, warnings and other tasks are listed.")
# check filtering by 'Show Warnings'
warnButton = waitForObject(toolButton % 'Show Warnings')
ensureChecked(warnButton, False)
waitFor("model.rowCount() == issueTypes[1]", 2000)
test.compare(model.rowCount(), issueTypes[1], "Verifying only errors are listed.")
ensureChecked(warnButton, True)
waitFor("model.rowCount() == sum(issueTypes)", 2000)
test.compare(model.rowCount(), sum(issueTypes), "Verifying all tasks are listed.")
# check filtering by 'My Tasks'
checkOrUncheckMyTasks()
waitFor("model.rowCount() == 0", 2000)
test.compare(model.rowCount(), 0,
"Verifying whether unchecking 'My Tasks' hides all tasks from tasks file.")
checkOrUncheckMyTasks()
waitFor("model.rowCount() == sum(issueTypes)", 2000)
test.compare(model.rowCount(), sum(issueTypes),
"Verifying whether checking 'My Tasks' displays all tasks from tasks file.")
# check filtering by 'My Tasks' and 'Show Warnings'
ensureChecked(warnButton, False)
waitFor("model.rowCount() == issueTypes[1]", 2000)
checkOrUncheckMyTasks()
waitFor("model.rowCount() == 0", 2000)
test.compare(model.rowCount(), 0,
"Verifying whether unchecking 'My Tasks' with disabled 'Show Warnings' hides all.")
ensureChecked(warnButton, True)
waitFor("model.rowCount() != 0", 2000)
test.compare(model.rowCount(), 0,
"Verifying whether enabling 'Show Warnings' still displays nothing.")
checkOrUncheckMyTasks()
waitFor("model.rowCount() == sum(issueTypes)", 2000)
test.compare(model.rowCount(), sum(issueTypes),
"Verifying whether checking 'My Tasks' displays all again.")
ensureChecked(warnButton, False)
waitFor("model.rowCount() == issueTypes[1]", 2000)
test.compare(model.rowCount(), issueTypes[1], "Verifying whether 'My Tasks' with disabled "
"'Show Warnings' displays only error tasks.")
invokeMenuItem("File", "Exit")

View File

@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAP=../objects.map
TEST_CASES=tst_codepasting tst_designer_autocomplete tst_designer_goto_slot tst_external_sort tst_git_clone tst_git_local
TEST_CASES=tst_codepasting tst_designer_autocomplete tst_designer_edit tst_designer_goto_slot tst_external_sort tst_git_clone tst_git_local
VERSION=2
WRAPPERS=Qt

View File

@@ -0,0 +1,191 @@
#############################################################################
##
## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Digia. For licensing terms and
## conditions see http://qt.digia.com/licensing. For further information
## use the contact form at http://qt.digia.com/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. Please review the following information to
## ensure the GNU Lesser General Public License version 2.1 requirements
## will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
##
## In addition, as a special exception, Digia gives you certain additional
## rights. These rights are described in the Digia Qt LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
#############################################################################
source("../../shared/qtcreator.py")
def performEditMenu():
test.log("Editing menu")
previewMenuBar = waitForObject(":FormEditorStack.menuBar_QDesignerMenuBar")
# add File menu
doubleClick(previewMenuBar, 30, 7, 0, Qt.LeftButton)
passiveLineEdit = waitForObject(":FormEditorStack.__qt__passive_editor_QLineEdit")
replaceEditorContent(passiveLineEdit, "SquishTestFile")
type(passiveLineEdit, "<Return>")
menu = waitForObject("{name='menuSquishTestFile' title='SquishTestFile' type='QDesignerMenu' "
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}")
menuHeight = menu.height
itemHeight = menuHeight / 2 # actually only 'Type Here' and 'Add Separator' are shown
itemHalf = itemHeight / 2
# add Open menu item
doubleClick(menu, 15, itemHalf, 0, Qt.LeftButton)
passiveLineEdit = waitForObject(":FormEditorStack.__qt__passive_editor_QLineEdit")
replaceEditorContent(passiveLineEdit, "Open")
type(passiveLineEdit, "<Return>")
waitFor("menu.height > menuHeight", 2000)
menuHeight = menu.height
# add a separator
doubleClick(menu, 15, menu.height - itemHalf, 0, Qt.LeftButton)
waitFor("menu.height > menuHeight", 2000)
separatorHeight = menu.height - menuHeight
menuHeight = menu.height
# add Shutdown menu item (Quit/Exit do not work because Squish/Qt5 problems with menus)
doubleClick(menu, 30, itemHeight + separatorHeight + itemHalf, 0, Qt.LeftButton)
passiveLineEdit = waitForObject(":FormEditorStack.__qt__passive_editor_QLineEdit")
replaceEditorContent(passiveLineEdit, "Shutdown")
type(passiveLineEdit, "<Return>")
waitFor("menu.height > menuHeight", 2000)
# close menu in case it overlaps the combo box
mouseClick(waitForObject(":FormEditorStack_qdesigner_internal::FormWindow"),
100, 100, 0, Qt.LeftButton)
# verify Action Editor and Object Inspector
actionTV = waitForObject("{container={name='ActionEditorDockWidget' type='QDockWidget' "
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'} "
"type='qdesigner_internal::ActionTreeView' unnamed='1' visible='1'}")
test.compare(dumpItems(actionTV.model()), ["actionOpen", "actionShutdown"],
"Verify whether respective actions have been added to Action Editor.")
objInspTV = waitForObject("{container={name='ObjectInspectorDockWidget' type='QDockWidget' "
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'} "
"type='QTreeView' unnamed='1' visible='1'}")
tree = __iterateChildren__(objInspTV.model(), None)
expectedMenuSequence = [["menuSquishTestFile", 2], ["actionOpen", 3], ["separator", 3],
["actionShutdown", 3]]
seqStart = tree.index(expectedMenuSequence[0])
test.verify(seqStart != -1 and tree[seqStart:seqStart + 4] == expectedMenuSequence,
"Verify Object Inspector contains expected menu inclusive children.")
return [["Open", False], ["", True], ["Shutdown", False]]
def performEditCombo():
edComboWin = "{type='qdesigner_internal::ListWidgetEditor' unnamed='1' visible='1'}"
test.log("Editing combo box")
comboBox = waitForObject(":FormEditorStack.comboBox_QComboBox")
doubleClick(comboBox, 5, 5, 0, Qt.LeftButton)
# make sure properties of items are shown
propertyEdView = "{type='QtPropertyEditorView' unnamed='1' visible='1' window=%s}" % edComboWin
if test.verify(not object.exists(propertyEdView), "Verifying property editor is not visible."):
clickButton(waitForObject("{name='showPropertiesButton' type='QPushButton' visible='1' "
"window=%s}" % edComboWin))
for i in range(5):
clickButton(waitForObject("{name='newListItemButton' type='QToolButton' visible='1' "
"window=%s}" % edComboWin))
doubleClick(waitForObject("{column='1' container=%s text='New Item' type='QModelIndex'}"
% propertyEdView))
lineEd = waitForObject("{container=%s type='qdesigner_internal::PropertyLineEdit' "
"unnamed='1' visible='1'}" % propertyEdView)
type(lineEd, "Combo Item %d" % i)
type(lineEd, "<Return>")
itemListWidget = waitForObject("{name='listWidget' type='QListWidget' visible='1' window=%s}"
% edComboWin)
expectedItems = ["Combo Item %d" % i for i in range(5)]
test.compare(dumpItems(itemListWidget.model()), expectedItems,
"Verifying all items have been added.")
# move last item to top (assume last item is still selected)
upButton = waitForObject("{name='moveListItemUpButton' type='QToolButton' visible='1' "
"window=%s}" % edComboWin)
downButton = findObject("{name='moveListItemDownButton' type='QToolButton' visible='1' "
"window=%s}" % edComboWin)
test.verify(upButton.enabled, "Verifying whether Up button is enabled")
test.verify(not downButton.enabled, "Verifying whether Down button is disabled")
for _ in range(4):
clickButton(upButton)
test.verify(waitFor("not upButton.enabled", 1000), "Verifying whether Up button is disabled")
test.verify(downButton.enabled, "Verifying whether Down button is enabled")
expectedItems.insert(0, expectedItems.pop())
test.compare(dumpItems(itemListWidget.model()), expectedItems,
"Verifying last item has moved to top of the list.")
# remove the "Combo Item 1" item from the list
clickItem(itemListWidget, "Combo Item 1", 5, 5, 0, Qt.LeftButton)
clickButton("{name='deleteListItemButton' type='QToolButton' visible='1' window=%s}"
% edComboWin)
waitFor("itemListWidget.model().rowCount() == len(expectedItems) - 1", 2000)
expectedItems.remove("Combo Item 1")
test.compare(dumpItems(itemListWidget.model()), expectedItems,
"Verifying 'Combo Item 1' has been removed.")
clickButton("{text='OK' type='QPushButton' unnamed='1' visible='1' window=%s}" % edComboWin)
test.compare(dumpItems(comboBox.model()), expectedItems,
"Verifying combo box inside Designer has been updated")
return expectedItems
def verifyPreview(menuItems, comboItems):
test.log("Verifying preview")
prev = "{name='MainWindow' type='QMainWindow' visible='1' windowTitle='MainWindow - [Preview]'}"
invokeMenuItem("Tools", "Form Editor", "Preview...")
# verify menu
menuBar = waitForObject("{name='menuBar' type='QMenuBar' visible='1' window=%s}" % prev)
menu = None
activateItem(menuBar, "SquishTestFile")
# known issue for Squish using Qt5 on Mac
if platform.system() == 'Darwin':
for obj in object.topLevelObjects():
try:
if className(obj) == 'QMenu' and str(obj.objectName) == 'menuSquishTestFile':
menu = obj
break
except:
pass
else:
try:
menu = waitForObject("{name='menuSquishTestFile' title='SquishTestFile' "
"type='QMenu' visible='1' window=%s}" % prev)
except:
pass
if menu:
actions = menu.actions()
for position, (text, isSep) in enumerate(menuItems):
action = actions.at(position)
test.verify(action.isSeparator() == isSep and str(action.text) == text,
"Verifying menu item '%s' (separator: %s)" % (text, str(isSep)))
else:
test.warning("Failed to get menu...")
activateItem(menuBar, "SquishTestFile")
# verify combo
combo = waitForObject("{name='comboBox' type='QComboBox' visible='1' window=%s}" % prev)
test.compare(dumpItems(combo.model()), comboItems,
"Verifying combo box contains expected items.")
sendEvent("QCloseEvent", waitForObject(prev))
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
createProject_Qt_GUI(tempDir(), "DesignerTestApp", False)
selectFromLocator("mainwindow.ui")
replaceEditorContent(waitForObject("{container=':*Qt Creator.Widget Box_QDockWidget' "
"type='QLineEdit' visible='1'}"), "combo")
categoryView = ("{container=':Widget Box_qdesigner_internal::WidgetBoxTreeWidget' "
"type='qdesigner_internal::WidgetBoxCategoryListView' unnamed='1' visible='1'}")
dragAndDrop(waitForObject("{container=%s text='Combo Box' type='QModelIndex'}" % categoryView),
5, 5, ":FormEditorStack_qdesigner_internal::FormWindow", 20, 50, Qt.CopyAction)
menuItems = performEditMenu()
comboItems = performEditCombo()
verifyPreview(menuItems, comboItems)
invokeMenuItem("File", "Save All")
invokeMenuItem("Build", "Build All")
waitForCompile()
checkCompile()
invokeMenuItem("File", "Exit")