forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.1'
This commit is contained in:
@@ -7,23 +7,23 @@ imagedirs = $SRCDIR/images $SRCDIR/templates/images
|
|||||||
outputdir = $OUTDIR
|
outputdir = $OUTDIR
|
||||||
exampledirs = $SRCDIR/examples \
|
exampledirs = $SRCDIR/examples \
|
||||||
$SRCDIR/snippets
|
$SRCDIR/snippets
|
||||||
indexes += $QT_INSTALL_DOCS/qtwidgets/qtwidgets.index \
|
indexes += $QDOC_INDEX_DIR/qtwidgets/qtwidgets.index \
|
||||||
$QT_INSTALL_DOCS/qtcore/qtcore.index \
|
$QDOC_INDEX_DIR/qtcore/qtcore.index \
|
||||||
$QT_INSTALL_DOCS/qtqml/qtqml.index \
|
$QDOC_INDEX_DIR/qtqml/qtqml.index \
|
||||||
$QT_INSTALL_DOCS/qtquick/qtquick.index \
|
$QDOC_INDEX_DIR/qtquick/qtquick.index \
|
||||||
$QT_INSTALL_DOCS/qmake/qmake.index \
|
$QDOC_INDEX_DIR/qmake/qmake.index \
|
||||||
$QT_INSTALL_DOCS/qtdesigner/qtdesigner.index \
|
$QDOC_INDEX_DIR/qtdesigner/qtdesigner.index \
|
||||||
$QT_INSTALL_DOCS/qtdoc/qtdoc.index \
|
$QDOC_INDEX_DIR/qtdoc/qtdoc.index \
|
||||||
$QT_INSTALL_DOCS/qtgui/qtgui.index \
|
$QDOC_INDEX_DIR/qtgui/qtgui.index \
|
||||||
$QT_INSTALL_DOCS/qthelp/qthelp.index \
|
$QDOC_INDEX_DIR/qthelp/qthelp.index \
|
||||||
$QT_INSTALL_DOCS/qtquickcontrols/qtquickcontrols.index \
|
$QDOC_INDEX_DIR/qtquickcontrols/qtquickcontrols.index \
|
||||||
$QT_INSTALL_DOCS/qtquicklayouts/qtquicklayouts.index \
|
$QDOC_INDEX_DIR/qtquicklayouts/qtquicklayouts.index \
|
||||||
$QT_INSTALL_DOCS/qtlinguist/qtlinguist.index \
|
$QDOC_INDEX_DIR/qtlinguist/qtlinguist.index \
|
||||||
$QT_INSTALL_DOCS/qtscript/qtscript.index \
|
$QDOC_INDEX_DIR/qtscript/qtscript.index \
|
||||||
$QT_INSTALL_DOCS/qtsensors/qtsensors.index \
|
$QDOC_INDEX_DIR/qtsensors/qtsensors.index \
|
||||||
$QT_INSTALL_DOCS/qtuitools/qtuitools.index \
|
$QDOC_INDEX_DIR/qtuitools/qtuitools.index \
|
||||||
$QT_INSTALL_DOCS/qtwebkit/qtwebkit.index \
|
$QDOC_INDEX_DIR/qtwebkit/qtwebkit.index \
|
||||||
$QT_INSTALL_DOCS/qtxml/qtxml.index
|
$QDOC_INDEX_DIR/qtxml/qtxml.index
|
||||||
|
|
||||||
include(macros.qdocconf)
|
include(macros.qdocconf)
|
||||||
include(qt-cpp-ignore.qdocconf)
|
include(qt-cpp-ignore.qdocconf)
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
greaterThan(QT_MAJOR_VERSION, 4) {
|
greaterThan(QT_MAJOR_VERSION, 4) {
|
||||||
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal
|
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator) -platform minimal
|
||||||
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
|
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc)
|
||||||
|
QDOC_GLOBAL = QT_INSTALL_DOCS=$$[QT_INSTALL_DOCS/src] QDOC_INDEX_DIR=$$[QT_INSTALL_DOCS]
|
||||||
COMPAT =
|
COMPAT =
|
||||||
} else {
|
} else {
|
||||||
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator)
|
HELPGENERATOR = $$targetPath($$[QT_INSTALL_BINS]/qhelpgenerator)
|
||||||
QDOC_BIN = $$targetPath($$[QT_INSTALL_BINS]/qdoc3)
|
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
|
COMPAT = -qt4
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,7 +25,7 @@ defineReplace(cmdEnv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defineReplace(qdoc) {
|
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
|
QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -123,7 +123,8 @@ QString BeautifierPlugin::format(const QString &text, QStringList command, const
|
|||||||
|
|
||||||
// Save text to temporary file
|
// Save text to temporary file
|
||||||
QFileInfo fi(fileName);
|
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.setAutoRemove(true);
|
||||||
sourceFile.write(text.toUtf8());
|
sourceFile.write(text.toUtf8());
|
||||||
if (!sourceFile.finalize()) {
|
if (!sourceFile.finalize()) {
|
||||||
|
|||||||
@@ -108,6 +108,7 @@ GerritOptionsWidget::GerritOptionsWidget(QWidget *parent)
|
|||||||
"Determines the protocol used to form a URL in case\n"
|
"Determines the protocol used to form a URL in case\n"
|
||||||
"\"canonicalWebUrl\" is not configured in the file\n"
|
"\"canonicalWebUrl\" is not configured in the file\n"
|
||||||
"\"gerrit.config\"."));
|
"\"gerrit.config\"."));
|
||||||
|
setTabOrder(m_sshChooser, m_portSpinBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
GerritParameters GerritOptionsWidget::parameters() const
|
GerritParameters GerritOptionsWidget::parameters() const
|
||||||
|
|||||||
@@ -258,6 +258,19 @@ void BlackBerryConfigurationManager::emitSettingsChanged()
|
|||||||
emit settingsChanged();
|
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()
|
void BlackBerryConfigurationManager::setKitsAutoDetectionSource()
|
||||||
{
|
{
|
||||||
foreach (Kit *kit, KitManager::kits()) {
|
foreach (Kit *kit, KitManager::kits()) {
|
||||||
|
|||||||
@@ -87,6 +87,10 @@ public:
|
|||||||
|
|
||||||
void emitSettingsChanged();
|
void emitSettingsChanged();
|
||||||
|
|
||||||
|
#ifdef WITH_TESTS
|
||||||
|
void initUnitTest();
|
||||||
|
#endif
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
void saveSettings();
|
void saveSettings();
|
||||||
|
|||||||
@@ -488,6 +488,7 @@ void QnxPlugin::testConfigurationManager_data()
|
|||||||
void QnxPlugin::testConfigurationManager()
|
void QnxPlugin::testConfigurationManager()
|
||||||
{
|
{
|
||||||
BlackBerryConfigurationManager *manager = BlackBerryConfigurationManager::instance();
|
BlackBerryConfigurationManager *manager = BlackBerryConfigurationManager::instance();
|
||||||
|
manager->initUnitTest();
|
||||||
|
|
||||||
QCOMPARE(manager->apiLevels().count(), 0);
|
QCOMPARE(manager->apiLevels().count(), 0);
|
||||||
QCOMPARE(manager->activeApiLevels().count(), 0);
|
QCOMPARE(manager->activeApiLevels().count(), 0);
|
||||||
|
|||||||
@@ -721,6 +721,7 @@ QString BaseQtVersion::findQtBinary(Binaries binary) const
|
|||||||
else
|
else
|
||||||
possibleCommands << QLatin1String("qmlscene");
|
possibleCommands << QLatin1String("qmlscene");
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case QmlViewer: {
|
case QmlViewer: {
|
||||||
if (HostOsInfo::isWindowsHost())
|
if (HostOsInfo::isWindowsHost())
|
||||||
possibleCommands << QLatin1String("qmlviewer.exe");
|
possibleCommands << QLatin1String("qmlviewer.exe");
|
||||||
|
|||||||
@@ -67,10 +67,12 @@ QString DesktopQtVersion::type() const
|
|||||||
QStringList DesktopQtVersion::warningReason() const
|
QStringList DesktopQtVersion::warningReason() const
|
||||||
{
|
{
|
||||||
QStringList ret = BaseQtVersion::warningReason();
|
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.");
|
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.");
|
ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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).
|
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.
|
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:
|
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 subfolder called 'creator-test-data'
|
||||||
* a speedcrunch 0.11 repository (or source copy) inside 'creator-test-data' named 'speedcrunch'
|
* 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
|
* additional Squish versions for hooking into subprocesses inside different folders inside 'creator-test-data' following the information below
|
||||||
|
|||||||
@@ -81,7 +81,10 @@
|
|||||||
:Form.Startup_QGroupBox {container=':qt_tabwidget_stackedwidget.Form_QWidget' name='startupGroupBox' title='Startup' type='QGroupBox' visible='1'}
|
: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.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.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.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::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'}
|
: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'}
|
:Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'}
|
||||||
|
|||||||
@@ -43,8 +43,9 @@ def checkLastBuild(expectedToFail=False, createTasksFileOnError=True):
|
|||||||
ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton")
|
ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton")
|
||||||
model = waitForObject(":Qt Creator.Issues_QListView").model()
|
model = waitForObject(":Qt Creator.Issues_QListView").model()
|
||||||
buildIssues = dumpBuildIssues(model)
|
buildIssues = dumpBuildIssues(model)
|
||||||
errors = len(filter(lambda i: i[5] == "1", buildIssues))
|
types = map(lambda i: i[5], buildIssues)
|
||||||
warnings = len(filter(lambda i: i[5] == "2", buildIssues))
|
errors = types.count("1")
|
||||||
|
warnings = types.count("2")
|
||||||
gotErrors = errors != 0
|
gotErrors = errors != 0
|
||||||
if not (gotErrors ^ expectedToFail):
|
if not (gotErrors ^ expectedToFail):
|
||||||
test.passes("Errors: %s | Warnings: %s" % (errors, warnings))
|
test.passes("Errors: %s | Warnings: %s" % (errors, warnings))
|
||||||
|
|||||||
@@ -406,7 +406,7 @@ def replaceLine(fileSpec, oldLine, newLine):
|
|||||||
if openDocumentPlaceCursor(fileSpec, oldLine) == None:
|
if openDocumentPlaceCursor(fileSpec, oldLine) == None:
|
||||||
return False
|
return False
|
||||||
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
|
||||||
for i in range(len(oldLine)):
|
for _ in oldLine:
|
||||||
type(editor, "<Backspace>")
|
type(editor, "<Backspace>")
|
||||||
type(editor, newLine)
|
type(editor, newLine)
|
||||||
return True
|
return True
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ def main():
|
|||||||
editor = getEditorForFileSuffix("%s.h" % className.lower())
|
editor = getEditorForFileSuffix("%s.h" % className.lower())
|
||||||
oldContent = str(editor.plainText)
|
oldContent = str(editor.plainText)
|
||||||
placeCursorToLine(editor, "class %s.*" % className, True)
|
placeCursorToLine(editor, "class %s.*" % className, True)
|
||||||
|
snooze(1) # avoid timing issue with the parser
|
||||||
invokeContextMenuItem(editor, "Refactor", "Insert Virtual Functions of Base Classes")
|
invokeContextMenuItem(editor, "Refactor", "Insert Virtual Functions of Base Classes")
|
||||||
handleInsertVirtualFunctions(["keys() const = 0 : QStringList",
|
handleInsertVirtualFunctions(["keys() const = 0 : QStringList",
|
||||||
"create(const QString &, const QString &) = 0 : QObject *"])
|
"create(const QString &, const QString &) = 0 : QObject *"])
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class Tree:
|
|||||||
def countChildOccurrences(self, name):
|
def countChildOccurrences(self, name):
|
||||||
if not self.__children__:
|
if not self.__children__:
|
||||||
return 0
|
return 0
|
||||||
return len(filter(lambda x: x.getName() == name, self.__children__))
|
return map(lambda x: x.getName(), self.__children__).count(name)
|
||||||
|
|
||||||
# internal functions
|
# internal functions
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
"filename"
|
"filename"
|
||||||
"creator/README"
|
"creator/README"
|
||||||
"creator/qtcreator.pri"
|
"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/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.cpp"
|
||||||
"creator/src/plugins/coreplugin/basefilewizard.h"
|
"creator/src/plugins/coreplugin/basefilewizard.h"
|
||||||
"creator/tests/system/suite_debugger/tst_simple_debug/test.py"
|
"creator/tests/system/suite_debugger/tst_simple_debug/test.py"
|
||||||
|
|||||||
|
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
|
|||||||
IMPLICITAUTSTART=0
|
IMPLICITAUTSTART=0
|
||||||
LANGUAGE=Python
|
LANGUAGE=Python
|
||||||
OBJECTMAP=../objects.map
|
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
|
VERSION=2
|
||||||
WRAPPERS=Qt
|
WRAPPERS=Qt
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ def main():
|
|||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
return
|
return
|
||||||
progressBarWait(30000)
|
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
|
# Invoke a rebuild of the application
|
||||||
invokeMenuItem("Build", "Rebuild All")
|
invokeMenuItem("Build", "Rebuild All")
|
||||||
|
|||||||
99
tests/system/suite_general/tst_cmake_speedcrunch/testdata/projecttree_speedcrunch.tsv
vendored
Normal file
99
tests/system/suite_general/tst_cmake_speedcrunch/testdata/projecttree_speedcrunch.tsv
vendored
Normal 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"
|
||||||
|
@@ -47,8 +47,8 @@ def main():
|
|||||||
progressBarWait(300000)
|
progressBarWait(300000)
|
||||||
|
|
||||||
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
naviTreeView = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s' type='QModelIndex'}"
|
||||||
compareProjectTree(naviTreeView % "speedcrunch( \(\S+\))?", "projecttree_speedcrunch.tsv")
|
compareProjectTree(naviTreeView % "speedcrunch( \[\S+\])?", "projecttree_speedcrunch.tsv")
|
||||||
compareProjectTree(naviTreeView % "qtcreator( \(\S+\))?", "projecttree_creator.tsv")
|
compareProjectTree(naviTreeView % "qtcreator( \[\S+\])?", "projecttree_creator.tsv")
|
||||||
|
|
||||||
# Now check some basic lookups in the search box
|
# Now check some basic lookups in the search box
|
||||||
selectFromLocator(": Qlist::QList", "QList::QList")
|
selectFromLocator(": Qlist::QList", "QList::QList")
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -53,23 +53,25 @@ def main():
|
|||||||
if isQt4Build and platform.system() == 'Darwin':
|
if isQt4Build and platform.system() == 'Darwin':
|
||||||
# avoid QTCREATORBUG-9197
|
# avoid QTCREATORBUG-9197
|
||||||
filtered = [filenames[0]]
|
filtered = [filenames[0]]
|
||||||
for i in range(1, len(filenames)):
|
for filename in filenames[1:]:
|
||||||
if filenames[i].lower() != filtered[-1].lower():
|
if filename.lower() != filtered[-1].lower():
|
||||||
filtered.append(filenames[i])
|
filtered.append(filename)
|
||||||
filenames = filtered
|
filenames = filtered
|
||||||
for i in range(len(filenames)):
|
previous = filenames[-1]
|
||||||
|
for filename in filenames:
|
||||||
tempFiletype = filetype
|
tempFiletype = filetype
|
||||||
if filetype == "QML" and filenames[i - 1][-4:] != ".qml":
|
if filetype == "QML" and previous[-4:] != ".qml":
|
||||||
tempFiletype = "Other files"
|
tempFiletype = "Other files"
|
||||||
# following is necessary due to QTCREATORBUG-10179
|
# following is necessary due to QTCREATORBUG-10179
|
||||||
# will be fixed when Qt5's MIME type database can be used
|
# 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")
|
if ((filenames[-1] in ("main.cpp", "utility.cpp") and previous[-4:] != ".cpp")
|
||||||
or (filenames[-1] == "utility.h" and filenames[i - 1][-2:].lower() != ".h")
|
or (filenames[-1] == "utility.h" and previous[-2:].lower() != ".h")
|
||||||
or (filetype == "Resources" and filenames[i - 1][-4:] != ".qrc")):
|
or (filetype == "Resources" and previous[-4:] != ".qrc")):
|
||||||
tempFiletype = "Other files"
|
tempFiletype = "Other files"
|
||||||
# end of handling QTCREATORBUG-10179
|
# end of handling QTCREATORBUG-10179
|
||||||
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
|
renameFile(templateDir, usedProFile, projectName + "." + tempFiletype,
|
||||||
filenames[i - 1], filenames[i])
|
previous, filename)
|
||||||
|
previous = filename
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
def renameFile(projectDir, proFile, branch, oldname, newname):
|
def renameFile(projectDir, proFile, branch, oldname, newname):
|
||||||
|
|||||||
155
tests/system/suite_general/tst_tasks_handling/test.py
Normal file
155
tests/system/suite_general/tst_tasks_handling/test.py
Normal 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")
|
||||||
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
|
|||||||
IMPLICITAUTSTART=0
|
IMPLICITAUTSTART=0
|
||||||
LANGUAGE=Python
|
LANGUAGE=Python
|
||||||
OBJECTMAP=../objects.map
|
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
|
VERSION=2
|
||||||
WRAPPERS=Qt
|
WRAPPERS=Qt
|
||||||
|
|||||||
191
tests/system/suite_tools/tst_designer_edit/test.py
Normal file
191
tests/system/suite_tools/tst_designer_edit/test.py
Normal 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")
|
||||||
Reference in New Issue
Block a user