Commit b1962162 authored by Sergio Ahumada's avatar Sergio Ahumada Committed by The Qt Project

Merge "Merge branch '2.8'"

parents eea64bea a4d714e2
......@@ -73,7 +73,7 @@ macx {
} else {
BINDIST_SOURCE = "$(INSTALL_ROOT)$$QTC_PREFIX"
BINDIST_INSTALLER_SOURCE = "$$BINDIST_SOURCE/*"
deployqt.commands = $$PWD/scripts/deployqt.py -i \"$(INSTALL_ROOT)$$QTC_PREFIX\"
deployqt.commands = python -u $$PWD/scripts/deployqt.py -i \"$(INSTALL_ROOT)$$QTC_PREFIX\"
deployqt.depends = install
win32 {
deployartifacts.depends = install
......@@ -94,7 +94,7 @@ bindist.commands = 7z a -mx9 $$OUT_PWD/qt-creator-$${PATTERN}.7z \"$$BINDIST_SOU
bindist_installer.depends = deployqt
bindist_installer.commands = 7z a -mx9 $${INSTALLER_ARCHIVE} \"$$BINDIST_INSTALLER_SOURCE\"
installer.depends = bindist_installer
installer.commands = $$PWD/scripts/packageIfw.py -i \"$(IFW_PATH)\" -v $${QTCREATOR_VERSION} -a \"$${INSTALLER_ARCHIVE}\" "$$INSTALLER_NAME"
installer.commands = python -u $$PWD/scripts/packageIfw.py -i \"$(IFW_PATH)\" -v $${QTCREATOR_VERSION} -a \"$${INSTALLER_ARCHIVE}\" "$$INSTALLER_NAME"
macx {
# this should be very temporary:
......
......@@ -30,6 +30,7 @@
#include "graphicsobjectnodeinstance.h"
#include <QGraphicsObject>
#include <QDeclarativeItem>
#include "private/qgraphicsitem_p.h"
#include <private/qdeclarativemetatype_p.h>
......@@ -302,6 +303,11 @@ void GraphicsObjectNodeInstance::paintRecursively(QGraphicsItem *graphicsItem, Q
painter->save();
painter->setTransform(graphicsItem->itemTransform(graphicsItem->parentItem()), true);
painter->setOpacity(graphicsItem->opacity() * painter->opacity());
QDeclarativeItem *declarativeItem = qobject_cast<QDeclarativeItem *>(graphicsItem);
if (declarativeItem && declarativeItem->clip())
painter->setClipRect(declarativeItem->boundingRect());
QStyleOptionGraphicsItem option;
initOption(graphicsItem, &option, painter->transform());
graphicsItem->paint(painter, &option);
......
......@@ -453,6 +453,7 @@ void ObjectNodeInstance::setPropertyVariant(const PropertyName &name, const QVar
if (hasValidResetBinding(name)) {
QDeclarativePropertyPrivate::setBinding(property, 0, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding);
resetBinding(name)->setEnabled(false);
}
bool isWritten = property.write(convertSpecialCharacter(fixedValue));
......
......@@ -113,7 +113,7 @@ bool Qt4NodeInstanceServer::nonInstanceChildIsDirty(QGraphicsObject *graphicsObj
continue;
QGraphicsItemPrivate *childPrivate = QGraphicsItemPrivate::get(child);
if (childPrivate->dirty || nonInstanceChildIsDirty(childGraphicsObject))
if (childPrivate->dirty || d->dirtySceneTransform || nonInstanceChildIsDirty(childGraphicsObject))
return true;
}
}
......
:*Qt Creator.Build Project_Core::Internal::FancyToolButton {text='Build Project' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Cancel Build_QToolButton {text='Cancel Build' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Clear_QToolButton {text='Clear' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Continue_Core::Internal::FancyToolButton {text='Continue' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.DoubleTabWidget_ProjectExplorer::Internal::DoubleTabWidget {name='ProjectExplorer__Internal__DoubleTabWidget' type='ProjectExplorer::Internal::DoubleTabWidget' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='DoubleTabWidget'}
......@@ -38,6 +40,10 @@
:CMake Wizard.Next_QPushButton {name='__qt__passive_wizardbutton1' text~='(Next.*|Continue)' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard.Run CMake_QPushButton {text='Run CMake' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard {type='CMakeProjectManager::Internal::CMakeOpenProjectWizard' unnamed='1' visible='1' windowTitle='CMake Wizard'}
:Cannot Open Project.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Cannot Open Project_QMessageBox'}
:Cannot Open Project.Show Details..._QPushButton {text='Show Details...' type='QPushButton' unnamed='1' visible='1' window=':Cannot Open Project_QMessageBox'}
:Cannot Open Project_QMessageBox {text?='Failed to open project in *' type='QMessageBox' unnamed='1' visible='1'}
:Cannot Open Project_QTextEdit {type='QTextEdit' unnamed='1' visible='1' window=':Cannot Open Project_QMessageBox'}
:CodePaster__Internal__PasteSelectDialog.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}
:CodePaster__Internal__PasteSelectDialog.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}
:CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget {name='listWidget' type='QListWidget' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}
......@@ -74,6 +80,13 @@
: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'}
:Git Repository Clone.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'}
:Git Repository Clone.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' unnamed='1' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'}
:Git Repository Clone.Repository_QGroupBox {name='repositoryGroupBox' title='Repository' type='QGroupBox' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'}
:Git Repository Clone.Result._QLabel {name='statusLabel' type='QLabel' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'}
:Git Repository Clone.Working Copy_QGroupBox {name='localGroupBox' title='Working Copy' type='QGroupBox' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'}
:Git Repository Clone.logPlainTextEdit_QPlainTextEdit {name='logPlainTextEdit' type='QPlainTextEdit' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'}
:Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog {type='VcsBase::Internal::CheckoutWizardDialog' unnamed='1' visible='1' windowTitle='Git Repository Clone'}
:Go to slot.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Go to slot_QDialog'}
:Go to slot.Select signal_QGroupBox {name='groupBox' title='Select signal' type='QGroupBox' visible='1' window=':Go to slot_QDialog'}
:Go to slot_QDialog {name='SelectSignalDialog' type='QDialog' visible='1' windowTitle='Go to slot'}
......@@ -156,6 +169,7 @@
:QtSupport__Internal__QtVersionManager.errorLabel.QLabel {container=':qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget' name='errorLabel' type='QLabel' visible='1'}
:QtSupport__Internal__QtVersionManager.qmake_QLabel {container=':qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget' name='qmakePath' type='QLabel' visible='1'}
:QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget {container=':qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget' name='qtdirList' type='QTreeWidget' visible='1'}
:Repository.repositoryLineEdit_QLineEdit {container=':Git Repository Clone.Repository_QGroupBox' name='repositoryLineEdit' type='QLineEdit' visible='1'}
:Restart required.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Restart required_QMessageBox'}
:Restart required_QMessageBox {text='The language change will take effect after a restart of Qt Creator.' type='QMessageBox' unnamed='1' visible='1'}
:Revert to Saved.Proceed_QPushButton {text='Proceed' type='QPushButton' unnamed='1' visible='1' window=':Revert to Saved_QMessageBox'}
......@@ -172,6 +186,8 @@
:Startup.contextHelpComboBox_QComboBox {container=':Form.Startup_QGroupBox' name='contextHelpComboBox' type='QComboBox' visible='1'}
:User Interface.languageBox_QComboBox {container=':Core__Internal__GeneralSettings.User Interface_QGroupBox' name='languageBox' type='QComboBox' visible='1'}
:Widget Box_qdesigner_internal::WidgetBoxTreeWidget {container=':*Qt Creator.Widget Box_QDockWidget' type='qdesigner_internal::WidgetBoxTreeWidget' unnamed='1' visible='1'}
:Working Copy.checkoutDirectoryLineEdit_QLineEdit {container=':Git Repository Clone.Working Copy_QGroupBox' name='checkoutDirectoryLineEdit' type='QLineEdit' visible='1'}
:Working Copy_Utils::BaseValidatingLineEdit {container=':Git Repository Clone.Working Copy_QGroupBox' type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}
:WritePermissions_Core::Internal::ReadOnlyFilesDialog {name='Core__Internal__ReadOnlyFilesDialog' type='Core::Internal::ReadOnlyFilesDialog' visible='1' windowTitle='Files Without Write Permissions'}
:addToVersionControlComboBox_QComboBox {name='addToVersionControlComboBox' type='QComboBox' visible='1'}
:fileNameEdit_QLineEdit {buddy=':Open File.File name:_QLabel' name='fileNameEdit' type='QLineEdit' visible='1'}
......
......@@ -204,25 +204,33 @@ def verifyBuildConfig(targetCount, currentTarget, shouldBeDebug=False, enableSha
test.compare(buildCfCombo.currentText, 'Debug', "Verifying whether it's a debug build")
else:
test.compare(buildCfCombo.currentText, 'Release', "Verifying whether it's a release build")
try:
libLabel = waitForObject(":scrollArea.Library not available_QLabel", 2000)
mouseClick(libLabel, libLabel.width - 10, libLabel.height / 2, 0, Qt.LeftButton)
except:
pass
# Since waitForObject waits for the object to be enabled,
# it will wait here until compilation of the debug libraries has finished.
qmlDebugCheckbox = waitForObject(":scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox", 150000)
if qmlDebugCheckbox.checked != enableQmlDebug:
clickButton(qmlDebugCheckbox)
# Don't rebuild now
clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000))
try:
problemFound = waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' "
"type='QLabel' name='problemLabel' visible='1'}", 1000)
if problemFound:
test.warning('%s' % problemFound.text)
except:
pass
if enableQmlDebug:
try:
libLabel = waitForObject(":scrollArea.Library not available_QLabel", 2000)
mouseClick(libLabel, libLabel.width - 10, libLabel.height / 2, 0, Qt.LeftButton)
except:
pass
# Since waitForObject waits for the object to be enabled,
# it will wait here until compilation of the debug libraries has finished.
qmlDebugCheckbox = waitForObject(":scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox", 150000)
if qmlDebugCheckbox.checked != enableQmlDebug:
clickButton(qmlDebugCheckbox)
# Don't rebuild now
clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000))
try:
problemFound = waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' "
"type='QLabel' name='problemLabel' visible='1'}", 1000)
if problemFound:
test.warning('%s' % problemFound.text)
except:
pass
else:
qmlDebugCheckbox = findObject(":scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox")
if qmlDebugCheckbox.enabled and qmlDebugCheckbox.checked:
test.log("Qml debugging libraries are available - unchecking qml debugging.")
clickButton(qmlDebugCheckbox)
# Don't rebuild now
clickButton(waitForObject(":QML Debugging.No_QPushButton", 5000))
clickButton(waitForObject(":scrollArea.Details_Utils::DetailsButton"))
switchViewTo(ViewConstants.EDIT)
......
......@@ -216,7 +216,7 @@ def __handleColorTips__(colTip, expectedColor):
if rgb.rgba() == cmp.rgba():
test.passes("ColorTip verified")
else:
test.fail("ColorTip does not match - expected color '%s' got '%s'" % (rgb.rgb(), cmp.rgb()))
test.fail("ColorTip does not match - expected color '%s' got '%s'" % (cmp.rgb(), rgb.rgb()))
# function that checks whether all expected properties (including their values)
# match the given properties
......
......@@ -33,11 +33,11 @@ import re
processStarted = False
processExited = False
def __handleProcessStarted__(object):
def __handleProcessStarted__(*args):
global processStarted
processStarted = True
def __handleProcessExited__(object, exitCode):
def __handleProcessExited__(*args):
global processExited
processExited = True
......@@ -70,6 +70,9 @@ def openCmakeProject(projectPath, buildDir):
replaceEditorContent("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'"
"window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}", buildDir)
clickButton(waitForObject(":CMake Wizard.Next_QPushButton"))
return __handleCmakeWizardPage__()
def __handleCmakeWizardPage__():
generatorCombo = waitForObject(":Generator:_QComboBox")
mkspec = __getMkspecFromQmake__("qmake")
test.log("Using mkspec '%s'" % mkspec)
......@@ -255,20 +258,21 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N
progressBarWait(10000)
return checkedTargets, projectName
def createNewQtQuickUI(workingDir):
__createProjectOrFileSelectType__(" Applications", "Qt Quick 1 UI")
def createNewQtQuickUI(workingDir, qtQuickVersion=1):
__createProjectOrFileSelectType__(" Applications", "Qt Quick %d UI" % qtQuickVersion)
if workingDir == None:
workingDir = tempDir()
projectName = __createProjectSetNameAndPath__(workingDir)
__createProjectHandleLastPage__()
return projectName
def createNewQmlExtension(workingDir):
available = __createProjectOrFileSelectType__(" Libraries", "Qt Quick 1 Extension Plugin")
def createNewQmlExtension(workingDir, targets=Targets.DESKTOP_474_GCC, qtQuickVersion=1):
available = __createProjectOrFileSelectType__(" Libraries", "Qt Quick %d Extension Plugin"
% qtQuickVersion)
if workingDir == None:
workingDir = tempDir()
__createProjectSetNameAndPath__(workingDir)
checkedTargets = __chooseTargets__(Targets.DESKTOP_474_GCC, available)
checkedTargets = __chooseTargets__(targets, available)
nextButton = waitForObject(":Next_QPushButton")
clickButton(nextButton)
nameLineEd = waitForObject("{buddy={type='QLabel' text='Object class-name:' unnamed='1' visible='1'} "
......@@ -281,8 +285,42 @@ def createNewQmlExtension(workingDir):
__createProjectHandleLastPage__()
return checkedTargets
def createEmptyQtProject(workingDir=None, projectName=None, targets=Targets.desktopTargetClasses()):
__createProjectOrFileSelectType__(" Other Project", "Empty Qt Project")
if workingDir == None:
workingDir = tempDir()
projectName = __createProjectSetNameAndPath__(workingDir, projectName)
checkedTargets = __chooseTargets__(targets)
snooze(1)
clickButton(waitForObject(":Next_QPushButton"))
__createProjectHandleLastPage__()
return projectName, checkedTargets
def createNewNonQtProject(workingDir=None, projectName=None, target=Targets.DESKTOP_474_GCC,
plainC=False, cmake=False):
if plainC:
template = "Plain C Project"
else:
template = "Plain C++ Project"
if cmake:
template += " (CMake Build)"
available = __createProjectOrFileSelectType__(" Non-Qt Project", template)
if workingDir == None:
workingDir = tempDir()
projectName = __createProjectSetNameAndPath__(workingDir, projectName)
if cmake:
__createProjectHandleLastPage__()
clickButton(waitForObject(":Next_QPushButton"))
if not __handleCmakeWizardPage__():
return None
else:
__chooseTargets__(target, availableTargets=available)
clickButton(waitForObject(":Next_QPushButton"))
__createProjectHandleLastPage__()
return projectName
# parameter target can be an OR'd value of Targets
# parameter availableTargets should be the result of __createProjectSelectType__()
# parameter availableTargets should be the result of __createProjectOrFileSelectType__()
# or use None as a fallback
def __chooseTargets__(targets=Targets.DESKTOP_474_GCC, availableTargets=None,
isMaddeDisabled=True):
......@@ -330,8 +368,8 @@ def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None
global processStarted, processExited
processStarted = processExited = False
overrideInstallLazySignalHandler()
installLazySignalHandler("{type='ProjectExplorer::ApplicationLauncher'}", "processStarted()", "__handleProcessStarted__")
installLazySignalHandler("{type='ProjectExplorer::ApplicationLauncher'}", "processExited(int)", "__handleProcessExited__")
installLazySignalHandler("{type='QProcess'}", "started()", "__handleProcessStarted__")
installLazySignalHandler("{type='QProcess'}", "finished(int,QProcess::ExitStatus)", "__handleProcessExited__")
runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
clickButton(runButton)
if sType != SubprocessType.QT_QUICK_UI:
......@@ -445,7 +483,7 @@ def __closeSubprocessByHookingInto__(executable, port, function, sType, userDefT
"Using fallback of pushing STOP inside Creator.")
resetApplicationContextToCreator()
__closeSubprocessByPushingStop__(sType)
waitFor("processExited==True", 10000)
waitFor("processExited==True and 'exited with code' in str(output.plainText)", 10000)
if not processExited:
test.warning("Sub-process seems not to have closed properly.")
try:
......@@ -480,18 +518,19 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
supports = text[text.find('Supported Platforms'):].split(":")[1].strip().split(" ")
result = []
if 'Desktop' in supports:
result.append(Targets.DESKTOP_474_GCC)
result.append(Targets.DESKTOP_480_GCC)
if version == None or version < "5.0":
result.append(Targets.DESKTOP_474_GCC)
result.append(Targets.DESKTOP_480_GCC)
if platform.system() in ("Linux", "Darwin"):
result.append(Targets.EMBEDDED_LINUX)
elif platform.system() in ('Windows', 'Microsoft'):
result.append(Targets.DESKTOP_480_MSVC2010)
result.append(Targets.DESKTOP_501_DEFAULT)
if platform.system() in ("Linux", "Darwin"):
result.append(Targets.EMBEDDED_LINUX)
elif platform.system() in ('Windows', 'Microsoft'):
result.append(Targets.DESKTOP_480_MSVC2010)
if 'MeeGo/Harmattan' in supports:
result.append(Targets.HARMATTAN)
if 'Maemo/Fremantle' in supports:
result.append(Targets.MAEMO5)
if not ("BlackBerry" in templateName or re.search("custom Qt Creator plugin", text)):
if not ("BlackBerry" in templateName or re.search("custom Qt Creator plugin", text)) and (version == None or version < "5.0"):
result.append(Targets.SIMULATOR)
elif 'Platform independent' in text:
# MAEMO5 and HARMATTAN could be wrong here - depends on having Madde plugin enabled or not
......@@ -583,3 +622,13 @@ def addCPlusPlusFileToCurrentProject(name, template, forceOverwrite=False):
buttonToClick = 'Cancel'
clickButton("{text='%s' type='QPushButton' unnamed='1' visible='1' window=%s}"
% (buttonToClick, overwriteDialog))
def qt5SDKPath():
if platform.system() in ('Microsoft', 'Windows'):
return os.path.abspath("C:/Qt/Qt5.0.1/5.0.1/msvc2010")
elif platform.system() == 'Linux':
if __is64BitOS__():
return os.path.expanduser("~/Qt5.0.1/5.0.1/gcc_64")
return os.path.expanduser("~/Qt5.0.1/5.0.1/gcc")
else:
return os.path.expanduser("~/Qt5.0.1/5.0.1/clang_64")
......@@ -286,3 +286,19 @@ def getQtInformationByQMakeCall(qtDir, which):
test.fatal("You're trying to fetch an unknown information (%s)" % which)
return None
return getOutputFromCmdline("%s -query %s" % (qmake, query)).strip()
def invokeContextMenuOnProject(projectName, menuItem):
try:
projItem = waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", projectName, 3000)
except:
try:
projItem = waitForObjectItem(":Qt Creator_Utils::NavigationTreeView",
addBranchWildcardToRoot(projectName), 1000)
except:
test.fatal("Failed to find root node of the project '%s'." % projectName)
return
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
str(projItem.text).replace("_", "\\_").replace(".", "\\."), 5, 5, 0)
activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}", menuItem))
return projItem
......@@ -310,6 +310,34 @@ def addHelpDocumentation(which):
selectFromFileDialog(qch)
clickButton(waitForObject(":Options.OK_QPushButton"))
def addCurrentCreatorDocumentation():
currentCreatorPath = currentApplicationContext().cwd
if platform.system() == "Darwin":
docPath = os.path.abspath(os.path.join(currentCreatorPath, "Qt Creator.app", "Contents",
"Resources", "doc", "qtcreator.qch"))
else:
docPath = os.path.abspath(os.path.join(currentCreatorPath, "..", "share", "doc",
"qtcreator", "qtcreator.qch"))
if not os.path.exists(docPath):
test.fatal("Missing current Qt Creator documentation (expected in %s)" % docPath)
return
invokeMenuItem("Tools", "Options...")
waitForObjectItem(":Options_QListView", "Help")
clickItem(":Options_QListView", "Help", 14, 15, 0, Qt.LeftButton)
waitForObject("{container=':Options.qt_tabwidget_tabbar_QTabBar' type='TabItem' text='Documentation'}")
clickOnTab(":Options.qt_tabwidget_tabbar_QTabBar", "Documentation")
clickButton(waitForObject("{type='QPushButton' name='addButton' visible='1' text='Add...'}"))
selectFromFileDialog(docPath)
try:
waitForObject("{type='QMessageBox' unnamed='1' visible='1' "
"text?='Unable to register documentation.*'}", 3000)
test.passes("Qt Creator's documentation found already registered.")
clickButton(waitForObject("{type='QPushButton' text='OK' unnamed='1' visible='1' "
"container={name='groupBox' type='QGroupBox' visible='1'}}"))
except:
test.fail("Added Qt Creator's documentation explicitly.")
clickButton(waitForObject(":Options.OK_QPushButton"))
def verifyOutput(string, substring, outputFrom, outputIn):
index = string.find(substring)
if (index == -1):
......
......@@ -84,8 +84,8 @@ def main():
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
def __handleFutureProgress__(obj):
def __handleFutureProgress__(*args):
global searchFinished
if className(obj) == "Core::FutureProgress":
if className(args[0]) == "Core::FutureProgress":
searchFinished = True
......@@ -49,6 +49,9 @@ def main():
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
# check output if build successful
ensureChecked(waitForObject(":Qt Creator_CompileOutput_Core::Internal::OutputPaneToggleButton"))
waitFor("object.exists(':*Qt Creator.Cancel Build_QToolButton')", 20000)
cancelBuildButton = findObject(':*Qt Creator.Cancel Build_QToolButton')
waitFor("not cancelBuildButton.enabled", 30000)
compileOutput = waitForObject(":Qt Creator.Compile Output_Core::OutputWindow")
if not test.verify(compileSucceeded(compileOutput.plainText),
"Verifying building of simple qt quick application."):
......
......@@ -31,21 +31,7 @@ source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
def verifyChangeProject(projectName):
# select project
try:
projItem = waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", projectName, 3000)
except:
try:
projItem = waitForObjectItem(":Qt Creator_Utils::NavigationTreeView",
addBranchWildcardToRoot(projectName), 1000)
except:
test.fatal("Failed to find root node of the project '%s'." % projectName)
return
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
str(projItem.text).replace("_", "\\_").replace(".", "\\."), 5, 5, 0)
activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}",
'Set "%s" as Active Project' % projectName))
projItem = invokeContextMenuOnProject(projectName, 'Set "%s" as Active Project' % projectName)
waitFor("projItem.font.bold==True", 3000)
# check if bold is right project
test.verify(projItem.font.bold == True,
......
......@@ -35,19 +35,20 @@ gettingStartedText = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False,
"text='Getting Started'")
# wait until help gets loaded
def webPageContentLoaded(obj, param):
def webPageContentLoaded(*args):
global webPageContentLoadedValue
objectClass = str(obj.metaObject().className())
objectClass = str(args[0].metaObject().className())
if objectClass in ("QWebPage", "Help::Internal::HelpViewer"):
webPageContentLoadedValue += 1
def clickItemVerifyHelpCombo(qmlItem, expectedHelpComboText, testDetails):
def clickItemVerifyHelpCombo(qmlItem, expectedHelpComboRegex, testDetails):
global gettingStartedText
webPageContentLoadedValue = 0
mouseClick(waitForObject(qmlItem), 5, 5, 0, Qt.LeftButton)
waitFor("webPageContentLoadedValue == 4", 5000)
test.compare(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText,
expectedHelpComboText, testDetails)
foundText = str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText)
if not test.verify(re.match(expectedHelpComboRegex, foundText), testDetails):
test.log("Found %s" % foundText)
# select "Welcome" page from left toolbar again
switchViewTo(ViewConstants.WELCOME)
test.verify(checkIfObjectExists(gettingStartedText),
......@@ -63,12 +64,13 @@ def main():
installLazySignalHandler(":*Qt Creator_Help::Internal::HelpViewer", "loadFinished(bool)",
"webPageContentLoaded")
setAlwaysStartFullHelp()
addCurrentCreatorDocumentation()
if not test.verify(checkIfObjectExists(gettingStartedText),
"Verifying: Qt Creator displays Welcome Page with Getting Started."):
mouseClick(waitForObject(getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False,
"text='Getting Started'")), 5, 5, 0, Qt.LeftButton)
qmlItem = getQmlItem("LinkedText", ":Qt Creator_QDeclarativeView", False, "text='User Guide'")
expectedText = "QtCreator : Qt Creator Manual"
expectedText = "(QtCreator : Qt Creator Manual)|(Qt Creator Manual [|] QtCreator)"
testDetails = "Verifying: Help with Creator Documentation is being opened."
# select "User Guide" topic
clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails)
......@@ -80,12 +82,12 @@ def main():
"text='Blogs'")),
"Verifying: Link to Planet Qt exists.")
qmlItem = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='IDE Overview'")
expectedText = "QtCreator : IDE Overview"
expectedText = "(QtCreator : IDE Overview)|(IDE Overview [|] QtCreator)"
testDetails = "Verifying: Help with IDE Overview topic is being opened."
# select "IDE Overview"
clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails)
qmlItem = getQmlItem("Text", ":Qt Creator_QDeclarativeView", False, "text='User Interface'")
expectedText = "QtCreator : User Interface"
expectedText = "(QtCreator : User Interface)|(User Interface [|]) QtCreator"
testDetails = "Verifying: Help with User Interface topic is being opened."
# select "User interface"
clickItemVerifyHelpCombo(qmlItem, expectedText, testDetails)
......@@ -95,7 +97,8 @@ def main():
"text='Building and Running an Example Application'")),
5, 5, 0, Qt.LeftButton)
waitFor("webPageContentLoadedValue == 4", 5000)
checkPattern = "QtCreator : Building and Running an Example( Application)?"
checkPattern = ("(QtCreator : Building and Running an Example( Application)?)"
"|(Building and Running an Example( Application)? [|] QtCreator)")
checkText = str(waitForObject(":Qt Creator_HelpSelector_QComboBox").currentText)
if not test.verify(re.search(checkPattern, checkText),
"Verifying: Building and Running an Example is opened."):
......
......@@ -33,9 +33,9 @@ source("../../shared/suites_qtta.py")
webPageContentLoadedValue = 0
# wait until help gets loaded
def webPageContentLoaded(obj, param):
def webPageContentLoaded(*args):
global webPageContentLoadedValue
objectClass = str(obj.metaObject().className())
objectClass = str(args[0].metaObject().className())
if objectClass in ("QWebPage", "Help::Internal::HelpViewer"):
webPageContentLoadedValue += 1
......@@ -59,16 +59,6 @@ def handlePackagingMessageBoxes():
except:
break
def qt5SDKPath():
if platform.system() in ('Microsoft', 'Windows'):
return os.path.abspath("C:/Qt/Qt5.0.1/5.0.1/msvc2010")
elif platform.system() == 'Linux':
if __is64BitOS__():
return os.path.expanduser("~/Qt5.0.1/5.0.1/gcc_64")
return os.path.expanduser("~/Qt5.0.1/5.0.1/gcc")
else:
return os.path.expanduser("~/Qt5.0.1/5.0.1/clang_64")
def main():
global sdkPath, webPageContentLoadedValue
# open Qt Creator
......@@ -127,10 +117,7 @@ def main():
test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text='2dpainting' type='QModelIndex'}"),
"Verifying: The project is shown in 'Edit' mode.")
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
"2dpainting", 5, 5, 0)
activateItem(waitForObjectItem(":Qt Creator.Project.Menu.Project_QMenu",
'Close Project "2dpainting"'))
invokeContextMenuOnProject('2dpainting', 'Close Project "2dpainting"')
navTree = waitForObject(":Qt Creator_Utils::NavigationTreeView")
res = waitFor("navTree.model().rowCount(navTree.rootIndex()) == 0", 2000)
test.verify(not checkIfObjectItemExists(":Qt Creator_Utils::NavigationTreeView", "2dpainting"),
......@@ -165,10 +152,7 @@ def main():
checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"
" text='addressbook' type='QModelIndex'}"),
"Verifying: The project is shown in 'Edit' mode while old project isn't.")
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
"addressbook", 5, 5, 0)
activateItem(waitForObjectItem(":Qt Creator.Project.Menu.Project_QMenu",
'Close Project "addressbook"'))
invokeContextMenuOnProject('addressbook', 'Close Project "addressbook"')
navTree = waitForObject(":Qt Creator_Utils::NavigationTreeView")
res = waitFor("navTree.model().rowCount(navTree.rootIndex()) == 0", 2000)
test.verify(not checkIfObjectItemExists(":Qt Creator_Utils::NavigationTreeView", "addressbook"),
......
......@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAP=../objects.map
TEST_CASES=tst_build_new_project tst_cli_output_console tst_qml_locals tst_simple_analyze tst_simple_debug
TEST_CASES=tst_build_new_project tst_cli_output_console tst_debug_empty_main tst_qml_locals tst_simple_analyze tst_simple_debug
VERSION=2
WRAPPERS=Qt
#############################################################################
##
## Copyright (C) 2013 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 addFileToProject(projectPath, category, fileTemplate, fileName):
__createProjectOrFileSelectType__(category, fileTemplate, isProject=False)
nameLineEdit = waitForObject("{name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' "
"visible='1'}")
replaceEditorContent(nameLineEdit, fileName)
test.compare(waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}").text,
projectPath, "Verifying whether path is correct.")
clickButton(waitForObject(":Next_QPushButton"))
projCombo = waitForObject("{buddy={name='projectLabel' text='Add to project:' type='QLabel' "
"visible='1'} name='projectComboBox' type='QComboBox' visible='1'}")
proFileName = os.path.basename(projectPath) + ".pro"
test.verify(not selectFromCombo(projCombo, proFileName), "Verifying project is selected.")
__createProjectHandleLastPage__()
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
targets = Targets.desktopTargetClasses()
if not checkDebuggingLibrary(Targets.intToArray(targets)):
test.fatal("Error while checking debugging libraries - leaving this test.")
invokeMenuItem("File", "Exit")
return
# empty Qt
workingDir = tempDir()
projectName, checkedTargets = createEmptyQtProject(workingDir, "EmptyQtProj", targets)
addFileToProject(os.path.join(workingDir, projectName), " C++", "C++ Source File", "main.cpp")
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
typeLines(editor, ["int main() {"])
invokeMenuItem("File", "Save All")
performDebugging(workingDir, projectName, checkedTargets)
invokeMenuItem("File", "Close All Projects and Editors")
# C/C++
targets = Targets.intToArray(Targets.desktopTargetClasses())
for name,isC in {"C":True, "CPP":False}.items():
for singleTarget in targets:
workingDir = tempDir()
qtVersion = re.search("\d{3}", Targets.getStringForTarget(singleTarget)).group()
projectName = createNewNonQtProject(workingDir, "Sample%s%s" % (name, qtVersion),
singleTarget, isC)
if projectName == None:
test.fail("Failed to create Sample%s%s" % (name, qtVersion),
"Target: %s, plainC: %s" % (Targets.getStringForTargt(singleTarget), isC))
continue
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
replaceEditorContent(editor, "")
typeLines(editor, ["int main() {"])
invokeMenuItem("File", "Save All")
setRunInTerminal(1, 0, False)
performDebugging(workingDir, projectName, [singleTarget])
invokeMenuItem("File", "Close All Projects and Editors")
invokeMenuItem("File", "Exit")
def __handleAppOutputWaitForDebuggerFinish__():
ensureChecked(":Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton")
appOutput = waitForObject("{type='Core::OutputWindow' visible='1' "
"windowTitle='Application Output Window'}")
test.verify(waitFor("str(appOutput.plainText).endswith('Debugging has finished')", 20000),
"Verifying whether debugging has finished.")
def performDebugging(workingDir, projectName, checkedTargets):
for kit, config in iterateBuildConfigs(len(checkedTargets), "Debug"):
test.log("Selecting '%s' as build config" % config)
selectBuildConfig(len(checkedTargets), kit, config)
verifyBuildConfig(len(checkedTargets), kit, True)