Commit 07a52d1a authored by Robert Loehning's avatar Robert Loehning
Browse files

Squish: Remove Qt4 compatibility code



Thank you Qt4 for all the good times we had together.
Farewell.

Change-Id: If0e81b71a97524bb0c84ea5bbcba4c29244a0a5e
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 2978f08b
......@@ -30,8 +30,6 @@
import operator
isQt4Build = False
# for easier re-usage (because Python hasn't an enum type)
class Targets:
DESKTOP_474_GCC = 1
......@@ -107,10 +105,7 @@ class ProjectSettings:
# this class defines some constants for the views of the creator's MainWindow
class ViewConstants:
if isQt4Build:
EDIT, DESIGN, DEBUG, PROJECTS, ANALYZE, HELP = range(6)
else:
WELCOME, EDIT, DESIGN, DEBUG, PROJECTS, ANALYZE, HELP = range(7)
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
......@@ -120,7 +115,7 @@ class ViewConstants:
# if the provided argument does not match any of the ViewConstants it returns None
@staticmethod
def getToolTipForViewTab(viewTab):
if not isQt4Build and viewTab == ViewConstants.WELCOME:
if 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>'
......
......@@ -72,7 +72,7 @@ def overrideStartApplication():
if platform.system() == 'Darwin':
args[0] = args[0].replace('qtcreator', '"Qt Creator"', 1)
test.log("Using workaround for MacOS (different AUT name)")
elif not isQt4Build:
else:
args[0] = args[0] + ' -platform windows:dialogs=none'
test.log("Using workaround for Windows (failing to hook into native FileDialog)")
return __origStartApplication__(*args)
......
......@@ -203,7 +203,7 @@ def invokeMenuItem(menu, item, *subItems):
except:
nativeMouseClick(waitForObject(":Qt Creator_Core::Internal::MainWindow", 1000), 20, 20, 0, Qt.LeftButton)
# HACK to avoid squish crash using Qt5.2 on Squish 5.0.1 - remove asap
if platform.system() == "Darwin" and not isQt4Build:
if platform.system() == "Darwin":
if menu == "Tools" and item == "Options...":
nativeType("<Command+,>")
return
......
......@@ -59,8 +59,6 @@ def __getUrl__():
url = helpViewer.source
except:
return ""
if isQt4Build:
return str(url.toString())
return str(url.scheme) + "://" + str(url.host) + str(url.path)
def getHighlightsInHtml(htmlCode):
......
......@@ -45,10 +45,7 @@ def invokeContextMenuItemOnBookmarkFolder(view, item, menuItem):
"window=':Add Bookmark_BookmarkDialog'}" % aboveWidget), menuItem)
def textForQtVersion(text):
if isQt4Build:
return "QtCreator : " + text
else:
return text + " | QtCreator"
return text + " | QtCreator"
def main():
startApplication("qtcreator" + SettingsPath)
......
......@@ -58,8 +58,8 @@ def waitForButtonsState(projectsChecked, examplesChecked, tutorialsChecked, time
'and tutoButton.checked == tutorialsChecked', timeout)
def main():
if isQt4Build or not canTestEmbeddedQtQuick():
test.log("Welcome mode is not available or not scriptable with this Squish version")
if not canTestEmbeddedQtQuick():
test.log("Welcome mode is not scriptable with this Squish version")
return
global gettingStartedText
# open Qt Creator
......
......@@ -39,8 +39,8 @@ def checkTypeAndProperties(typePropertiesDetails):
"Verifying: Qt Creator displays %s." % detail)
def main():
if isQt4Build or not canTestEmbeddedQtQuick():
test.log("Welcome mode is not available or not scriptable with this Squish version")
if not canTestEmbeddedQtQuick():
test.log("Welcome mode is not scriptable with this Squish version")
return
# prepare example project
sourceExample = os.path.join(sdkPath, "Examples", "4.7", "declarative", "animation", "basics",
......
......@@ -73,8 +73,8 @@ def handlePackagingMessageBoxes():
break
def main():
if isQt4Build or not canTestEmbeddedQtQuick():
test.log("Welcome mode is not available or not scriptable with this Squish version")
if not canTestEmbeddedQtQuick():
test.log("Welcome mode is not scriptable with this Squish version")
return
global sdkPath
# open Qt Creator
......
......@@ -32,8 +32,8 @@ source("../../shared/qtcreator.py")
source("../../shared/suites_qtta.py")
def main():
if isQt4Build or not canTestEmbeddedQtQuick():
test.log("Welcome mode is not available or not scriptable with this Squish version")
if not canTestEmbeddedQtQuick():
test.log("Welcome mode is not scriptable with this Squish version")
return
# open Qt Creator
startApplication("qtcreator" + SettingsPath)
......
......@@ -31,9 +31,6 @@
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,11 +70,7 @@ def main():
else:
pos = size
if key == "<Left>":
if not isQt4Build or platform.system() == "Darwin":
# native cursor behavior on Mac is different in Qt4
pos = 0
else:
pos -= 1
pos = 0
test.compare(editor.textCursor().selectionStart(), pos)
test.compare(editor.textCursor().selectionEnd(), pos)
test.compare(editor.textCursor().position(), pos)
......
......@@ -31,9 +31,6 @@
source("../../shared/qtcreator.py")
def main():
if isQt4Build:
test.log("QbsProjectManager is not available with Qt4")
return
pathCreator = os.path.join(srcPath, "creator", "qtcreator.qbs")
if not neededFilePresent(pathCreator):
return
......
......@@ -52,13 +52,6 @@ def main():
["Resources", "musicbrowser.qrc"],
["QML", "musicbrowser.qml"]]:
filenames = ["ABCD" + filename.upper(), "abcd" + filename.lower(), "test", "TEST", filename]
if isQt4Build and platform.system() == 'Darwin':
# avoid QTCREATORBUG-9197
filtered = [filenames[0]]
for filename in filenames[1:]:
if filename.lower() != filtered[-1].lower():
filtered.append(filename)
filenames = filtered
previous = filenames[-1]
for filename in filenames:
tempFiletype = filetype
......
......@@ -42,7 +42,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 and canTestEmbeddedQtQuick():
if canTestEmbeddedQtQuick():
checkWelcomePage(sessionName, True)
for project in projects:
openQmakeProject(project, Targets.DESKTOP_480_GCC)
......@@ -55,7 +55,7 @@ def main():
switchSession("default")
test.verify(waitFor("'Qt Creator' == str(mainWindow.windowTitle)", 2000),
"Verifying window title is set to default.")
if not isQt4Build and canTestEmbeddedQtQuick():
if canTestEmbeddedQtQuick():
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