Commit d18d7eae authored by Eike Ziller's avatar Eike Ziller
Browse files

Merge remote-tracking branch 'origin/3.6'

Change-Id: I4e1ec4054d7364057c63e63e293a246e64afdddb
parents a081e8c9 5b9350ba
......@@ -24,7 +24,7 @@ DEFINES -= QT_NO_CAST_FROM_ASCII
DISTFILES += Info.plist
unix:!osx:LIBS += -lrt # posix shared memory
unix:!openbsd:!osx: LIBS += -lrt # posix shared memory
osx {
CONFIG -= app_bundle
......
......@@ -6,7 +6,7 @@ contains(CONFIG, dll) {
INCLUDEPATH += $$PWD
unix:LIBS += -ldl
unix:!openbsd: LIBS += -ldl
include(../3rdparty/sqlite/sqlite.pri)
......
......@@ -13,7 +13,7 @@ QtcLibrary {
"SQLITE_ENABLE_COLUMN_METADATA"
])
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 {
......
......@@ -76,6 +76,14 @@ static QStringList qtSoPaths(QtSupport::BaseQtVersion *qtVersion)
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)
{
Target *target = runConfig->target();
......@@ -94,6 +102,7 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.solibSearchPath = AndroidManager::androidQtSupport(target)->soLibSearchPath(target);
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
params.solibSearchPath.append(qtSoPaths(version));
params.solibSearchPath.append(uniquePaths(AndroidManager::androidQtSupport(target)->androidExtraLibs(target)));
}
if (aspect->useQmlDebugger()) {
QTcpServer server;
......
......@@ -56,6 +56,7 @@ public:
public:
virtual bool canHandle(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 Utils::FileName apkPath(ProjectExplorer::Target *target) const;
virtual Utils::FileName androiddeployqtPath(ProjectExplorer::Target *target) const = 0;
......
DEFINES += CORE_LIBRARY
QT += help \
QT += gui-private \
help \
network \
printsupport \
qml \
......
......@@ -34,6 +34,10 @@
#include <QPlainTextEdit>
#include <QTextCursor>
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
#include <private/qtextcursor_p.h>
#endif
namespace Core {
struct BaseTextFindPrivate
......@@ -387,8 +391,13 @@ void BaseTextFind::defineFindScope()
{
QTextCursor cursor = textCursor();
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_findScopeEnd = QTextCursor(document()->docHandle(), cursor.selectionEnd());
#endif
d->m_findScopeVerticalBlockSelectionFirstColumn = -1;
d->m_findScopeVerticalBlockSelectionLastColumn = -1;
......
......@@ -67,6 +67,17 @@ QStringList QmakeAndroidSupport::soLibSearchPath(const ProjectExplorer::Target *
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 apps;
......
......@@ -38,6 +38,7 @@ class QmakeAndroidSupport : public Android::AndroidQtSupport
public:
bool canHandle(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;
Utils::FileName androiddeployqtPath(ProjectExplorer::Target *target) const;
Utils::FileName androiddeployJsonPath(ProjectExplorer::Target *target) const;
......
......@@ -4,7 +4,7 @@ CONFIG += exceptions
INCLUDEPATH += $$PWD
unix:!osx:LIBS += -lrt # posix shared memory
unix:!openbsd:!osx: LIBS += -lrt # posix shared memory
include(../../qtcreatorplugin.pri)
......
DEFINES += TEXTEDITOR_LIBRARY
QT += network printsupport xml
QT += gui-private network printsupport xml
CONFIG += exceptions
CONFIG += include_source_dir # For the highlighter autotest.
include(../../qtcreatorplugin.pri)
......
......@@ -32,6 +32,10 @@
#include <QPainter>
#include <QTextBlock>
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
#include <private/qtextcursor_p.h>
#endif
using namespace TextEditor;
using namespace TextEditor::Internal;
......@@ -87,8 +91,13 @@ void TextEditorOverlay::addOverlaySelection(int begin, int end,
selection.m_fg = fg;
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_end = QTextCursor(document->docHandle(), end);
#endif
if (overlaySelectionFlags & ExpandBegin)
selection.m_cursor_begin.setKeepPositionOnInsert(true);
......
......@@ -680,13 +680,16 @@ def __getSupportedPlatforms__(text, templateName, getAsStrings=False):
return result, version
# 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")
try:
shutil.copytree(sourceExample, templateDir)
except:
test.fatal("Error while copying '%s' to '%s'" % (sourceExample, templateDir))
return None
if deploymentDir:
shutil.copytree(os.path.abspath(sourceExample + deploymentDir),
os.path.abspath(templateDir + deploymentDir))
return templateDir
# check and copy files of given dataset to an existing templateDir
......
......@@ -5,16 +5,16 @@
"" "QCoreApplication qa;" "qa" "." "qa."
"" "QCoreApplication *p;" "p" "." "p->"
"" "QCoreApplication &ref = a;" "ref" "." "ref."
"<QPointer>" "QPointer p;" "p" "." "p."
"<QPointer>" "QPointer *poi;" "poi" "." "poi->"
"<QPointer>" "QPointer &poi;" "poi" "." "poi."
"<QPointer>" "QPointer poi[5];" "poi[2]" "." "poi[2]."
"<QPointer>" "QPointer *poi[5];" "poi[2]" "." "poi[2]->"
"<memory>" "std::auto_ptr sap;" "sap" "." "sap."
"<memory>" "std::auto_ptr *sap;" "sap" "." "sap->"
"<memory>" "std::auto_ptr &sap;" "sap" "." "sap."
"<memory>" "std::auto_ptr sap[10];" "sap[2]" "." "sap[2]."
"<memory>" "std::auto_ptr *sap[10];" "sap[2]" "." "sap[2]->"
"<QPointer>" "QPointer<QCoreApplication> p;" "p" "." "p."
"<QPointer>" "QPointer<QCoreApplication> *poi;" "poi" "." "poi->"
"<QPointer>" "QPointer<QCoreApplication> &poi;" "poi" "." "poi."
"<QPointer>" "QPointer<QCoreApplication> poi[5];" "poi[2]" "." "poi[2]."
"<QPointer>" "QPointer<QCoreApplication> *poi[5];" "poi[2]" "." "poi[2]->"
"<memory>" "std::auto_ptr<QCoreApplication> sap;" "sap" "." "sap."
"<memory>" "std::auto_ptr<QCoreApplication> *sap;" "sap" "." "sap->"
"<memory>" "std::auto_ptr<QCoreApplication> &sap;" "sap" "." "sap."
"<memory>" "std::auto_ptr<QCoreApplication> 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->"
......
......@@ -26,7 +26,7 @@
source("../../shared/qtcreator.py")
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"
if not neededFilePresent(os.path.join(sourceExample, proFile)):
return
......@@ -34,10 +34,10 @@ def main():
if not startedWithoutPluginError():
return
# add docs to have the correct tool tips
addHelpDocumentation([os.path.join(sdkPath, "Documentation", "qt.qch")])
templateDir = prepareTemplate(sourceExample)
openQmakeProject(os.path.join(templateDir, proFile), Targets.DESKTOP_480_DEFAULT)
openDocument("focus.QML.qml.focus\\.qml")
addHelpDocumentation([os.path.join(Qt5Path.getPaths(Qt5Path.DOCS)[0], "qtquick.qch")])
templateDir = prepareTemplate(sourceExample, "/../../helper")
openQmakeProject(os.path.join(templateDir, proFile), Targets.DESKTOP_521_DEFAULT)
openDocument("focus.QML.qml" + os.sep + "focus.focus\\.qml")
testRenameId()
testFindUsages()
testHovering()
......@@ -49,19 +49,20 @@ def testRenameId():
navTree = waitForObject("{type='Utils::NavigationTreeView' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow'}")
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 = {}
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
formerTxt = editor.plainText
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
while formerTxt==editor.plainText:
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
# store content for next round
formerTxt = editor.plainText
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
line = "FocusScope\s*\{"
if not placeCursorToLine(editor, line, True):
......@@ -78,18 +79,18 @@ def testRenameId():
# store editor content for synchronizing purpose
formerTxt = editor.plainText
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
while formerTxt==editor.plainText:
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
# store content for next round
formerTxt = editor.plainText
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")
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")
if not placeCursorToLine(editor, line, True):
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' "
"window=':Qt Creator_Core::Internal::MainWindow'}")
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")
lines=["FocusScope\s*\{", "Rectangle\s*\{"]
if platform.system() == "Darwin":
......@@ -126,15 +127,15 @@ def testHovering():
additionalKeyPresses = [home, "<Right>"]
expectedTypes = ["TextTip", "TextTip"]
expectedValues = [
{'text':'<table><tr><td valign=middle>FocusScope\n<p>The FocusScope object explicitly '
'creates a focus scope.</p></td><td>&nbsp;&nbsp;<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 '
'optional border.</p></td><td>&nbsp;&nbsp;<img src=":/utils/tooltip/images/f1.png"></td></tr></table>'}
{'text':'<table><tr><td valign=middle>FocusScope\n<p>Explicitly '
'creates a focus scope </p></td><td>&nbsp;&nbsp;<img src=":/utils/tooltip/images/f1.png"></td></tr></table>'},
{'text':'<table><tr><td valign=middle>Rectangle\n<p>Paints a filled rectangle with an '
'optional border </p></td><td>&nbsp;&nbsp;<img src=":/utils/tooltip/images/f1.png"></td></tr></table>'}
]
alternativeValues = [{"text":"FocusScope"}, {"text":"Rectangle"}]
verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues)
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")
lines = ['focus:\s*true', 'color:\s*"black"', 'states:\s*State\s*\{', 'transitions:\s*Transition\s*\{']
expectedTypes = ["TextTip", "TextTip", "TextTip", "TextTip"]
......@@ -154,7 +155,7 @@ def testHovering():
alternativeValues = [{"text":"boolean"}, {"text":"string"}, {"text":"State"}, {"text":"Transition"}]
verifyHoveringOnEditor(editor, lines, additionalKeyPresses, expectedTypes, expectedValues, alternativeValues)
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")
lines=['color:\s*"black"', 'color:\s*"#3E606F"']
additionalKeyPresses = ["<Left>"]
......@@ -162,7 +163,7 @@ def testHovering():
alternativeValues = [None, "#39616B"]
expectedTypes = ["ColorTip", "ColorTip"]
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")
lines=['Rectangle\s*\{.*color:\s*"#D1DBBD"', 'NumberAnimation\s*\{\s*.*Easing.OutQuint\s*\}']
additionalKeyPresses = ["<Left>", "<Left>", "<Left>", "<Left>"]
......
......@@ -154,6 +154,12 @@ def verifyClickCommit():
"Verifying that the actual diff editor widgets are readonly.")
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():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
......@@ -172,11 +178,8 @@ def main():
addCPlusPlusFileToCurrentProject(headerName, "C++ Header File", addToVCS="Git",
expectedHeaderName=headerName)
commitMessages.insert(0, commit("Added pointless header file", "Committed 2 file(s)."))
__createProjectOrFileSelectType__(" General", "Empty File", isProject=False)
readmeName = "README.txt"
replaceEditorContent(waitForObject(":New Text File.nameLineEdit_Utils::FileNameValidatingLineEdit"), readmeName)
clickButton(waitForObject(":Next_QPushButton"))
__createProjectHandleLastPage__([readmeName], "Git", "<None>")
addEmptyFileOutsideProject(readmeName)
replaceEditorContent(waitForObject(":Qt Creator_TextEditor::TextEditorWidget"),
"Some important advice in the README")
invokeMenuItem("File", "Save All")
......@@ -202,8 +205,28 @@ def main():
# verifyClickCommit() must be called after the local git has been created and the files
# have been pushed to the repository
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")
def deleteProject():
......
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