Commit 95828d46 authored by Robert Loehning's avatar Robert Loehning

Squish: Handle differences between Qt 4 and Qt 5

Change-Id: I529d5cbd017f7d17fbe2f38fc539583e96d835cf
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent b54ab83b
......@@ -29,6 +29,8 @@
import operator
isQt4Build = False
# for easier re-usage (because Python hasn't an enum type)
class Targets:
DESKTOP_474_GCC = 1
......@@ -96,13 +98,11 @@ class ProjectSettings:
# this class defines some constants for the views of the creator's MainWindow
class ViewConstants:
WELCOME = 0
EDIT = 1
DESIGN = 2
DEBUG = 3
PROJECTS = 4
ANALYZE = 5
HELP = 6
if isQt4Build:
EDIT, DESIGN, DEBUG, PROJECTS, ANALYZE, HELP = range(6)
else:
WELCOME, EDIT, DESIGN, DEBUG, PROJECTS, ANALYZE, HELP = range(7)
FIRST_AVAILABLE = 0
# always adjust the following to the highest value of the available ViewConstants when adding new
LAST_AVAILABLE = HELP
......@@ -111,7 +111,7 @@ class ViewConstants:
# if the provided argument does not match any of the ViewConstants it returns None
@staticmethod
def getToolTipForViewTab(viewTab):
if viewTab == ViewConstants.WELCOME:
if not isQt4Build and viewTab == ViewConstants.WELCOME:
toolTip = ur'Switch to <b>Welcome</b> mode <span style="color: gray; font-size: small">(Ctrl\+|\u2303)%d</span>'
elif viewTab == ViewConstants.EDIT:
toolTip = ur'Switch to <b>Edit</b> mode <span style="color: gray; font-size: small">(Ctrl\+|\u2303)%d</span>'
......
......@@ -34,7 +34,7 @@ def switchViewTo(view):
# make sure that no tooltip is shown, so move the mouse away and wait until all disappear
mouseMove(waitForObject(':Qt Creator_Core::Internal::MainWindow'), -20, -20)
waitFor("not QToolTip.isVisible()", 15000)
if view < ViewConstants.WELCOME or view > ViewConstants.LAST_AVAILABLE:
if view < ViewConstants.FIRST_AVAILABLE or view > ViewConstants.LAST_AVAILABLE:
return
tabBar = waitForObject("{type='Core::Internal::FancyTabBar' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}")
......@@ -168,7 +168,7 @@ def getQtInformationForBuildSettings(kitCount, alreadyOnProjectsBuildSettings=Fa
qtLibPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_LIBPATH)
qtBinPath = getQtInformationByQMakeCall(qtDir, QtInformation.QT_BINPATH)
if afterSwitchTo:
if ViewConstants.WELCOME <= afterSwitchTo <= ViewConstants.LAST_AVAILABLE:
if ViewConstants.FIRST_AVAILABLE <= afterSwitchTo <= ViewConstants.LAST_AVAILABLE:
switchViewTo(afterSwitchTo)
else:
test.warning("Don't know where you trying to switch to (%s)" % afterSwitchTo)
......
......@@ -55,6 +55,9 @@ def clickItemVerifyHelpCombo(qmlItem, expectedHelpComboRegex, testDetails):
"Verifying: Getting Started topic is being displayed.")
def main():
if isQt4Build:
test.log("Welcome mode is only available if Creator was built on Qt 5")
return
global webPageContentLoadedValue, gettingStartedText
# open Qt Creator
startApplication("qtcreator" + SettingsPath)
......
......@@ -31,6 +31,9 @@ source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
def main():
if isQt4Build:
test.log("Welcome mode is only available if Creator was built on Qt 5")
return
# prepare example project
sourceExample = os.path.join(sdkPath, "Examples", "4.7", "declarative", "animation", "basics",
"property-animation")
......
......@@ -60,6 +60,9 @@ def handlePackagingMessageBoxes():
break
def main():
if isQt4Build:
test.log("Welcome mode is only available if Creator was built on Qt 5")
return
global sdkPath, webPageContentLoadedValue
# open Qt Creator
startApplication("qtcreator" + SettingsPath)
......
......@@ -31,6 +31,9 @@ source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
def main():
if isQt4Build:
test.log("Welcome mode is only available if Creator was built on Qt 5")
return
# open Qt Creator
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
......
......@@ -30,6 +30,9 @@
source("../../shared/qtcreator.py")
def main():
if isQt4Build:
test.log("QML Profiler is only available if Creator was built on Qt 5")
return
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
......
......@@ -70,8 +70,8 @@ def main():
else:
pos = size
if key == "<Left>":
if platform.system() == "Darwin":
# native cursor behavior on Mac is different
if not isQt4Build or platform.system() == "Darwin":
# native cursor behavior on Mac is different in Qt4
pos = 0
else:
pos -= 1
......
......@@ -41,6 +41,7 @@ def main():
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
test.verify(waitFor("sessionName in str(mainWindow.windowTitle)", 2000),
"Verifying window title contains created session name.")
if not isQt4Build:
checkWelcomePage(sessionName, True)
for project in projects:
openQmakeProject(project)
......@@ -53,6 +54,7 @@ def main():
switchSession("default")
test.verify(waitFor("'Qt Creator' == str(mainWindow.windowTitle)", 2000),
"Verifying window title is set to default.")
if not isQt4Build:
checkWelcomePage(sessionName, False)
switchViewTo(ViewConstants.EDIT)
checkNavigator(1, "Verifying that no more project is opened.")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment