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

Merge remote-tracking branch 'origin/3.0'

Conflicts:
	share/qtcreator/debugger/stdtypes.py
	src/plugins/qmlprofiler/qmlprofilereventsmodelproxy.cpp

Change-Id: I5d86746d58960e41e01e725ccb2a6c00890f0dfd
parents fca56658 1193cfa0
The Qt Creator Manual lists known issues in Qt Creator:
http://doc.qt.digia.com/qtcreator-snapshot/creator-known-issues.html
http://qt-project.org/doc/qtcreator/creator-known-issues.html
For a complete list of reported issues, see the Qt Bug Tracker:
......
......@@ -151,8 +151,12 @@ macx {
INCLUDEPATH += \
$$IDE_BUILD_TREE/src \ # for <app/app_version.h>
$$IDE_SOURCE_TREE/src/libs \
$$IDE_SOURCE_TREE/tools \
$$IDE_SOURCE_TREE/src/plugins
$$IDE_SOURCE_TREE/tools
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
for (dir, QTC_PLUGIN_DIRS) {
INCLUDEPATH += $$dir
}
CONFIG += depend_includepath
......@@ -201,7 +205,16 @@ for(ever) {
break()
done_plugins += $$QTC_PLUGIN_DEPENDS
for(dep, QTC_PLUGIN_DEPENDS) {
include($$PWD/src/plugins/$$dep/$${dep}_dependencies.pri)
dependencies_file =
for(dir, QTC_PLUGIN_DIRS) {
exists($$dir/$$dep/$${dep}_dependencies.pri) {
dependencies_file = $$dir/$$dep/$${dep}_dependencies.pri
break()
}
}
isEmpty(dependencies_file): \
error("Plugin dependency $$dep not found")
include($$dependencies_file)
LIBS += -l$$qtLibraryName($$QTC_PLUGIN_NAME)
}
QTC_PLUGIN_DEPENDS = $$unique(QTC_PLUGIN_DEPENDS)
......
......@@ -339,6 +339,10 @@ class DumperBase:
def putByteArrayValue(self, value):
return self.putValue(self.encodeByteArray(value), Hex2EncodedLatin1)
def putByteArrayValueByAddress(self, addr):
self.putValue(self.encodeByteArrayHelper(self.dereference(addr)),
Hex2EncodedLatin1)
def putStringValueByAddress(self, addr):
self.putValue(self.encodeStringHelper(self.dereference(addr)),
Hex4EncodedLittleEndian)
......
......@@ -315,7 +315,8 @@ class Dumper(DumperBase):
if item.name is None:
self.anonNumber += 1
item.name = "#%d" % self.anonNumber
item.iname = "%s.%s" % (self.currentIName, item.name)
if not item.iname:
item.iname = "%s.%s" % (self.currentIName, item.name)
self.put('{')
#if not item.name is None:
if isinstance(item.name, str):
......
......@@ -231,6 +231,17 @@ def qdump__QTime(d, value):
d.putNumChild(0)
def qdump__QTimeZone(d, value):
base = d.dereferenceValue(value)
if d.isNull(base):
d.putValue("(null)")
d.putNumChild(0)
return
idAddr = base + 2 * d.ptrSize() # [QSharedData] + [vptr]
d.putByteArrayValueByAddress(idAddr)
d.putPlainChildren(value["d"])
def qdump__QDateTime(d, value):
qtVersion = d.qtVersion()
isValid = False
......@@ -1626,8 +1637,7 @@ def qdump__QSharedDataPointer(d, value):
d.putPlainChildren(value)
return
d.putBetterType(d.currentType)
d.putItem(gdb.Value(d_ptr.cast(innerType.pointer())).dereference())
# d.putItem(value.dereference())
d.putItem(d_ptr.cast(innerType.pointer()).dereference())
def qdump__QSharedPointer(d, value):
......
......@@ -132,9 +132,9 @@ def qdump__std__list(d, value):
qdump__std__list__QNX(d, value)
return
head = d.dereferenceValue(value)
impl = value["_M_impl"]
node = impl["_M_node"]
head = d.addressOf(node)
size = 0
pp = d.dereference(head)
while head != pp and size <= 1001:
......
......@@ -292,12 +292,12 @@ int GraphicalNodeInstance::penWidth() const
}
QList<ServerNodeInstance> GraphicalNodeInstance::childItemsForChild(QQuickItem *childItem) const
QList<ServerNodeInstance> GraphicalNodeInstance::childItemsForChild(QQuickItem *item) const
{
QList<ServerNodeInstance> instanceList;
if (childItem) {
foreach (QQuickItem *childItem, childItem->childItems())
if (item) {
foreach (QQuickItem *childItem, item->childItems())
{
if (childItem && nodeInstanceServer()->hasInstanceForObject(childItem)) {
instanceList.append(nodeInstanceServer()->instanceForObject(childItem));
......
......@@ -69,7 +69,7 @@ protected:
QRectF boundingRectWithStepChilds(QQuickItem *parentItem) const;
void resetHorizontal();
void resetVertical();
QList<ServerNodeInstance> childItemsForChild(QQuickItem *childItem) const;
QList<ServerNodeInstance> childItemsForChild(QQuickItem *item) const;
void refresh();
static bool anyItemHasContent(QQuickItem *quickItem);
static bool childItemsHaveContent(QQuickItem *quickItem);
......
......@@ -42,6 +42,7 @@ import QtQuick 2.1
import HelperWidgets 2.0
ButtonRow {
enabled: anchorBackend.hasParent
id: buttonRow
ButtonRowButton {
......
......@@ -35,9 +35,9 @@ import QtQuick.Controls.Styles 1.0
Controls.TextField {
Controls.Action {
//Workaround to avoid that "Delete" deletes the item.
shortcut: "Delete"
}
//Workaround to avoid that "Delete" deletes the item.
shortcut: "Delete"
}
id: lineEdit
property variant backendValue
......@@ -62,20 +62,23 @@ Controls.TextField {
}
}
onEditingFinished: {
if (backendValue.value !== text)
backendValue.value = text;
}
onFocusChanged: {
if (focus) {
transaction.start();
onEditingFinished: {
if (backendValue.isTranslated) {
backendValue.expression = "qsTr(\"" + trCheckbox.escapeString(text) + "\")"
} else {
transaction.end();
if (lineEdit.backendValue.value !== text)
lineEdit.backendValue.value = text;
}
}
// onFocusChanged: {
// if (focus) {
// transaction.start();
// } else {
// transaction.end();
// }
// }
style: TextFieldStyle {
selectionColor: lineEdit.textColor
selectedTextColor: "black"
......@@ -112,12 +115,24 @@ Controls.TextField {
anchors.verticalCenter: parent.verticalCenter
id: trCheckbox
checked: backendValue.isTranslated
property bool isTranslated: colorLogic.backendValue.isTranslated
property bool backendValueValue: colorLogic.backendValue.value
onIsTranslatedChanged: {
checked = lineEdit.backendValue.isTranslated
}
onBackendValueValueChanged: {
checked = lineEdit.backendValue.isTranslated
}
onClicked: {
if (trCheckbox.checked) {
backendValue.expression = "qsTr(\"" + escapeString(lineEdit.text) + "\")"
lineEdit.backendValue.expression = "qsTr(\"" + escapeString(lineEdit.text) + "\")"
} else {
backendValue.value = lineEdit.text
var textValue = lineEdit.text
lineEdit.backendValue.value = textValue
}
colorLogic.evaluate();
}
......@@ -137,7 +152,6 @@ Controls.TextField {
style: CheckBoxStyle {
spacing: 8
label: Controls.Label { text: control.text ; color: checkBox.textColor }
indicator: Item {
implicitWidth: 16
implicitHeight: 16
......
......@@ -37,14 +37,12 @@ Rectangle {
CustomizedGridView {
id: grid
y: 82
height: grid.contentHeight
anchors.rightMargin: 38
anchors.leftMargin: 38
anchors.left: parent.left
anchors.right: parent.right
height: scrollView.height - 82
y: scrollView.flickableItem.contentY + 82
contentY: scrollView.flickableItem.contentY
model: examplesModel
}
......
......@@ -38,22 +38,30 @@ GridView {
cellWidth: 216
property int columns: Math.max(Math.floor(width / cellWidth), 1)
delegate: Delegate {
id: delegate
delegate: Loader {
property int delegateOffset: cellHeight * Math.floor(index / columns) + 100
property bool isVisible: delegateOffset > scrollView.flickableItem.contentY - cellHeight
&& delegateOffset < scrollView.flickableItem.contentY + scrollView.flickableItem.height
onIsVisibleChanged: active = true
visible: isVisible
active: false
sourceComponent: Delegate {
id: delegate
property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1
property string sourcePrefix: isHelpImage ? "image://helpimage/" : ""
property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1
property string sourcePrefix: isHelpImage ? "image://helpimage/" : ""
property string mockupSource: model.imageSource
property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : ""
property string mockupSource: model.imageSource
property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : ""
imageSource: isVideo ? "" : (model.imageSource === undefined ? helpSource : mockupSource)
videoSource: isVideo ? (model.imageSource === undefined ? model.imageUrl : mockupSource) : ""
imageSource: isVideo ? "" : (model.imageSource === undefined ? helpSource : mockupSource)
videoSource: isVideo ? (model.imageSource === undefined ? model.imageUrl : mockupSource) : ""
caption: model.name;
description: model.description
isVideo: model.isVideo === true
videoLength: model.videoLength !== undefined ? model.videoLength : ""
tags: model.tags
caption: model.name;
description: model.description
isVideo: model.isVideo === true
videoLength: model.videoLength !== undefined ? model.videoLength : ""
tags: model.tags
}
}
}
......@@ -271,9 +271,6 @@ bool AndroidDeployQtStep::init()
pp->setMacroExpander(bc->macroExpander());
pp->setWorkingDirectory(bc->buildDirectory().toString());
Utils::Environment env = bc->environment();
// Force output to english for the parsers. Do this here and not in the toolchain's
// addToEnvironment() to not screw up the users run environment.
env.set(QLatin1String("LC_ALL"), QLatin1String("C"));
pp->setEnvironment(env);
pp->setCommand(command);
pp->setArguments(Utils::QtcProcess::joinArgs(arguments));
......
......@@ -1264,9 +1264,9 @@ bool AndroidManager::checkKeystorePassword(const QString &keystorePath, const QS
<< keystorePasswd;
QProcess proc;
proc.start(AndroidConfigurations::instance().keytoolPath().toString(), arguments);
if (!proc.waitForStarted(500))
if (!proc.waitForStarted(4000))
return false;
if (!proc.waitForFinished(500)) {
if (!proc.waitForFinished(4000)) {
proc.kill();
proc.waitForFinished();
return false;
......@@ -1293,9 +1293,9 @@ bool AndroidManager::checkCertificatePassword(const QString &keystorePath, const
QProcess proc;
proc.start(AndroidConfigurations::instance().keytoolPath().toString(), arguments);
if (!proc.waitForStarted(500))
if (!proc.waitForStarted(4000))
return false;
if (!proc.waitForFinished(500)) {
if (!proc.waitForFinished(4000)) {
proc.kill();
proc.waitForFinished();
return false;
......
......@@ -111,6 +111,8 @@ void StickyNotesPasteProtocol::paste(const QString &text,
const QString &comment,
const QString &description)
{
enum { maxDescriptionLength = 30 }; // Length of description is limited.
Q_UNUSED(username)
Q_UNUSED(comment);
QTC_ASSERT(!m_pasteReply, return);
......@@ -124,7 +126,7 @@ void StickyNotesPasteProtocol::paste(const QString &text,
pasteData += expiryParameter(expiryDays);
if (!description.isEmpty()) {
pasteData += "&title=";
pasteData += QUrl::toPercentEncoding(description);
pasteData += QUrl::toPercentEncoding(description.left(maxDescriptionLength));
}
m_pasteReply = httpPost(m_hostUrl + QLatin1String("api/xml/create"), pasteData);
......
......@@ -715,6 +715,7 @@ void CPPEditorWidget::setMimeType(const QString &mt)
QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
updater->setProjectPart(m_modelManager->projectPartForProjectFile(projectFile));
updater->setEditorDefines(additionalDirectives);
m_preprocessorButton->setProperty("highlightWidget", !additionalDirectives.trimmed().isEmpty());
......@@ -1997,6 +1998,7 @@ void CPPEditorWidget::showPreProcessorWidget()
QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
const QString &additionals = preProcessorDialog.additionalPreProcessorDirectives();
updater->setProjectPart(preProcessorDialog.projectPart());
updater->setEditorDefines(additionals.toUtf8());
updater->update(m_modelManager->workingCopy());
......
......@@ -112,6 +112,11 @@ int CppPreProcessorDialog::exec()
return Accepted;
}
CppTools::ProjectPart::Ptr CppPreProcessorDialog::projectPart() const
{
return m_partAdditions[m_ui->projectComboBox->currentIndex()].projectPart;
}
QString CppPreProcessorDialog::additionalPreProcessorDirectives() const
{
return m_ui->editWidget->toPlainText();
......
......@@ -50,6 +50,8 @@ public:
~CppPreProcessorDialog();
int exec();
CppTools::ProjectPart::Ptr projectPart() const;
QString additionalPreProcessorDirectives() const;
private slots:
......
......@@ -703,12 +703,14 @@ private:
/// Make sure that m_projectMutex is locked when calling this.
void CppModelManager::recalculateFileToProjectParts()
{
m_projectFileToProjectPart.clear();
m_fileToProjectParts.clear();
foreach (const ProjectInfo &projectInfo, m_projectToProjectsInfo) {
foreach (const ProjectPart::Ptr &projectPart, projectInfo.projectParts()) {
foreach (const ProjectFile &cxxFile, projectPart->files) {
m_projectFileToProjectPart[projectPart->projectFile] = projectPart;
foreach (const ProjectFile &cxxFile, projectPart->files)
m_fileToProjectParts[cxxFile.path].append(projectPart);
}
}
}
}
......@@ -788,6 +790,11 @@ QFuture<void> CppModelManager::updateProjectInfo(const ProjectInfo &newProjectIn
return updateSourceFiles(filesToReindex, ForcedProgressNotification);
}
ProjectPart::Ptr CppModelManager::projectPartForProjectFile(const QString &projectFile) const
{
return m_projectFileToProjectPart.value(projectFile);
}
QList<ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) const
{
return m_fileToProjectParts.value(fileName);
......
......@@ -74,6 +74,8 @@ public:
virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const;
virtual QFuture<void> updateProjectInfo(const ProjectInfo &newProjectInfo);
/// \return The project part with the given project file
virtual ProjectPart::Ptr projectPartForProjectFile(const QString &projectFile) const;
/// \return All project parts that mention the given file name as one of the sources/headers.
virtual QList<ProjectPart::Ptr> projectPart(const QString &fileName) const;
/// This is a fall-back function: find all files that includes the file directly or indirectly,
......@@ -198,6 +200,7 @@ private:
mutable QMutex m_projectMutex;
QMap<ProjectExplorer::Project *, ProjectInfo> m_projectToProjectsInfo;
QMap<QString, QList<CppTools::ProjectPart::Ptr> > m_fileToProjectParts;
QMap<QString, CppTools::ProjectPart::Ptr> m_projectFileToProjectPart;
// The members below are cached/(re)calculated from the projects and/or their project parts
bool m_dirty;
QStringList m_projectFiles;
......
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