forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.6'
Change-Id: I4e1ec4054d7364057c63e63e293a246e64afdddb
This commit is contained in:
@@ -24,7 +24,7 @@ DEFINES -= QT_NO_CAST_FROM_ASCII
|
|||||||
|
|
||||||
DISTFILES += Info.plist
|
DISTFILES += Info.plist
|
||||||
|
|
||||||
unix:!osx:LIBS += -lrt # posix shared memory
|
unix:!openbsd:!osx: LIBS += -lrt # posix shared memory
|
||||||
|
|
||||||
osx {
|
osx {
|
||||||
CONFIG -= app_bundle
|
CONFIG -= app_bundle
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ contains(CONFIG, dll) {
|
|||||||
|
|
||||||
INCLUDEPATH += $$PWD
|
INCLUDEPATH += $$PWD
|
||||||
|
|
||||||
unix:LIBS += -ldl
|
unix:!openbsd: LIBS += -ldl
|
||||||
|
|
||||||
include(../3rdparty/sqlite/sqlite.pri)
|
include(../3rdparty/sqlite/sqlite.pri)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ QtcLibrary {
|
|||||||
"SQLITE_ENABLE_COLUMN_METADATA"
|
"SQLITE_ENABLE_COLUMN_METADATA"
|
||||||
])
|
])
|
||||||
cpp.optimization: "fast"
|
cpp.optimization: "fast"
|
||||||
cpp.dynamicLibraries: base.concat(qbs.targetOS.contains("unix") ? ["dl"] : [])
|
cpp.dynamicLibraries: base.concat((qbs.targetOS.contains("unix") && !qbs.targetOS.contains("openbsd")) ? ["dl"] : [])
|
||||||
|
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
|
|||||||
@@ -76,6 +76,14 @@ static QStringList qtSoPaths(QtSupport::BaseQtVersion *qtVersion)
|
|||||||
return paths.toList();
|
return paths.toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static QStringList uniquePaths(const QStringList &files)
|
||||||
|
{
|
||||||
|
QSet<QString> paths;
|
||||||
|
foreach (const QString &file, files)
|
||||||
|
paths<<QFileInfo(file).absolutePath();
|
||||||
|
return paths.toList();
|
||||||
|
}
|
||||||
|
|
||||||
RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *runConfig, QString *errorMessage)
|
RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *runConfig, QString *errorMessage)
|
||||||
{
|
{
|
||||||
Target *target = runConfig->target();
|
Target *target = runConfig->target();
|
||||||
@@ -94,6 +102,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
|
|||||||
params.solibSearchPath = AndroidManager::androidQtSupport(target)->soLibSearchPath(target);
|
params.solibSearchPath = AndroidManager::androidQtSupport(target)->soLibSearchPath(target);
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
|
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
|
||||||
params.solibSearchPath.append(qtSoPaths(version));
|
params.solibSearchPath.append(qtSoPaths(version));
|
||||||
|
params.solibSearchPath.append(uniquePaths(AndroidManager::androidQtSupport(target)->androidExtraLibs(target)));
|
||||||
}
|
}
|
||||||
if (aspect->useQmlDebugger()) {
|
if (aspect->useQmlDebugger()) {
|
||||||
QTcpServer server;
|
QTcpServer server;
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ public:
|
|||||||
public:
|
public:
|
||||||
virtual bool canHandle(const ProjectExplorer::Target *target) const = 0;
|
virtual bool canHandle(const ProjectExplorer::Target *target) const = 0;
|
||||||
virtual QStringList soLibSearchPath(const ProjectExplorer::Target *target) const = 0;
|
virtual QStringList soLibSearchPath(const ProjectExplorer::Target *target) const = 0;
|
||||||
|
virtual QStringList androidExtraLibs(const ProjectExplorer::Target *target) const = 0;
|
||||||
virtual QStringList projectTargetApplications(const ProjectExplorer::Target *target) const = 0;
|
virtual QStringList projectTargetApplications(const ProjectExplorer::Target *target) const = 0;
|
||||||
virtual Utils::FileName apkPath(ProjectExplorer::Target *target) const;
|
virtual Utils::FileName apkPath(ProjectExplorer::Target *target) const;
|
||||||
virtual Utils::FileName androiddeployqtPath(ProjectExplorer::Target *target) const = 0;
|
virtual Utils::FileName androiddeployqtPath(ProjectExplorer::Target *target) const = 0;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
DEFINES += CORE_LIBRARY
|
DEFINES += CORE_LIBRARY
|
||||||
QT += help \
|
QT += gui-private \
|
||||||
|
help \
|
||||||
network \
|
network \
|
||||||
printsupport \
|
printsupport \
|
||||||
qml \
|
qml \
|
||||||
|
|||||||
@@ -34,6 +34,10 @@
|
|||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
#include <QTextCursor>
|
#include <QTextCursor>
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||||
|
#include <private/qtextcursor_p.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
struct BaseTextFindPrivate
|
struct BaseTextFindPrivate
|
||||||
@@ -387,8 +391,13 @@ void BaseTextFind::defineFindScope()
|
|||||||
{
|
{
|
||||||
QTextCursor cursor = textCursor();
|
QTextCursor cursor = textCursor();
|
||||||
if (cursor.hasSelection() && cursor.block() != cursor.document()->findBlock(cursor.anchor())) {
|
if (cursor.hasSelection() && cursor.block() != cursor.document()->findBlock(cursor.anchor())) {
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5,6,0)
|
||||||
|
d->m_findScopeStart = QTextCursorPrivate::fromPosition(document()->docHandle(), qMax(0, cursor.selectionStart()));
|
||||||
|
d->m_findScopeEnd = QTextCursorPrivate::fromPosition(document()->docHandle(), cursor.selectionEnd());
|
||||||
|
#else
|
||||||
d->m_findScopeStart = QTextCursor(document()->docHandle(), qMax(0, cursor.selectionStart()));
|
d->m_findScopeStart = QTextCursor(document()->docHandle(), qMax(0, cursor.selectionStart()));
|
||||||
d->m_findScopeEnd = QTextCursor(document()->docHandle(), cursor.selectionEnd());
|
d->m_findScopeEnd = QTextCursor(document()->docHandle(), cursor.selectionEnd());
|
||||||
|
#endif
|
||||||
d->m_findScopeVerticalBlockSelectionFirstColumn = -1;
|
d->m_findScopeVerticalBlockSelectionFirstColumn = -1;
|
||||||
d->m_findScopeVerticalBlockSelectionLastColumn = -1;
|
d->m_findScopeVerticalBlockSelectionLastColumn = -1;
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,17 @@ QStringList QmakeAndroidSupport::soLibSearchPath(const ProjectExplorer::Target *
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList QmakeAndroidSupport::androidExtraLibs(const ProjectExplorer::Target *target) const
|
||||||
|
{
|
||||||
|
ProjectExplorer::RunConfiguration *rc = target->activeRunConfiguration();
|
||||||
|
QmakeAndroidRunConfiguration *qarc = qobject_cast<QmakeAndroidRunConfiguration *>(rc);
|
||||||
|
if (!qarc)
|
||||||
|
return QStringList();
|
||||||
|
auto project = static_cast<QmakeProject *>(target->project());
|
||||||
|
QmakeProFileNode *node = project->rootQmakeProjectNode()->findProFileFor(qarc->proFilePath());
|
||||||
|
return node->variableValue(QmakeProjectManager::AndroidExtraLibs);
|
||||||
|
}
|
||||||
|
|
||||||
QStringList QmakeAndroidSupport::projectTargetApplications(const ProjectExplorer::Target *target) const
|
QStringList QmakeAndroidSupport::projectTargetApplications(const ProjectExplorer::Target *target) const
|
||||||
{
|
{
|
||||||
QStringList apps;
|
QStringList apps;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ class QmakeAndroidSupport : public Android::AndroidQtSupport
|
|||||||
public:
|
public:
|
||||||
bool canHandle(const ProjectExplorer::Target *target) const;
|
bool canHandle(const ProjectExplorer::Target *target) const;
|
||||||
QStringList soLibSearchPath(const ProjectExplorer::Target *target) const;
|
QStringList soLibSearchPath(const ProjectExplorer::Target *target) const;
|
||||||
|
QStringList androidExtraLibs(const ProjectExplorer::Target *target) const override;
|
||||||
QStringList projectTargetApplications(const ProjectExplorer::Target *target) const;
|
QStringList projectTargetApplications(const ProjectExplorer::Target *target) const;
|
||||||
Utils::FileName androiddeployqtPath(ProjectExplorer::Target *target) const;
|
Utils::FileName androiddeployqtPath(ProjectExplorer::Target *target) const;
|
||||||
Utils::FileName androiddeployJsonPath(ProjectExplorer::Target *target) const;
|
Utils::FileName androiddeployJsonPath(ProjectExplorer::Target *target) const;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ CONFIG += exceptions
|
|||||||
|
|
||||||
INCLUDEPATH += $$PWD
|
INCLUDEPATH += $$PWD
|
||||||
|
|
||||||
unix:!osx:LIBS += -lrt # posix shared memory
|
unix:!openbsd:!osx: LIBS += -lrt # posix shared memory
|
||||||
|
|
||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
DEFINES += TEXTEDITOR_LIBRARY
|
DEFINES += TEXTEDITOR_LIBRARY
|
||||||
QT += network printsupport xml
|
QT += gui-private network printsupport xml
|
||||||
CONFIG += exceptions
|
CONFIG += exceptions
|
||||||
CONFIG += include_source_dir # For the highlighter autotest.
|
CONFIG += include_source_dir # For the highlighter autotest.
|
||||||
include(../../qtcreatorplugin.pri)
|
include(../../qtcreatorplugin.pri)
|
||||||
|
|||||||
@@ -32,6 +32,10 @@
|
|||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||||
|
#include <private/qtextcursor_p.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
using namespace TextEditor::Internal;
|
using namespace TextEditor::Internal;
|
||||||
|
|
||||||
@@ -87,8 +91,13 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end,
|
|||||||
selection.m_fg = fg;
|
selection.m_fg = fg;
|
||||||
selection.m_bg = bg;
|
selection.m_bg = bg;
|
||||||
|
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5,6,0)
|
||||||
|
selection.m_cursor_begin = QTextCursorPrivate::fromPosition(document->docHandle(), begin);
|
||||||
|
selection.m_cursor_end = QTextCursorPrivate::fromPosition(document->docHandle(), end);
|
||||||
|
#else
|
||||||
selection.m_cursor_begin = QTextCursor(document->docHandle(), begin);
|
selection.m_cursor_begin = QTextCursor(document->docHandle(), begin);
|
||||||
selection.m_cursor_end = QTextCursor(document->docHandle(), end);
|
selection.m_cursor_end = QTextCursor(document->docHandle(), end);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (overlaySelectionFlags & ExpandBegin)
|
if (overlaySelectionFlags & ExpandBegin)
|
||||||
selection.m_cursor_begin.setKeepPositionOnInsert(true);
|
selection.m_cursor_begin.setKeepPositionOnInsert(true);
|
||||||
|
|||||||
@@ -680,13 +680,16 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
|
|||||||
return result, version
|
return result, version
|
||||||
|
|
||||||
# copy example project (sourceExample is path to project) to temporary directory inside repository
|
# copy example project (sourceExample is path to project) to temporary directory inside repository
|
||||||
def prepareTemplate(sourceExample):
|
def prepareTemplate(sourceExample, deploymentDir=None):
|
||||||
templateDir = os.path.abspath(tempDir() + "/template")
|
templateDir = os.path.abspath(tempDir() + "/template")
|
||||||
try:
|
try:
|
||||||
shutil.copytree(sourceExample, templateDir)
|
shutil.copytree(sourceExample, templateDir)
|
||||||
except:
|
except:
|
||||||
test.fatal("Error while copying '%s' to '%s'" % (sourceExample, templateDir))
|
test.fatal("Error while copying '%s' to '%s'" % (sourceExample, templateDir))
|
||||||
return None
|
return None
|
||||||
|
if deploymentDir:
|
||||||
|
shutil.copytree(os.path.abspath(sourceExample + deploymentDir),
|
||||||
|
os.path.abspath(templateDir + deploymentDir))
|
||||||
return templateDir
|
return templateDir
|
||||||
|
|
||||||
# check and copy files of given dataset to an existing templateDir
|
# check and copy files of given dataset to an existing templateDir
|
||||||
|
|||||||
@@ -5,16 +5,16 @@
|
|||||||
"" "QCoreApplication qa;" "qa" "." "qa."
|
"" "QCoreApplication qa;" "qa" "." "qa."
|
||||||
"" "QCoreApplication *p;" "p" "." "p->"
|
"" "QCoreApplication *p;" "p" "." "p->"
|
||||||
"" "QCoreApplication &ref = a;" "ref" "." "ref."
|
"" "QCoreApplication &ref = a;" "ref" "." "ref."
|
||||||
"<QPointer>" "QPointer p;" "p" "." "p."
|
"<QPointer>" "QPointer<QCoreApplication> p;" "p" "." "p."
|
||||||
"<QPointer>" "QPointer *poi;" "poi" "." "poi->"
|
"<QPointer>" "QPointer<QCoreApplication> *poi;" "poi" "." "poi->"
|
||||||
"<QPointer>" "QPointer &poi;" "poi" "." "poi."
|
"<QPointer>" "QPointer<QCoreApplication> &poi;" "poi" "." "poi."
|
||||||
"<QPointer>" "QPointer poi[5];" "poi[2]" "." "poi[2]."
|
"<QPointer>" "QPointer<QCoreApplication> poi[5];" "poi[2]" "." "poi[2]."
|
||||||
"<QPointer>" "QPointer *poi[5];" "poi[2]" "." "poi[2]->"
|
"<QPointer>" "QPointer<QCoreApplication> *poi[5];" "poi[2]" "." "poi[2]->"
|
||||||
"<memory>" "std::auto_ptr sap;" "sap" "." "sap."
|
"<memory>" "std::auto_ptr<QCoreApplication> sap;" "sap" "." "sap."
|
||||||
"<memory>" "std::auto_ptr *sap;" "sap" "." "sap->"
|
"<memory>" "std::auto_ptr<QCoreApplication> *sap;" "sap" "." "sap->"
|
||||||
"<memory>" "std::auto_ptr &sap;" "sap" "." "sap."
|
"<memory>" "std::auto_ptr<QCoreApplication> &sap;" "sap" "." "sap."
|
||||||
"<memory>" "std::auto_ptr sap[10];" "sap[2]" "." "sap[2]."
|
"<memory>" "std::auto_ptr<QCoreApplication> sap[10];" "sap[2]" "." "sap[2]."
|
||||||
"<memory>" "std::auto_ptr *sap[10];" "sap[2]" "." "sap[2]->"
|
"<memory>" "std::auto_ptr<QCoreApplication> *sap[10];" "sap[2]" "." "sap[2]->"
|
||||||
"<QVector>" "QVector<QCoreApplication> vec;" "vec" "." "vec."
|
"<QVector>" "QVector<QCoreApplication> vec;" "vec" "." "vec."
|
||||||
"<QVector>" "QVector<QCoreApplication *> vec;" "vec" "." "vec."
|
"<QVector>" "QVector<QCoreApplication *> vec;" "vec" "." "vec."
|
||||||
"<QVector>" "QVector<QCoreApplication> *vec;" "vec" "." "vec->"
|
"<QVector>" "QVector<QCoreApplication> *vec;" "vec" "." "vec->"
|
||||||
|
|||||||
|
@@ -26,7 +26,7 @@
|
|||||||
source("../../shared/qtcreator.py")
|
source("../../shared/qtcreator.py")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/keyinteraction/focus")
|
sourceExample = os.path.abspath(Qt5Path.getPaths(Qt5Path.EXAMPLES)[0] + "/declarative/keyinteraction/focus")
|
||||||
proFile = "focus.pro"
|
proFile = "focus.pro"
|
||||||
if not neededFilePresent(os.path.join(sourceExample, proFile)):
|
if not neededFilePresent(os.path.join(sourceExample, proFile)):
|
||||||
return
|
return
|
||||||
@@ -34,10 +34,10 @@ def main():
|
|||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
return
|
return
|
||||||
# add docs to have the correct tool tips
|
# add docs to have the correct tool tips
|
||||||
addHelpDocumentation([os.path.join(sdkPath, "Documentation", "qt.qch")])
|
addHelpDocumentation([os.path.join(Qt5Path.getPaths(Qt5Path.DOCS)[0], "qtquick.qch")])
|
||||||
templateDir = prepareTemplate(sourceExample)
|
templateDir = prepareTemplate(sourceExample, "/../../helper")
|
||||||
openQmakeProject(os.path.join(templateDir, proFile), Targets.DESKTOP_480_DEFAULT)
|
openQmakeProject(os.path.join(templateDir, proFile), Targets.DESKTOP_521_DEFAULT)
|
||||||
openDocument("focus.QML.qml.focus\\.qml")
|
openDocument("focus.QML.qml" + os.sep + "focus.focus\\.qml")
|
||||||
testRenameId()
|
testRenameId()
|
||||||
testFindUsages()
|
testFindUsages()
|
||||||
testHovering()
|
testHovering()
|
||||||
@@ -49,19 +49,20 @@ def testRenameId():
|
|||||||
navTree = waitForObject("{type='Utils::NavigationTreeView' unnamed='1' visible='1' "
|
navTree = waitForObject("{type='Utils::NavigationTreeView' unnamed='1' visible='1' "
|
||||||
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
||||||
model = navTree.model()
|
model = navTree.model()
|
||||||
files = ["Core.ContextMenu\\.qml", "Core.GridMenu\\.qml", "Core.ListMenu\\.qml", "focus\\.qml"]
|
files = ["FocusCore.ContextMenu\\.qml", "FocusCore.GridMenu\\.qml",
|
||||||
|
"FocusCore.ListMenu\\.qml", "focus\\.qml"]
|
||||||
originalTexts = {}
|
originalTexts = {}
|
||||||
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
||||||
formerTxt = editor.plainText
|
formerTxt = editor.plainText
|
||||||
for file in files:
|
for file in files:
|
||||||
openDocument("focus.QML.qml.%s" % file)
|
openDocument("focus.QML.qml" + os.sep + "focus.%s" % file)
|
||||||
# wait until editor content switched to the double-clicked file
|
# wait until editor content switched to the double-clicked file
|
||||||
while formerTxt==editor.plainText:
|
while formerTxt==editor.plainText:
|
||||||
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
||||||
# store content for next round
|
# store content for next round
|
||||||
formerTxt = editor.plainText
|
formerTxt = editor.plainText
|
||||||
originalTexts.setdefault(file, "%s" % formerTxt)
|
originalTexts.setdefault(file, "%s" % formerTxt)
|
||||||
test.log("stored %s's content" % file.replace("Core.","").replace("\\",""))
|
test.log("stored %s's content" % file.replace("FocusCore.","").replace("\\",""))
|
||||||
# last opened file is the main file focus.qml
|
# last opened file is the main file focus.qml
|
||||||
line = "FocusScope\s*\{"
|
line = "FocusScope\s*\{"
|
||||||
if not placeCursorToLine(editor, line, True):
|
if not placeCursorToLine(editor, line, True):
|
||||||
@@ -78,18 +79,18 @@ def testRenameId():
|
|||||||
# store editor content for synchronizing purpose
|
# store editor content for synchronizing purpose
|
||||||
formerTxt = editor.plainText
|
formerTxt = editor.plainText
|
||||||
for file in files:
|
for file in files:
|
||||||
openDocument("focus.QML.qml.%s" % file)
|
openDocument("focus.QML.qml" + os.sep + "focus.%s" % file)
|
||||||
# wait until editor content switched to double-clicked file
|
# wait until editor content switched to double-clicked file
|
||||||
while formerTxt==editor.plainText:
|
while formerTxt==editor.plainText:
|
||||||
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
||||||
# store content for next round
|
# store content for next round
|
||||||
formerTxt = editor.plainText
|
formerTxt = editor.plainText
|
||||||
originalText = originalTexts.get(file).replace("mainView", "renamedView")
|
originalText = originalTexts.get(file).replace("mainView", "renamedView")
|
||||||
test.compare(originalText,formerTxt, "Comparing %s" % file.replace("Core.","").replace("\\",""))
|
test.compare(originalText,formerTxt, "Comparing %s" % file.replace("FocusCore.","").replace("\\",""))
|
||||||
invokeMenuItem("File","Save All")
|
invokeMenuItem("File","Save All")
|
||||||
|
|
||||||
def __invokeFindUsage__(treeView, filename, line, additionalKeyPresses, expectedCount):
|
def __invokeFindUsage__(treeView, filename, line, additionalKeyPresses, expectedCount):
|
||||||
openDocument("focus.QML.qml.%s" % filename)
|
openDocument("focus.QML.qml" + os.sep + "focus.%s" % filename)
|
||||||
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
||||||
if not placeCursorToLine(editor, line, True):
|
if not placeCursorToLine(editor, line, True):
|
||||||
test.fatal("File seems to have changed... Canceling current test")
|
test.fatal("File seems to have changed... Canceling current test")
|
||||||
@@ -116,7 +117,7 @@ def testHovering():
|
|||||||
navTree = waitForObject("{type='Utils::NavigationTreeView' unnamed='1' visible='1' "
|
navTree = waitForObject("{type='Utils::NavigationTreeView' unnamed='1' visible='1' "
|
||||||
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
||||||
test.log("Testing hovering elements")
|
test.log("Testing hovering elements")
|
||||||
openDocument("focus.QML.qml.focus\\.qml")
|
openDocument("focus.QML.qml" + os.sep + "focus.focus\\.qml")
|
||||||
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
||||||
lines=["FocusScope\s*\{", "Rectangle\s*\{"]
|
lines=["FocusScope\s*\{", "Rectangle\s*\{"]
|
||||||
if platform.system() == "Darwin":
|
if platform.system() == "Darwin":
|
||||||
@@ -126,15 +127,15 @@ def testHovering():
|
|||||||
additionalKeyPresses = [home, "<Right>"]
|
additionalKeyPresses = [home, "<Right>"]
|
||||||
expectedTypes = ["TextTip", "TextTip"]
|
expectedTypes = ["TextTip", "TextTip"]
|
||||||
expectedValues = [
|
expectedValues = [
|
||||||
{'text':'<table><tr><td valign=middle>FocusScope\n<p>The FocusScope object explicitly '
|
{'text':'<table><tr><td valign=middle>FocusScope\n<p>Explicitly '
|
||||||
'creates a focus scope.</p></td><td> <img src=":/utils/tooltip/images/f1.png"></td></tr></table>'},
|
'creates a focus scope </p></td><td> <img src=":/utils/tooltip/images/f1.png"></td></tr></table>'},
|
||||||
{'text':'<table><tr><td valign=middle>Rectangle\n<p>The Rectangle item provides a filled rectangle with an '
|
{'text':'<table><tr><td valign=middle>Rectangle\n<p>Paints a filled rectangle with an '
|
||||||
'optional border.</p></td><td> <img src=":/utils/tooltip/images/f1.png"></td></tr></table>'}
|
'optional border </p></td><td> <img src=":/utils/tooltip/images/f1.png"></td></tr></table>'}
|
||||||
]
|
]
|
||||||
alternativeValues = [{"text":"FocusScope"}, {"text":"Rectangle"}]
|
alternativeValues = [{"text":"FocusScope"}, {"text":"Rectangle"}]
|
||||||
verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues)
|
verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues)
|
||||||
test.log("Testing hovering properties")
|
test.log("Testing hovering properties")
|
||||||
openDocument("focus.QML.qml.focus\\.qml")
|
openDocument("focus.QML.qml" + os.sep + "focus.focus\\.qml")
|
||||||
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
||||||
lines = ['focus:\s*true', 'color:\s*"black"', 'states:\s*State\s*\{', 'transitions:\s*Transition\s*\{']
|
lines = ['focus:\s*true', 'color:\s*"black"', 'states:\s*State\s*\{', 'transitions:\s*Transition\s*\{']
|
||||||
expectedTypes = ["TextTip", "TextTip", "TextTip", "TextTip"]
|
expectedTypes = ["TextTip", "TextTip", "TextTip", "TextTip"]
|
||||||
@@ -154,7 +155,7 @@ def testHovering():
|
|||||||
alternativeValues = [{"text":"boolean"}, {"text":"string"}, {"text":"State"}, {"text":"Transition"}]
|
alternativeValues = [{"text":"boolean"}, {"text":"string"}, {"text":"State"}, {"text":"Transition"}]
|
||||||
verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues)
|
verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues)
|
||||||
test.log("Testing hovering expressions")
|
test.log("Testing hovering expressions")
|
||||||
openDocument("focus.QML.qml.focus\\.qml")
|
openDocument("focus.QML.qml" + os.sep + "focus.focus\\.qml")
|
||||||
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
||||||
lines=['color:\s*"black"', 'color:\s*"#3E606F"']
|
lines=['color:\s*"black"', 'color:\s*"#3E606F"']
|
||||||
additionalKeyPresses = ["<Left>"]
|
additionalKeyPresses = ["<Left>"]
|
||||||
@@ -162,7 +163,7 @@ def testHovering():
|
|||||||
alternativeValues = [None, "#39616B"]
|
alternativeValues = [None, "#39616B"]
|
||||||
expectedTypes = ["ColorTip", "ColorTip"]
|
expectedTypes = ["ColorTip", "ColorTip"]
|
||||||
verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues)
|
verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues)
|
||||||
openDocument("focus.QML.qml.Core.ListMenu\\.qml")
|
openDocument("focus.QML.qml" + os.sep + "focus.FocusCore.ListMenu\\.qml")
|
||||||
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
||||||
lines=['Rectangle\s*\{.*color:\s*"#D1DBBD"', 'NumberAnimation\s*\{\s*.*Easing.OutQuint\s*\}']
|
lines=['Rectangle\s*\{.*color:\s*"#D1DBBD"', 'NumberAnimation\s*\{\s*.*Easing.OutQuint\s*\}']
|
||||||
additionalKeyPresses = ["<Left>", "<Left>", "<Left>", "<Left>"]
|
additionalKeyPresses = ["<Left>", "<Left>", "<Left>", "<Left>"]
|
||||||
|
|||||||
@@ -154,6 +154,12 @@ def verifyClickCommit():
|
|||||||
"Verifying that the actual diff editor widgets are readonly.")
|
"Verifying that the actual diff editor widgets are readonly.")
|
||||||
invokeMenuItem("Tools", "Git", "Local Repository", "Log")
|
invokeMenuItem("Tools", "Git", "Local Repository", "Log")
|
||||||
|
|
||||||
|
def addEmptyFileOutsideProject(filename):
|
||||||
|
__createProjectOrFileSelectType__(" General", "Empty File", isProject=False)
|
||||||
|
replaceEditorContent(waitForObject(":New Text File.nameLineEdit_Utils::FileNameValidatingLineEdit"), filename)
|
||||||
|
clickButton(waitForObject(":Next_QPushButton"))
|
||||||
|
__createProjectHandleLastPage__([filename], "Git", "<None>")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
if not startedWithoutPluginError():
|
if not startedWithoutPluginError():
|
||||||
@@ -172,11 +178,8 @@ def main():
|
|||||||
addCPlusPlusFileToCurrentProject(headerName, "C++ Header File", addToVCS="Git",
|
addCPlusPlusFileToCurrentProject(headerName, "C++ Header File", addToVCS="Git",
|
||||||
expectedHeaderName=headerName)
|
expectedHeaderName=headerName)
|
||||||
commitMessages.insert(0, commit("Added pointless header file", "Committed 2 file(s)."))
|
commitMessages.insert(0, commit("Added pointless header file", "Committed 2 file(s)."))
|
||||||
__createProjectOrFileSelectType__(" General", "Empty File", isProject=False)
|
|
||||||
readmeName = "README.txt"
|
readmeName = "README.txt"
|
||||||
replaceEditorContent(waitForObject(":New Text File.nameLineEdit_Utils::FileNameValidatingLineEdit"), readmeName)
|
addEmptyFileOutsideProject(readmeName)
|
||||||
clickButton(waitForObject(":Next_QPushButton"))
|
|
||||||
__createProjectHandleLastPage__([readmeName], "Git", "<None>")
|
|
||||||
replaceEditorContent(waitForObject(":Qt Creator_TextEditor::TextEditorWidget"),
|
replaceEditorContent(waitForObject(":Qt Creator_TextEditor::TextEditorWidget"),
|
||||||
"Some important advice in the README")
|
"Some important advice in the README")
|
||||||
invokeMenuItem("File", "Save All")
|
invokeMenuItem("File", "Save All")
|
||||||
@@ -202,8 +205,28 @@ def main():
|
|||||||
# verifyClickCommit() must be called after the local git has been created and the files
|
# verifyClickCommit() must be called after the local git has been created and the files
|
||||||
# have been pushed to the repository
|
# have been pushed to the repository
|
||||||
verifyClickCommit()
|
verifyClickCommit()
|
||||||
invokeMenuItem("File", "Close All Projects and Editors")
|
# test for QTCREATORBUG-15051
|
||||||
|
addEmptyFileOutsideProject("anotherFile.txt")
|
||||||
|
fakeIdCommitMessage = "deadbeefdeadbeefdeadbeef is not a commit id"
|
||||||
|
commit(fakeIdCommitMessage, "Committed 1 file(s).")
|
||||||
|
invokeMenuItem("Tools", "Git", "Local Repository", "Log")
|
||||||
|
gitEditor = waitForObject(":Qt Creator_Git::Internal::GitEditor")
|
||||||
|
waitFor("len(str(gitEditor.plainText)) > 0 and str(gitEditor.plainText) != 'Working...'", 20000)
|
||||||
|
placeCursorToLine(gitEditor, fakeIdCommitMessage)
|
||||||
|
if platform.system() == 'Darwin':
|
||||||
|
type(gitEditor, "<Ctrl+Left>")
|
||||||
|
else:
|
||||||
|
type(gitEditor, "<Home>")
|
||||||
|
for _ in range(5):
|
||||||
|
type(gitEditor, "<Right>")
|
||||||
|
rect = gitEditor.cursorRect(gitEditor.textCursor())
|
||||||
|
mouseClick(gitEditor, rect.x+rect.width/2, rect.y+rect.height/2, 0, Qt.LeftButton)
|
||||||
|
changed = waitForObject(":Qt Creator_DiffEditor::SideDiffEditorWidget")
|
||||||
|
waitFor('str(changed.plainText) != "Waiting for data..."', 5000)
|
||||||
|
test.compare(str(changed.plainText), "Failed",
|
||||||
|
"Showing an invalid commit can't succeed but Creator survived.")
|
||||||
|
|
||||||
|
invokeMenuItem("File", "Close All Projects and Editors")
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
def deleteProject():
|
def deleteProject():
|
||||||
|
|||||||
Reference in New Issue
Block a user