Commit 0fb641c9 authored by Eike Ziller's avatar Eike Ziller

Merge remote-tracking branch 'origin/3.1'

Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/libs/qmljs/qmljsmodelmanagerinterface.cpp
	src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp

Change-Id: Ie216b715d6f87a6d72d3b8fe3d4e777e561579f9
parents f4520baf 4b2cc015
......@@ -79,6 +79,9 @@ ApplicationWindow {
var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
if (isNaN(newX) || isNaN(newY))
return;
if (newX < 0)
newX = 0
......
......@@ -614,6 +614,12 @@
view, making it seem like the program was interrupted before entering the
function.
To find out which QML file is causing a Qt Quick 2 application to crash,
select \gui {Load QML Stack} in the context menu in the \gui{Stack} view.
The debugger tries to retrieve the JavaScript stack from the stopped
executable and prepends the frames to the C++ frames, should it find any.
You can click a frame in the QML stack to open the QML file in the editor.
\section1 Locals and Expressions
Whenever a program stops under the control of the debugger, it retrieves
......
......@@ -176,4 +176,18 @@
reparsed automatically. For all other files, you can use \gui{Tools} >
\gui{C++} > \gui{Reparse Externally Changed Files} to update the code
model.
\section1 Inspecting the Code Model
When you report a bug that is related to the C++ code model, the \QC
developers might ask you to write information about the internal state of
the code model into a log file and to deliver the file to them for
inspection.
To view information about the C++ code model in the
\gui {C++ Code Model Inspector} dialog and write it to a log file, select
\gui Tools > \gui C++ > \gui {Inspect C++ Code Model} or press
\key {Ctrl+Shift+F12}.
\QC generates the code model inspection log file in a temporary folder.
*/
......@@ -196,6 +196,9 @@
\skipto onReadingChanged
\printuntil }
We want to ensure that the position of the bubble is always within
the bounds of the screen. If the Accelerometer returns not a number
(NaN), the value is ignored and the bubble position is not updated.
\li Add SmoothedAnimation behavior on the \a x and \a y properties of
the bubble to make its movement look smoother.
......
......@@ -27,7 +27,7 @@ DynamicLibrary {
: ["$ORIGIN", "$ORIGIN/.."]
property string libIncludeBase: ".." // #include <lib/header.h>
cpp.includePaths: [libIncludeBase]
cpp.minimumWindowsVersion: "5.1"
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
Export {
Depends { name: "cpp" }
......
......@@ -39,7 +39,7 @@ Product {
property string pluginIncludeBase: ".." // #include <plugin/header.h>
cpp.includePaths: [pluginIncludeBase]
cpp.minimumWindowsVersion: "5.1"
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
Group {
name: "PluginSpec"
......
......@@ -18,7 +18,7 @@ Application {
cpp.rpaths: qbs.targetOS.contains("osx")
? ["@executable_path/../" + project.ide_library_path]
: ["$ORIGIN/../" + project.ide_library_path]
cpp.minimumWindowsVersion: "5.1"
cpp.minimumWindowsVersion: qbs.architecture === "x86" ? "5.1" : "5.2"
Group {
fileTagsFilter: product.type
......
......@@ -45,7 +45,7 @@ Project {
property string ide_bin_path: qbs.targetOS.contains("osx")
? ide_app_target + ".app/Contents/MacOS"
: ide_app_path
property bool testsEnabled: qbs.getenv("TEST") || qbs.buildVariant === "debug"
property bool testsEnabled: qbs.getEnv("TEST") || qbs.buildVariant === "debug"
property stringList generalDefines: [
"QT_CREATOR",
'IDE_LIBRARY_BASENAME="' + libDirName + '"',
......
......@@ -156,8 +156,6 @@ ButtonRow {
onClicked: {
if (checked) {
anchorBackend.leftAnchored = false;
anchorBackend.rightAnchored = false;
anchorBackend.topAnchored = false;
anchorBackend.bottomAnchored = false;
anchorBackend.verticalCentered = true;
......
......@@ -30,6 +30,7 @@
import QtQuick 2.1
import QtQuick.Controls 1.0 as Controls
import QtQuick.Layouts 1.0
import QtQuick.Controls.Private 1.0
Item {
id: buttonRowButton
......@@ -41,6 +42,8 @@ Item {
signal clicked()
property string tooltip: ""
width: 24 + leftPadding
height: 24
......@@ -94,6 +97,7 @@ Item {
}
MouseArea {
id: mouseArea
anchors.fill: parent
anchors.leftMargin: leftPadding
onClicked: {
......@@ -104,5 +108,16 @@ Item {
}
buttonRowButton.clicked()
}
onExited: Tooltip.hideText()
onCanceled: Tooltip.hideText()
hoverEnabled: true
Timer {
interval: 1000
running: mouseArea.containsMouse && tooltip.length
onTriggered: Tooltip.showText(mouseArea, Qt.point(mouseArea.mouseX, mouseArea.mouseY), tooltip)
}
}
}
......@@ -142,7 +142,7 @@ Column {
}
ColorCheckButton {
id: checkButton
color: colorButton.color
color: backendendValue.value
}
ButtonRow {
......
......@@ -158,6 +158,15 @@ Rectangle {
anchors.right: parent.right
frameVisible: false
id: tabView
height: Math.max(layoutSectionHeight, specficsHeight)
property int layoutSectionHeight
property int specficsOneHeight: 0
property int specficsTwoHeight: 0
property int specficsHeight: Math.max(specficsOneHeight, specficsTwoHeight)
Tab {
title: backendValues.className.value
......@@ -178,6 +187,10 @@ Rectangle {
active = false
active = true
}
onLoaded: {
tabView.specficsTwoHeight = specificsTwo.item.height + 40
}
}
Loader {
......@@ -186,6 +199,10 @@ Rectangle {
id: specificsOne;
source: specificsUrl;
onLoaded: {
tabView.specficsOneHeight = specificsOne.item.height + 40
}
}
}
}
......@@ -197,6 +214,10 @@ Rectangle {
anchors.right: parent.right
LayoutSection {
Component.onCompleted: {
tabView.layoutSectionHeight = childrenRect.height
}
}
}
}
......
......@@ -84,6 +84,5 @@ Column {
}
TextInputSection {
showEchoMode: false
}
}
......@@ -37,7 +37,7 @@ Section {
anchors.right: parent.right
caption: qsTr("Text Input")
property bool showEchoMode: false
property bool isTextInput: false
id: textInputSection
SectionLayout {
......@@ -46,21 +46,23 @@ Section {
Label {
visible: textInputSection.isTextInput
text: qsTr("Input mask")
}
LineEdit {
visible: textInputSection.isTextInput
backendValue: backendValues.inputMask
Layout.fillWidth: true
}
Label {
visible: textInputSection.showEchoMode
visible: textInputSection.isTextInput
text: qsTr("Echo mode")
}
ComboBox {
visible: textInputSection.showEchoMode
visible: textInputSection.isTextInput
Layout.fillWidth: true
backendValue: backendValues.echoMode
scope: "TextInput"
......@@ -68,11 +70,13 @@ Section {
}
Label {
visible: textInputSection.isTextInput
text: qsTr("Pass. char")
toolTip: qsTr("Character displayed when users enter passwords.")
}
LineEdit {
visible: textInputSection.isTextInput
backendValue: backendValues.passwordCharacter
Layout.fillWidth: true
}
......
......@@ -70,7 +70,6 @@ Column {
}
TextInputSection {
showEchoMode: true
isTextInput: true
}
}
......@@ -14902,7 +14902,7 @@ Would you like to overwrite them?</source>
</message>
<message>
<source>Find in This Directory...</source>
<translation>このディレクトを検索...</translation>
<translation>このディレクトを検索...</translation>
</message>
<message>
<source>Show in Explorer</source>
......@@ -963,6 +963,41 @@ QmlLanguageBundles ModelManagerInterface::extendedBundles() const
return m_extendedBundles;
}
void ModelManagerInterface::maybeScan(const QStringList &importPaths,
Language::Enum defaultLanguage)
{
QStringList pathToScan;
{
QMutexLocker l(&m_mutex);
foreach (QString importPath, importPaths)
if (!m_scannedPaths.contains(importPath)) {
pathToScan.append(importPath);
}
}
if (pathToScan.count() > 1) {
QFuture<void> result = QtConcurrent::run(&ModelManagerInterface::importScan,
workingCopyInternal(), pathToScan,
this, defaultLanguage,
true);
if (m_synchronizer.futures().size() > 10) {
QList<QFuture<void> > futures = m_synchronizer.futures();
m_synchronizer.clearFutures();
foreach (const QFuture<void> &future, futures) {
if (! (future.isFinished() || future.isCanceled()))
m_synchronizer.addFuture(future);
}
}
m_synchronizer.addFuture(result);
addTaskInternal(result, tr("Scanning QML Imports"), Constants::TASK_IMPORT_SCAN);
}
}
void ModelManagerInterface::updateImportPaths()
{
QStringList allImportPaths;
......@@ -1026,36 +1061,7 @@ void ModelManagerInterface::updateImportPaths()
if (!m_shouldScanImports)
return;
QStringList pathToScan;
{
QMutexLocker l(&m_mutex);
foreach (QString importPath, allImportPaths)
if (!m_scannedPaths.contains(importPath)) {
pathToScan.append(importPath);
}
}
if (pathToScan.count() > 1) {
QFuture<void> result = QtConcurrent::run(&ModelManagerInterface::importScan,
workingCopyInternal(), pathToScan,
this, Language::Qml,
true);
if (m_synchronizer.futures().size() > 10) {
QList<QFuture<void> > futures = m_synchronizer.futures();
m_synchronizer.clearFutures();
foreach (const QFuture<void> &future, futures) {
if (! (future.isFinished() || future.isCanceled()))
m_synchronizer.addFuture(future);
}
}
m_synchronizer.addFuture(result);
addTaskInternal(result, tr("Scanning QML Imports"), Constants::TASK_IMPORT_SCAN);
}
maybeScan(allImportPaths, Language::Qml);
}
ModelManagerInterface::ProjectInfo ModelManagerInterface::defaultProjectInfo() const
......
......@@ -244,6 +244,7 @@ protected:
CPlusPlus::Snapshot snapshot,
QHash<QString, QPair<CPlusPlus::Document::Ptr, bool> > documents);
void maybeScan(const QStringList &importPaths, Language::Enum defaultLanguage);
void updateImportPaths();
void loadQmlTypeDescriptionsInternal(const QString &path);
......
......@@ -44,7 +44,7 @@ QtcLibrary {
"sshsendfacility.cpp", "sshsendfacility_p.h",
].concat(botanFiles)
property var useSystemBotan: qbs.getenv("USE_SYSTEM_BOTAN") === "1"
property var useSystemBotan: qbs.getEnv("USE_SYSTEM_BOTAN") === "1"
property var botanIncludes: {
var result = ["../3rdparty"];
if (useSystemBotan)
......
......@@ -11,7 +11,7 @@ QtcPlugin {
Depends { name: "TextEditor" }
Depends { name: "Utils" }
property string llvmInstallDir: qbs.getenv("LLVM_INSTALL_DIR")
property string llvmInstallDir: qbs.getEnv("LLVM_INSTALL_DIR")
condition: llvmInstallDir && !llvmInstallDir.isEmpty
property bool clangCompletion: true
......@@ -33,7 +33,7 @@ QtcPlugin {
}
// Find llvm-config* in PATH
var pathListString = qbs.getenv("PATH");
var pathListString = qbs.getEnv("PATH");
var separator = qbs.hostOS.contains("windows") ? ";" : ":";
var pathList = pathListString.split(separator);
for (var i = 0; i < llvmConfigVariants.length; ++i) {
......
......@@ -224,17 +224,12 @@ bool CppEditorSupport::initialized()
SemanticInfo CppEditorSupport::recalculateSemanticInfo()
{
m_futureSemanticInfo.cancel();
SemanticInfo::Source source = currentSource(false);
recalculateSemanticInfoNow(source, /*emitSignalWhenFinished=*/ false);
return m_lastSemanticInfo;
return recalculateSemanticInfoNow(currentSource(false), /*emitSignalWhenFinished=*/ false);
}
Document::Ptr CppEditorSupport::lastSemanticInfoDocument() const
{
QMutexLocker locker(&m_lastSemanticInfoLock);
return m_lastSemanticInfo.doc;
return semanticInfo().doc;
}
void CppEditorSupport::recalculateSemanticInfoDetached(ForceReason forceReason)
......@@ -348,17 +343,13 @@ void CppEditorSupport::onDocumentUpdated(Document::Ptr doc)
setExtraDiagnostics(key, doc->diagnosticMessages());
}
// update semantic info in a future
if (!m_initialized ||
(m_textEditor->widget()->isVisible()
&& (m_lastSemanticInfo.doc.isNull()
|| m_lastSemanticInfo.doc->translationUnit()->ast() == 0
|| m_lastSemanticInfo.doc->fileName() != fileName()))) {
// Update semantic info if necessary
if (!m_initialized || (m_textEditor->widget()->isVisible() && !isSemanticInfoValid())) {
m_initialized = true;
recalculateSemanticInfoDetached(ForceDueToMissingSemanticInfo);
recalculateSemanticInfoDetached(ForceDueToInvalidSemanticInfo);
}
// notify the editor that the document is updated
// Notify the editor that the document is updated
emit documentUpdated();
}
......@@ -368,34 +359,18 @@ void CppEditorSupport::startHighlighting(ForceReason forceReason)
return;
if (m_highlightingSupport->requiresSemanticInfo()) {
Snapshot snapshot;
Document::Ptr doc;
unsigned revision;
bool forced;
bool complete;
{
QMutexLocker locker(&m_lastSemanticInfoLock);
snapshot = m_lastSemanticInfo.snapshot;
doc = m_lastSemanticInfo.doc;
revision = m_lastSemanticInfo.revision;
forced = m_lastSemanticInfo.forced;
complete = m_lastSemanticInfo.complete;
}
if (doc.isNull())
const SemanticInfo info = semanticInfo();
if (info.doc.isNull())
return;
if (!m_lastHighlightOnCompleteSemanticInfo)
forced = true;
if (!forced && m_lastHighlightRevision == revision)
const bool forced = info.forced || !m_lastHighlightOnCompleteSemanticInfo;
if (!forced && m_lastHighlightRevision == info.revision)
return;
m_highlighter.cancel();
m_highlighter = m_highlightingSupport->highlightingFuture(doc, snapshot);
m_lastHighlightRevision = revision;
m_lastHighlightOnCompleteSemanticInfo = complete;
m_highlighter = m_highlightingSupport->highlightingFuture(info.doc, info.snapshot);
m_lastHighlightRevision = info.revision;
m_lastHighlightOnCompleteSemanticInfo = info.complete;
emit highlighterStarted(&m_highlighter, m_lastHighlightRevision);
} else {
const unsigned revision = editorRevision();
......@@ -496,8 +471,7 @@ void CppEditorSupport::onCurrentEditorChanged()
m_editorVisible = editorVisible;
if (editorVisible) {
m_editorGCTimer->stop();
QMutexLocker locker(&m_lastSemanticInfoLock);
if (!m_lastSemanticInfo.doc)
if (!lastSemanticInfoDocument())
updateDocumentNow();
} else {
m_editorGCTimer->start(EditorHiddenGCTimeout);
......@@ -510,8 +484,7 @@ void CppEditorSupport::releaseResources()
m_highlighter.cancel();
m_highlighter = QFuture<TextEditor::HighlightingResult>();
snapshotUpdater()->releaseSnapshot();
QMutexLocker semanticLocker(&m_lastSemanticInfoLock);
m_lastSemanticInfo = SemanticInfo();
setSemanticInfo(SemanticInfo(), /*emitSignal=*/ false);
m_lastHighlightOnCompleteSemanticInfo = true;
}
......@@ -524,66 +497,54 @@ SemanticInfo::Source CppEditorSupport::currentSource(bool force)
force);
}
void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &source,
bool emitSignalWhenFinished,
FuturizedTopLevelDeclarationProcessor *processor)
SemanticInfo CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &source,
bool emitSignalWhenFinished,
FuturizedTopLevelDeclarationProcessor *processor)
{
SemanticInfo semanticInfo;
const SemanticInfo lastSemanticInfo = semanticInfo();
SemanticInfo newSemanticInfo;
{
QMutexLocker locker(&m_lastSemanticInfoLock);
semanticInfo.revision = m_lastSemanticInfo.revision;
semanticInfo.forced = source.force;
if (!source.force
&& m_lastSemanticInfo.complete
&& m_lastSemanticInfo.revision == source.revision
&& m_lastSemanticInfo.doc
&& m_lastSemanticInfo.doc->translationUnit()->ast()
&& m_lastSemanticInfo.doc->fileName() == source.fileName) {
semanticInfo.snapshot = m_lastSemanticInfo.snapshot; // ### TODO: use the new snapshot.
semanticInfo.doc = m_lastSemanticInfo.doc;
}
}
newSemanticInfo.forced = source.force;
newSemanticInfo.revision = source.revision;
// Try to reuse as much as possible from the last semantic info
if (!source.force
&& lastSemanticInfo.complete
&& lastSemanticInfo.revision == source.revision
&& lastSemanticInfo.doc
&& lastSemanticInfo.doc->translationUnit()->ast()
&& lastSemanticInfo.doc->fileName() == source.fileName) {
newSemanticInfo.snapshot = lastSemanticInfo.snapshot; // ### TODO: use the new snapshot.
newSemanticInfo.doc = lastSemanticInfo.doc;
if (semanticInfo.doc.isNull()) {
// Otherwise reprocess document
} else {
const QSharedPointer<SnapshotUpdater> snapshotUpdater = snapshotUpdater_internal();
QTC_ASSERT(snapshotUpdater, return);
semanticInfo.snapshot = snapshotUpdater->snapshot();
if (semanticInfo.snapshot.contains(source.fileName)) {
Document::Ptr doc = semanticInfo.snapshot.preprocessedDocument(source.code,
source.fileName);
if (processor)
doc->control()->setTopLevelDeclarationProcessor(processor);
doc->check();
if (processor && processor->isCanceled())
semanticInfo.complete = false;
semanticInfo.doc = doc;
} else {
return;
}
QTC_ASSERT(snapshotUpdater, return newSemanticInfo);
newSemanticInfo.snapshot = snapshotUpdater->snapshot();
QTC_ASSERT(newSemanticInfo.snapshot.contains(source.fileName), return newSemanticInfo);
Document::Ptr doc = newSemanticInfo.snapshot.preprocessedDocument(source.code,
source.fileName);
if (processor)
doc->control()->setTopLevelDeclarationProcessor(processor);
doc->check();
if (processor && processor->isCanceled())
newSemanticInfo.complete = false;
newSemanticInfo.doc = doc;
}
if (semanticInfo.doc) {
TranslationUnit *translationUnit = semanticInfo.doc->translationUnit();
AST * ast = translationUnit->ast();
FunctionDefinitionUnderCursor functionDefinitionUnderCursor(semanticInfo.doc->translationUnit());
DeclarationAST *currentFunctionDefinition = functionDefinitionUnderCursor(ast, source.line, source.column);
// Update local uses for the document
TranslationUnit *translationUnit = newSemanticInfo.doc->translationUnit();
AST *ast = translationUnit->ast();
FunctionDefinitionUnderCursor functionDefinitionUnderCursor(newSemanticInfo.doc->translationUnit());
const LocalSymbols useTable(newSemanticInfo.doc,
functionDefinitionUnderCursor(ast, source.line, source.column));
newSemanticInfo.localUses = useTable.uses;
const LocalSymbols useTable(semanticInfo.doc, currentFunctionDefinition);
semanticInfo.revision = source.revision;
semanticInfo.localUses = useTable.uses;
}
// Update semantic info
setSemanticInfo(newSemanticInfo, emitSignalWhenFinished);
{
QMutexLocker locker(&m_lastSemanticInfoLock);
m_lastSemanticInfo = semanticInfo;
}
if (emitSignalWhenFinished)
emit semanticInfoUpdated(semanticInfo);
return newSemanticInfo;
}
void CppEditorSupport::recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future, SemanticInfo::Source source)
......@@ -592,6 +553,30 @@ void CppEditorSupport::recalculateSemanticInfoDetached_helper(QFutureInterface<v
recalculateSemanticInfoNow(source, true, &processor);
}
bool CppEditorSupport::isSemanticInfoValid() const
{
const Document::Ptr document = lastSemanticInfoDocument();
return document
&& document->translationUnit()->ast()
&& document->fileName() == fileName();
}
SemanticInfo CppEditorSupport::semanticInfo() const
{
QMutexLocker locker(&m_lastSemanticInfoLock);
return m_lastSemanticInfo;
}
void CppEditorSupport::setSemanticInfo(const SemanticInfo &semanticInfo, bool emitSignal)
{
{
QMutexLocker locker(&m_lastSemanticInfoLock);
m_lastSemanticInfo = semanticInfo;
}
if (emitSignal)
emit semanticInfoUpdated(semanticInfo);
}
QSharedPointer<SnapshotUpdater> CppEditorSupport::snapshotUpdater_internal() const
{
QMutexLocker locker(&m_snapshotUpdaterLock);
......
......@@ -121,7 +121,7 @@ public:
enum ForceReason {
NoForce,
ForceDueToMissingSemanticInfo,
ForceDueToInvalidSemanticInfo,
ForceDueEditorRequest
};
......@@ -192,11 +192,16 @@ private:
};
SemanticInfo::Source currentSource(bool force);
void recalculateSemanticInfoNow(const SemanticInfo::Source &source, bool emitSignalWhenFinished,
FuturizedTopLevelDeclarationProcessor *processor = 0);
SemanticInfo recalculateSemanticInfoNow(const SemanticInfo::Source &source,
bool emitSignalWhenFinished,
FuturizedTopLevelDeclarationProcessor *processor = 0);
void recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future,
SemanticInfo::Source source);
bool isSemanticInfoValid() const;
SemanticInfo semanticInfo() const;
void setSemanticInfo(const SemanticInfo &semanticInfo, bool emitSignal = true);
QSharedPointer<SnapshotUpdater> snapshotUpdater_internal() const;
void setSnapshotUpdater_internal(const QSharedPointer<SnapshotUpdater> &updater);
......
......@@ -249,7 +249,7 @@ void DebuggerItemManager::autoDetectGdbOrLldbDebuggers()
}
foreach (const QFileInfo &fi, suspects) {
if (fi.exists() && fi.isExecutable()) {
if (fi.exists() && fi.isExecutable() && !fi.isDir()) {
FileName command = FileName::fromString(fi.absoluteFilePath());