Commit e035ae6d authored by Eike Ziller's avatar Eike Ziller

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;
......
......@@ -233,6 +233,7 @@ public:
virtual QList<ProjectInfo> projectInfos() const = 0;
virtual ProjectInfo projectInfo(ProjectExplorer::Project *project) const = 0;
virtual QFuture<void> updateProjectInfo(const ProjectInfo &pinfo) = 0;
virtual ProjectPart::Ptr projectPartForProjectFile(const QString &projectFile) const = 0;
virtual QList<ProjectPart::Ptr> projectPart(const QString &fileName) const = 0;
virtual QList<ProjectPart::Ptr> projectPartFromDependencies(const QString &fileName) const = 0;
virtual ProjectPart::Ptr fallbackProjectPart() const = 0;
......
......@@ -441,6 +441,11 @@ void GdbEngine::handleResponse(const QByteArray &buff)
// We get multiple *running after thread creation and in Windows terminals.
showMessage(QString::fromLatin1("NOTE: INFERIOR STILL RUNNING IN STATE %1.").
arg(QLatin1String(DebuggerEngine::stateName(state()))));
} else if (Utils::HostOsInfo::isWindowsHost() && (state() == InferiorStopRequested
|| state() == InferiorShutdownRequested)) {
// FIXME: Breakpoints on Windows are exceptions which are thrown in newly
// created threads so we have to filter out the running threads messages when
// we request a stop.
} else {
notifyInferiorRunOk();
}
......@@ -4997,9 +5002,10 @@ void GdbEngine::tryLoadPythonDumpers()
const QByteArray uninstalledData = gdbBinaryFile.absolutePath().toLocal8Bit()
+ "/data-directory/python";
postCommand("python sys.path.insert(1, '" + dumperSourcePath + "')", ConsoleCommand);
postCommand("python sys.path.append('" + uninstalledData + "')", ConsoleCommand);
postCommand("python from gdbbridge import *", ConsoleCommand, CB(handlePythonSetup));
const GdbCommandFlags flags = ConsoleCommand | Immediate;
postCommand("python sys.path.insert(1, '" + dumperSourcePath + "')", flags);
postCommand("python sys.path.append('" + uninstalledData + "')", flags);
postCommand("python from gdbbridge import *", flags, CB(handlePythonSetup));
}
void GdbEngine::reloadDebuggingHelpers()
......
......@@ -201,7 +201,9 @@ IosRunConfigurationWidget::IosRunConfigurationWidget(IosRunConfiguration *runCon
updateValues();
connect(m_ui->argumentsLineEdit, SIGNAL(editingFinished()),
this, SLOT(argumentsLineEditTextEdited()));
SLOT(argumentsLineEditTextEdited()));
connect(runConfiguration->target(), SIGNAL(buildDirectoryChanged()),
SLOT(updateValues()));
}
IosRunConfigurationWidget::~IosRunConfigurationWidget()
......
......@@ -286,8 +286,8 @@ void MacroManager::startMacro()
foreach (IMacroHandler *handler, d->handlers)
handler->startRecording(d->currentMacro);
QString endShortcut = Core::ActionManager::command(Constants::END_MACRO)->defaultKeySequence().toString();
QString executeShortcut = Core::ActionManager::command(Constants::EXECUTE_LAST_MACRO)->defaultKeySequence().toString();
QString endShortcut = Core::ActionManager::command(Constants::END_MACRO)->keySequence().toString();
QString executeShortcut = Core::ActionManager::command(Constants::EXECUTE_LAST_MACRO)->keySequence().toString();
QString help = tr("Macro mode. Type \"%1\" to stop recording and \"%2\" to play the macro.")
.arg(endShortcut).arg(executeShortcut);
Core::EditorManager::showEditorStatusBar(
......
......@@ -462,12 +462,12 @@ QString MsvcToolChainFactory::vcVarsBatFor(const QString &basePath, const QStrin
return basePath + QLatin1String("/SetEnv.cmd");
if (toolchainName == QLatin1String("x86"))
return basePath + QLatin1String("/bin/vcvars32.bat");
if (toolchainName == QLatin1String("amd64_arm"))
return basePath + QLatin1String("/bin/amd64_arm/vcvarsamd64_arm.bat");
if (toolchainName == QLatin1String("x86_amd64"))
return basePath + QLatin1String("/bin/x86_amd64/vcvarsx86_amd64.bat");
if (toolchainName == QLatin1String("amd64"))
return basePath + QLatin1String("/bin/amd64/vcvars64.bat");
if (toolchainName == QLatin1String("x86_amd64"))
return basePath + QLatin1String("/bin/x86_amd64/vcvarsx86_amd64.bat");
if (toolchainName == QLatin1String("x86_arm"))
return basePath + QLatin1String("/bin/x86_arm/vcvarsx86_arm.bat");
if (toolchainName == QLatin1String("arm"))
......@@ -567,12 +567,21 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect()
}
}
if (arch == Utils::HostOsInfo::HostArchitectureX86
|| arch == Utils::HostOsInfo::HostArchitectureAMD64) {
if (arch == Utils::HostOsInfo::HostArchitectureX86) {
if (QFileInfo(vcVarsBatFor(path, QLatin1String("x86_arm"))).isFile())
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::arm, vsName),
vcvarsAllbat, QLatin1String("x86_arm"), ToolChain::AutoDetection));
} else if (arch == Utils::HostOsInfo::HostArchitectureAMD64) {
if (QFileInfo(vcVarsBatFor(path, QLatin1String("amd64_arm"))).isFile()) {
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::arm, vsName),
vcvarsAllbat, QLatin1String("amd64_arm"), ToolChain::AutoDetection));
} else if (QFileInfo(vcVarsBatFor(path, QLatin1String("x86_arm"))).isFile()) {
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::arm, vsName),
vcvarsAllbat, QLatin1String("x86_arm"), ToolChain::AutoDetection));
}
} else if (arch == Utils::HostOsInfo::HostArchitectureArm) {
if (QFileInfo(vcVarsBatFor(path, QLatin1String("arm"))).isFile())
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::arm),
......
......@@ -177,7 +177,7 @@ void Target::changeRunConfigurationEnabled()
void Target::onBuildDirectoryChanged()
{
BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(sender());
if (bc)
if (bc && activeBuildConfiguration() == bc)
emit buildDirectoryChanged();
}
......@@ -238,6 +238,8 @@ void Target::addBuildConfiguration(BuildConfiguration *configuration)
SLOT(changeEnvironment()));
connect(configuration, SIGNAL(enabledChanged()),
this, SLOT(changeBuildConfigurationEnabled()));
connect(configuration, SIGNAL(buildDirectoryChanged()),
SLOT(onBuildDirectoryChanged()));
if (!activeBuildConfiguration())
setActiveBuildConfiguration(configuration);
......
......@@ -65,7 +65,6 @@ QbsBuildConfiguration::QbsBuildConfiguration(ProjectExplorer::Target *target) :
connect(project(), SIGNAL(projectParsingStarted()), this, SIGNAL(enabledChanged()));
connect(project(), SIGNAL(projectParsingDone(bool)), this, SIGNAL(enabledChanged()));
connect(this, SIGNAL(buildDirectoryChanged()), target, SLOT(onBuildDirectoryChanged()));
ProjectExplorer::BuildStepList *bsl
= stepList(Core::Id(ProjectExplorer::Constants::BUILDSTEPS_BUILD));
connect(bsl, SIGNAL(stepInserted(int)), this, SLOT(buildStepInserted(int)));
......
......@@ -179,7 +179,10 @@ void PropertyEditorQmlBackend::createPropertyEditorValue(const QmlObjectNode &qm
qmlObjectNode.modelNode().property(propertyName).isBindingProperty()) {
valueObject->setExpression(qmlObjectNode.modelNode().bindingProperty(propertyName).expression());
} else {
valueObject->setExpression(qmlObjectNode.instanceValue(name).toString());
if (qmlObjectNode.hasBindingProperty(propertyName))
valueObject->setExpression(qmlObjectNode.expression(name));
else
valueObject->setExpression(qmlObjectNode.instanceValue(name).toString());
}
}
......@@ -190,6 +193,7 @@ void PropertyEditorQmlBackend::setValue(const QmlObjectNode & qmlObjectNode, con
PropertyEditorValue *propertyValue = qobject_cast<PropertyEditorValue*>(variantToQObject(m_backendValuesPropertyMap.value(propertyName)));
if (propertyValue) {
propertyValue->setValue(value);
if (!qmlObjectNode.hasBindingProperty(name))
propertyValue->setExpression(value.toString());
else
......
......@@ -34,6 +34,7 @@
#include <nodeproperty.h>
#include <nodemetainfo.h>
#include <qmlobjectnode.h>
#include <bindingproperty.h>
//using namespace QmlDesigner;
......@@ -159,7 +160,6 @@ QString PropertyEditorValue::enumeration() const
QString PropertyEditorValue::expression() const
{
return m_expression;
}
......@@ -224,17 +224,22 @@ void PropertyEditorValue::setIsValid(bool valid)
bool PropertyEditorValue::isTranslated() const
{
if (modelNode().isValid() && modelNode().metaInfo().isValid() && modelNode().metaInfo().hasProperty(name()))
if (modelNode().isValid() && modelNode().metaInfo().isValid() && modelNode().metaInfo().hasProperty(name())) {
if (modelNode().metaInfo().propertyTypeName(name()) == "QString" || modelNode().metaInfo().propertyTypeName(name()) == "string") {
const QmlDesigner::QmlObjectNode objectNode(modelNode());
if (objectNode.isValid() && objectNode.hasBindingProperty(name())) {
//qsTr()
QRegExp rx("qsTr(\"*\")");
//qsTr()
rx.setPatternSyntax(QRegExp::Wildcard);
return rx.exactMatch(expression());
if (objectNode.propertyAffectedByCurrentState(name())) {
return rx.exactMatch(expression());
} else {
return rx.exactMatch(modelNode().bindingProperty(name()).expression());
}
}
return false;
}
}
return false;
}
......
......@@ -86,7 +86,7 @@ class PropertyEditorValue : public QObject
Q_PROPERTY(bool isInSubState READ isInSubState NOTIFY valueChangedQml FINAL)
Q_PROPERTY(bool isBound READ isBound NOTIFY isBoundChanged FINAL)
Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged FINAL)
Q_PROPERTY(bool isTranslated READ isTranslated NOTIFY valueChangedQml FINAL)
Q_PROPERTY(bool isTranslated READ isTranslated NOTIFY expressionChanged FINAL)
Q_PROPERTY(QString name READ name FINAL)
Q_PROPERTY(PropertyEditorNodeWrapper* complexNode READ complexNode NOTIFY complexNodeChanged FINAL)
......
......@@ -226,6 +226,8 @@ MetaInfo {
Property { name: "width"; type: "int"; value: 360; }
Property { name: "height"; type: "int"; value: 300; }
Property { name: "title"; type: "binding"; value: "qsTr(\"Check Box\")"; }
}
}
......
......@@ -42,7 +42,6 @@ using namespace QmlJSTools;
void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic()
{
return;
QmlJS::ModelManagerInterface *modelManager = QmlJS::ModelManagerInterface::instance();
const QString welcomescreenRootPath = Core::ICore::resourcePath() + QLatin1String("/welcomescreen/welcomescreen.qml");
......@@ -57,7 +56,7 @@ void QmlJSTools::Internal::QmlJSToolsPlugin::test_basic()
QVERIFY(context);
const CppComponentValue *rectangleValue = context->valueOwner()->cppQmlTypes().objectByQualifiedName(
QLatin1String("QtQuick"), QLatin1String("QDeclarative1Rectangle"), LanguageUtils::ComponentVersion(1, 0));
QLatin1String("QtQuick"), QLatin1String("QDeclarativeRectangle"), LanguageUtils::ComponentVersion(2, 1));
QVERIFY(rectangleValue);
QVERIFY(!rectangleValue->isWritable(QLatin1String("border")));
QVERIFY(rectangleValue->hasProperty(QLatin1String("border")));
......
......@@ -96,11 +96,10 @@ void QmlProfilerEventsModelProxy::limitToRange(qint64 rangeStart, qint64 rangeEn
void QmlProfilerEventsModelProxy::dataChanged()
{
if (d->modelManager->state() == QmlProfilerDataState::ProcessingData)
loadData();