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