diff --git a/doc/src/projects/creator-projects-custom-wizards.qdoc b/doc/src/projects/creator-projects-custom-wizards.qdoc
index b3e27cc8d46..09021ab7dde 100644
--- a/doc/src/projects/creator-projects-custom-wizards.qdoc
+++ b/doc/src/projects/creator-projects-custom-wizards.qdoc
@@ -268,16 +268,23 @@
\li \c fieldpagetitle specifies the title of the page.
- \li \c field specifies whether the field is mandatory (\c true or
- \c false). You can use the value of the \c name field as a
- variable in other files (for example, \c {%MESSAGE%}.
+ \li \c fields specifies the user interface objects on the page.
- \li \c fieldcontrol specifies the field. \c class specifies the
- field type. You can use interface objects from the QWidget class
- to create fields. This example uses QLineEdit to create an input
- field.
+ \li \c field specifies one object. You can use a set of interface objects
+ from QtWidgets classes, derived from QWidget, to create fields. This example
+ uses QLineEdit to create an input field. For more information about the objects
+ that you can add, see \l {Supported Widgets}.
- \li \c validator specifies a regular expression to check the
+ \li \c mandatory specifies whether the field is mandatory (\c true or
+ \c false). For more information, see QWizardPage::registerField().
+
+ \li \c name specifies a name that you can use as a placeholder variable in the
+ template file (for example, \c {%MESSAGE%}).
+
+ \li \c class specifies the type of the \c fieldcontrol. The XML attributes that you
+ can specify for the field depend on the field type.
+
+ \li For a QLineEdit, \c validator specifies a regular expression to check the
characters allowed in the field.
\li \c defaulttext specifies text that appears in the field by
@@ -292,7 +299,7 @@
\section1 Creating Class Wizards
- The widget.xml file for a class wizard is very similar to that for a project
+ The wizard.xml file for a class wizard is very similar to that for a project
wizard. The differences are discussed below.
To create a class wizard:
@@ -360,9 +367,18 @@
Klassenname:
-
-
-
+
+
+
+ class QString
+ Klasse QString
+
+
+ Integer
+ Ganzzahlwert
+
+
+
Data type:
Datentyp:
@@ -371,11 +387,85 @@
\endcode
In addition to QLineEdit, QComboBox is used in the class wizard to
- create a field. \c combochoices specifies the options in the combobox
- and \c defaultindex specifies that QString is the default value.
+ create a field. Specify the following XML attributes:
+
+ \list
+
+ \li \c defaultindex specifies which comboentry is displayed by default. In the above
+ example, "0" means that the first comboentry is the default value.
+
+ \li \c comboentries specifies the options in the combobox.
+
+ \li \c value specifies the type of each \c comboentry, QString or integer.
+
+ \li \c comboentrytext specifies the text of the entry.
+
+ \endlist
\endlist
+ \section1 Supported Widgets
+
+ You can use the following interface objects to create fields in the wizards:
+
+ \list
+
+ \li PathChooser utility to set paths
+
+ \li Check boxes with text labels (QCheckBox)
+
+ \li Combined button and popup lists (QComboBox)
+
+ \li One-line text editors (QLineEdit)
+
+ \li Multi-line rich text editors (QTextEdit)
+
+ \endlist
+
+ Using QLineEdit and QComboBox is described in the previous sections.
+ The following sections show examples of using the other classes and describe the XML
+ attributes that you can specify for the \c fieldcontrol element of a field in a particular
+ \c class.
+
+ \section2 Path Choosers
+
+ \code
+
+
+ Qt Creator sources:
+
+ \endcode
+
+ The \c defaulttext attribute specifies text that appears in the field by default.
+
+ \section2 Check Boxes
+
+ To make check boxes appear selected by default, set the \c fieldcontrol attribute
+ \c defaultvalue to \c true. Any other value or omitting the attribute makes the check box
+ appear not selected.
+
+ For example:
+
+ \code
+
+
+ Console application
+
+ \endcode
+
+ For more examples about using check boxes, see \l{Processing Template Files}.
+
+ \section2 Text Editors
+
+ \code
+
+
+ License:
+
+ \endcode
+
+ The \c defaulttext attribute specifies text that appears in the field by default.
+
\section1 Processing Template Files
When processing a template source file, placeholders specifying the field
@@ -396,9 +486,29 @@
\endlist
+ In the \c{helloworld} example, the placeholder \c %NETWORK% is used together with the
+ QCheckBox class. The following line is added to the project file:
+
+ \code
+ %NETWORK%QT += network
+ \endcode
+
+ And the following field is specified in the wizard.xml:
+
+ \code
+
+
+ Include network module
+ Netzwerk-Modul verwenden
+
+ \endcode
+
+ If the checkbox is checked, the placeholder is replaced by \c truevalue. If it is not
+ checked, the placeholder is replaced by \c falsevalue.
+
You can use conditions to add sections of the file depending on field
values. Use a syntax that is similar to C++ preprocessing, as demonstrated
- in the profile of the \c{helloworld} example:
+ in the project file of the \c{helloworld} example:
\code
@@ -412,6 +522,16 @@
whether the script module is added. The expressions must expand to valid
Javascript expressions after field replacement.
+ For example, the following field is specified in the wizard.xml:
+
+ \code
+
+
+ Include script module
+ Script-Modul verwenden
+
+ \endcode
+
\section1 Pre-defined Standard Variables
In addition to the field values entered by the user, you can use
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
index 6cc9ce3477a..9b47f2da441 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/objectnodeinstance.cpp
@@ -54,6 +54,17 @@
#include
#include
+static bool isPropertyBlackListed(const QmlDesigner::PropertyName &propertyName)
+{
+ if (propertyName.contains(".") && propertyName.contains("__"))
+ return true;
+
+ if (propertyName.count(".") > 1)
+ return true;
+
+ return false;
+}
+
namespace QmlDesigner {
namespace Internal {
@@ -534,6 +545,9 @@ void ObjectNodeInstance::refreshProperty(const PropertyName &name)
bool ObjectNodeInstance::hasBindingForProperty(const PropertyName &name, bool *hasChanged) const
{
+ if (isPropertyBlackListed(name))
+ return false;
+
QQmlProperty property(object(), name, context());
bool hasBinding = QQmlPropertyPrivate::binding(property);
@@ -602,6 +616,9 @@ QVariant ObjectNodeInstance::property(const PropertyName &name) const
// TODO: handle model nodes
+ if (isPropertyBlackListed(name))
+ return QVariant();
+
QQmlProperty property(object(), name, context());
if (property.property().isEnumType()) {
QVariant value = property.read();
@@ -664,6 +681,9 @@ PropertyNameList ObjectNodeInstance::propertyNames() const
QString ObjectNodeInstance::instanceType(const PropertyName &name) const
{
+ if (isPropertyBlackListed(name))
+ return QLatin1String("undefined");
+
QQmlProperty property(object(), name, context());
if (!property.isValid())
return QLatin1String("undefined");
@@ -783,7 +803,13 @@ static void disableTiledBackingStore(QObject *object)
Q_UNUSED(object);
}
-PropertyNameList propertyNameForWritableProperties(QObject *object, const PropertyName &baseName = PropertyName(), QObjectList *inspectedObjects = new QObjectList())
+static void addToPropertyNameListIfNotBlackListed(PropertyNameList *propertyNameList, const PropertyName &propertyName)
+{
+ if (!isPropertyBlackListed(propertyName))
+ propertyNameList->append(propertyName);
+}
+
+PropertyNameList propertyNameListForWritableProperties(QObject *object, const PropertyName &baseName = PropertyName(), QObjectList *inspectedObjects = new QObjectList())
{
PropertyNameList propertyNameList;
@@ -800,16 +826,16 @@ PropertyNameList propertyNameForWritableProperties(QObject *object, const Proper
if (declarativeProperty.name() != "parent") {
QObject *childObject = QQmlMetaType::toQObject(declarativeProperty.read());
if (childObject)
- propertyNameList.append(propertyNameForWritableProperties(childObject, baseName + PropertyName(metaProperty.name()) + '.', inspectedObjects));
+ propertyNameList.append(propertyNameListForWritableProperties(childObject, baseName + PropertyName(metaProperty.name()) + '.', inspectedObjects));
}
} else if (QQmlValueTypeFactory::valueType(metaProperty.userType())) {
QQmlValueType *valueType = QQmlValueTypeFactory::valueType(metaProperty.userType());
valueType->setValue(metaProperty.read(object));
- propertyNameList.append(propertyNameForWritableProperties(valueType, baseName + PropertyName(metaProperty.name()) + '.', inspectedObjects));
+ propertyNameList.append(propertyNameListForWritableProperties(valueType, baseName + PropertyName(metaProperty.name()) + '.', inspectedObjects));
}
if (metaProperty.isReadable() && metaProperty.isWritable()) {
- propertyNameList.append(baseName + PropertyName(metaProperty.name()));
+ addToPropertyNameListIfNotBlackListed(&propertyNameList, baseName + PropertyName(metaProperty.name()));
}
}
@@ -821,7 +847,7 @@ static void fixResourcePathsForObject(QObject *object)
if (qgetenv("QMLDESIGNER_RC_PATHS").isEmpty())
return;
- PropertyNameList propertyNameList = propertyNameForWritableProperties(object);
+ PropertyNameList propertyNameList = propertyNameListForWritableProperties(object);
foreach (const PropertyName &propertyName, propertyNameList) {
QQmlProperty property(object, propertyName, QQmlEngine::contextForObject(object));
@@ -1037,7 +1063,7 @@ void ObjectNodeInstance::deactivateState()
void ObjectNodeInstance::populateResetHashes()
{
- PropertyNameList propertyNameList = propertyNameForWritableProperties(object());
+ PropertyNameList propertyNameList = propertyNameListForWritableProperties(object());
foreach (const PropertyName &propertyName, propertyNameList) {
QQmlProperty property(object(), propertyName, QQmlEngine::contextForObject(object()));
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
index f4db8ed8fc7..94f8622491f 100644
--- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
+++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/quickitemnodeinstance.cpp
@@ -278,8 +278,6 @@ static void disableTextCursor(QQuickItem *item)
void QuickItemNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNodeInstance)
{
- disableTextCursor(quickItem());
-
if (instanceId() == 0) {
DesignerSupport::setRootItem(nodeInstanceServer()->quickView(), quickItem());
} else {
@@ -448,7 +446,7 @@ void QuickItemNodeInstance::refresh()
repositioning(quickItem());
}
-void doComponentCompleteRecursive(QQuickItem *item)
+static void doComponentCompleteRecursive(QQuickItem *item)
{
if (item) {
if (DesignerSupport::isComponentComplete(item))
@@ -465,6 +463,8 @@ void QuickItemNodeInstance::doComponentComplete()
{
doComponentCompleteRecursive(quickItem());
+ disableTextCursor(quickItem());
+
quickItem()->update();
}
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp
index a4791aff77b..51d28f29eac 100644
--- a/src/libs/cplusplus/LookupContext.cpp
+++ b/src/libs/cplusplus/LookupContext.cpp
@@ -336,8 +336,14 @@ QList LookupContext::lookup(const Name *name, Scope *scope) const
if (name->identifier() != 0 && scope->isBlock()) {
bindings()->lookupInScope(name, scope, &candidates, /*templateId = */ 0, /*binding=*/ 0);
- if (! candidates.isEmpty())
- break; // it's a local.
+ if (! candidates.isEmpty()) {
+ // it's a local.
+ //for qualified it can be outside of the local scope
+ if (name->isQualifiedNameId())
+ continue;
+ else
+ break;
+ }
for (unsigned i = 0; i < scope->memberCount(); ++i) {
if (UsingNamespaceDirective *u = scope->memberAt(i)->asUsingNamespaceDirective()) {
@@ -353,8 +359,14 @@ QList LookupContext::lookup(const Name *name, Scope *scope) const
} else if (Function *fun = scope->asFunction()) {
bindings()->lookupInScope(name, fun, &candidates, /*templateId = */ 0, /*binding=*/ 0);
- if (! candidates.isEmpty())
- break; // it's an argument or a template parameter.
+ if (! candidates.isEmpty()) {
+ // it's an argument or a template parameter.
+ //for qualified it can be outside of the local scope
+ if (name->isQualifiedNameId())
+ continue;
+ else
+ break;
+ }
if (fun->name() && fun->name()->isQualifiedNameId()) {
if (ClassOrNamespace *binding = bindings()->lookupType(fun)) {
@@ -380,8 +392,14 @@ QList LookupContext::lookup(const Name *name, Scope *scope) const
} else if (Template *templ = scope->asTemplate()) {
bindings()->lookupInScope(name, templ, &candidates, /*templateId = */ 0, /*binding=*/ 0);
- if (! candidates.isEmpty())
- return candidates; // it's a template parameter.
+ if (! candidates.isEmpty()) {
+ // it's a template parameter.
+ //for qualified it can be outside of the local scope
+ if (name->isQualifiedNameId())
+ continue;
+ else
+ break;
+ }
} else if (scope->asNamespace()
|| scope->asClass()
@@ -624,7 +642,8 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
if (s->asNamespaceAlias() && binding) {
ClassOrNamespace *targetNamespaceBinding = binding->lookupType(name);
- if (targetNamespaceBinding && targetNamespaceBinding->symbols().size() == 1) {
+ //there can be many namespace definitions
+ if (targetNamespaceBinding && targetNamespaceBinding->symbols().size() > 0) {
Symbol *resolvedSymbol = targetNamespaceBinding->symbols().first();
item.setType(resolvedSymbol->type()); // override the type
}
@@ -1107,29 +1126,26 @@ bool ClassOrNamespace::NestedClassInstantiator::isInstantiateNestedClassNeeded(c
bool ClassOrNamespace::NestedClassInstantiator::containsTemplateType(Declaration *declaration) const
{
Type *memberType = declaration->type().type();
- NamedType *memberNamedType = findMemberNamedType(memberType);
- if (memberNamedType) {
- const Name *name = memberNamedType->name();
- if (_subst.contains(name))
- return true;
- }
- return false;
+ NamedType *namedType = findNamedType(memberType);
+ return namedType && _subst.contains(namedType->name());
}
-bool ClassOrNamespace::NestedClassInstantiator::containsTemplateType(Function * /*function*/) const
+bool ClassOrNamespace::NestedClassInstantiator::containsTemplateType(Function *function) const
{
- //TODO: make implementation
- return false;
+ Type *returnType = function->returnType().type();
+ NamedType *namedType = findNamedType(returnType);
+ return namedType && _subst.contains(namedType->name());
+ //TODO: in future we will need also check function arguments, for now returned value is enough
}
-NamedType *ClassOrNamespace::NestedClassInstantiator::findMemberNamedType(Type *memberType) const
+NamedType *ClassOrNamespace::NestedClassInstantiator::findNamedType(Type *memberType) const
{
if (NamedType *namedType = memberType->asNamedType())
return namedType;
else if (PointerType *pointerType = memberType->asPointerType())
- return findMemberNamedType(pointerType->elementType().type());
+ return findNamedType(pointerType->elementType().type());
else if (ReferenceType *referenceType = memberType->asReferenceType())
- return findMemberNamedType(referenceType->elementType().type());
+ return findNamedType(referenceType->elementType().type());
return 0;
}
diff --git a/src/libs/cplusplus/LookupContext.h b/src/libs/cplusplus/LookupContext.h
index 09b1691512e..ead7d2dfe32 100644
--- a/src/libs/cplusplus/LookupContext.h
+++ b/src/libs/cplusplus/LookupContext.h
@@ -155,7 +155,7 @@ private:
bool isInstantiateNestedClassNeeded(const QList &symbols) const;
bool containsTemplateType(Declaration *declaration) const;
bool containsTemplateType(Function *function) const;
- NamedType *findMemberNamedType(Type *memberType) const;
+ NamedType *findNamedType(Type *memberType) const;
QSet _alreadyConsideredNestedClassInstantiations;
CreateBindings *_factory;
diff --git a/src/libs/cplusplus/TypeOfExpression.h b/src/libs/cplusplus/TypeOfExpression.h
index 0842bb09c15..656b01eb15d 100644
--- a/src/libs/cplusplus/TypeOfExpression.h
+++ b/src/libs/cplusplus/TypeOfExpression.h
@@ -125,7 +125,11 @@ public:
QByteArray preprocessedExpression(const QByteArray &utf8code) const;
void setExpandTemplates(bool expandTemplates)
- { m_expandTemplates = expandTemplates; }
+ {
+ if (m_bindings)
+ m_bindings->setExpandTemplates(expandTemplates);
+ m_expandTemplates = expandTemplates;
+ }
private:
diff --git a/src/libs/cplusplus/cplusplus.pro b/src/libs/cplusplus/cplusplus.pro
index 3d18fc3db85..a7d797245e9 100644
--- a/src/libs/cplusplus/cplusplus.pro
+++ b/src/libs/cplusplus/cplusplus.pro
@@ -1,6 +1,7 @@
DEFINES += NDEBUG
#DEFINES += DEBUG_LOOKUP
unix:QMAKE_CXXFLAGS_DEBUG += -O2
+win32:QMAKE_CXXFLAGS_DEBUG += -O2
include(../../qtcreatorlibrary.pri)
include(cplusplus-lib.pri)
diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.cpp b/src/libs/qmljs/qmljsstaticanalysismessage.cpp
index 35544e587b0..6336bc21e29 100644
--- a/src/libs/qmljs/qmljsstaticanalysismessage.cpp
+++ b/src/libs/qmljs/qmljsstaticanalysismessage.cpp
@@ -43,14 +43,6 @@ class StaticAnalysisMessages
Q_DECLARE_TR_FUNCTIONS(QmlJS::StaticAnalysisMessages)
public:
- class PrototypeMessageData {
- public:
- Type type;
- Severity severity;
- QString message;
- int placeholders;
- };
-
void newMsg(Type type, Severity severity, const QString &message, int placeholders = 0)
{
PrototypeMessageData prototype;
@@ -248,7 +240,7 @@ Message::Message(Type type,
: location(location), type(type)
{
QTC_ASSERT(messages()->messages.contains(type), return);
- const StaticAnalysisMessages::PrototypeMessageData &prototype = messages()->messages.value(type);
+ const PrototypeMessageData &prototype = prototypeForMessageType(type);
severity = prototype.severity;
message = prototype.message;
if (prototype.placeholders == 0) {
@@ -299,3 +291,11 @@ QRegExp Message::suppressionPattern()
{
return QRegExp(QLatin1String("@disable-check M(\\d+)"));
}
+
+const PrototypeMessageData Message::prototypeForMessageType(Type type)
+{
+ QTC_CHECK(messages()->messages.contains(type));
+ const PrototypeMessageData &prototype = messages()->messages.value(type);
+
+ return prototype;
+}
diff --git a/src/libs/qmljs/qmljsstaticanalysismessage.h b/src/libs/qmljs/qmljsstaticanalysismessage.h
index eb21552d510..3cf29d7bba0 100644
--- a/src/libs/qmljs/qmljsstaticanalysismessage.h
+++ b/src/libs/qmljs/qmljsstaticanalysismessage.h
@@ -131,6 +131,14 @@ enum Type
ErrInvalidArrayValueLength = 323
};
+class QMLJS_EXPORT PrototypeMessageData {
+public:
+ Type type;
+ Severity severity;
+ QString message;
+ int placeholders;
+};
+
class QMLJS_EXPORT Message
{
public:
@@ -152,6 +160,8 @@ public:
QString message;
Type type;
Severity severity;
+
+ static const PrototypeMessageData prototypeForMessageType(Type type);
};
} // namespace StaticAnalysis
diff --git a/src/libs/utils/hostosinfo.h b/src/libs/utils/hostosinfo.h
index 25edc98b344..0bb642561bf 100644
--- a/src/libs/utils/hostosinfo.h
+++ b/src/libs/utils/hostosinfo.h
@@ -58,7 +58,7 @@ public:
static bool isMacHost() { return hostOs() == HostOsMac; }
static inline bool isAnyUnixHost();
- static QString appendExecutableSuffix(const QString &executable)
+ static QString withExecutableSuffix(const QString &executable)
{
QString finalName = executable;
if (isWindowsHost())
diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp
index f3530940eaa..89778314591 100644
--- a/src/libs/utils/pathchooser.cpp
+++ b/src/libs/utils/pathchooser.cpp
@@ -226,6 +226,7 @@ QString PathChooserPrivate::expandedPath(const QString &input) const
case PathChooser::Directory:
case PathChooser::ExistingDirectory:
case PathChooser::File:
+ case PathChooser::SaveFile:
if (!m_baseDirectory.isEmpty() && QFileInfo(path).isRelative())
return QFileInfo(m_baseDirectory + QLatin1Char('/') + path).absoluteFilePath();
break;
@@ -377,6 +378,11 @@ void PathChooser::slotBrowse()
makeDialogTitle(tr("Choose File")), predefined,
d->m_dialogFilter);
break;
+ case PathChooser::SaveFile:
+ newPath = QFileDialog::getSaveFileName(this,
+ makeDialogTitle(tr("Choose File")), predefined,
+ d->m_dialogFilter);
+ break;
case PathChooser::Any: {
QFileDialog dialog(this);
dialog.setFileMode(QFileDialog::AnyFile);
@@ -464,6 +470,13 @@ bool PathChooser::validatePath(const QString &path, QString *errorMessage)
return false;
}
break;
+ case PathChooser::SaveFile:
+ if (!fi.absoluteDir().exists()) {
+ if (errorMessage)
+ *errorMessage = tr("The directory '%1' does not exist.").arg(QDir::toNativeSeparators(fi.absolutePath()));
+ return false;
+ }
+ break;
case PathChooser::ExistingCommand:
if (!fi.exists()) {
if (errorMessage)
@@ -513,6 +526,14 @@ bool PathChooser::validatePath(const QString &path, QString *errorMessage)
}
break;
+ case PathChooser::SaveFile:
+ if (fi.exists() && fi.isDir()) {
+ if (errorMessage)
+ *errorMessage = tr("The path %1 is not a file.").arg(QDir::toNativeSeparators(fi.absolutePath()));
+ return false;
+ }
+ break;
+
case PathChooser::ExistingCommand:
if (!fi.isFile() || !fi.isExecutable()) {
if (errorMessage)
diff --git a/src/libs/utils/pathchooser.h b/src/libs/utils/pathchooser.h
index 0dbb08dbae7..fd687ca514e 100644
--- a/src/libs/utils/pathchooser.h
+++ b/src/libs/utils/pathchooser.h
@@ -70,6 +70,7 @@ public:
ExistingDirectory,
Directory, // A directory, doesn't need to exist
File,
+ SaveFile,
ExistingCommand, // A command that must exist at the time of selection
Command, // A command that may or may not exist at the time of selection (e.g. result of a build)
Any
diff --git a/src/plugins/android/androidconfigurations.cpp b/src/plugins/android/androidconfigurations.cpp
index 1ea77692b68..29516171e40 100644
--- a/src/plugins/android/androidconfigurations.cpp
+++ b/src/plugins/android/androidconfigurations.cpp
@@ -81,6 +81,7 @@ namespace {
const QLatin1String KeystoreLocationKey("KeystoreLocation");
const QLatin1String AutomaticKitCreationKey("AutomatiKitCreation");
const QLatin1String PartitionSizeKey("PartitionSize");
+ const QLatin1String ToolchainHostKey("ToolchainHost");
const QLatin1String ArmToolchainPrefix("arm-linux-androideabi");
const QLatin1String X86ToolchainPrefix("x86");
const QLatin1String MipsToolchainPrefix("mipsel-linux-android");
@@ -152,6 +153,7 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
antLocation = FileName::fromString(settings.value(AntLocationKey).toString());
openJDKLocation = FileName::fromString(settings.value(OpenJDKLocationKey).toString());
keystoreLocation = FileName::fromString(settings.value(KeystoreLocationKey).toString());
+ toolchainHost = settings.value(ToolchainHostKey).toString();
automaticKitCreation = settings.value(AutomaticKitCreationKey, true).toBool();
PersistentSettingsReader reader;
@@ -163,6 +165,7 @@ AndroidConfig::AndroidConfig(const QSettings &settings)
antLocation = FileName::fromString(reader.restoreValue(AntLocationKey).toString());
openJDKLocation = FileName::fromString(reader.restoreValue(OpenJDKLocationKey).toString());
keystoreLocation = FileName::fromString(reader.restoreValue(KeystoreLocationKey).toString());
+ toolchainHost = reader.restoreValue(ToolchainHostKey).toString();
QVariant v = reader.restoreValue(AutomaticKitCreationKey);
if (v.isValid())
automaticKitCreation = v.toBool();
@@ -190,11 +193,16 @@ void AndroidConfig::save(QSettings &settings) const
settings.setValue(KeystoreLocationKey, keystoreLocation.toString());
settings.setValue(PartitionSizeKey, partitionSize);
settings.setValue(AutomaticKitCreationKey, automaticKitCreation);
+ settings.setValue(ToolchainHostKey, toolchainHost);
}
void AndroidConfigurations::setConfig(const AndroidConfig &devConfigs)
{
m_config = devConfigs;
+
+ if (m_config.toolchainHost.isEmpty())
+ detectToolchainHost();
+
save();
updateAvailablePlatforms();
updateAutomaticKitList();
@@ -278,7 +286,7 @@ FileName AndroidConfigurations::toolPath(Abi::Architecture architecture, const Q
return path.appendPath(QString::fromLatin1("toolchains/%1-%2/prebuilt/%3/bin/%4")
.arg(toolchainPrefix(architecture))
.arg(ndkToolChainVersion)
- .arg(ToolchainHost)
+ .arg(m_config.toolchainHost)
.arg(toolsPrefix(architecture)));
}
@@ -292,6 +300,11 @@ FileName AndroidConfigurations::readelfPath(Abi::Architecture architecture, cons
return toolPath(architecture, ndkToolChainVersion).append(QLatin1String("-readelf" QTC_HOST_EXE_SUFFIX));
}
+FileName AndroidConfigurations::gccPath(Abi::Architecture architecture, const QString &ndkToolChainVersion) const
+{
+ return toolPath(architecture, ndkToolChainVersion).append(QLatin1String("-gcc" QTC_HOST_EXE_SUFFIX));
+}
+
FileName AndroidConfigurations::gdbPath(Abi::Architecture architecture, const QString &ndkToolChainVersion) const
{
return toolPath(architecture, ndkToolChainVersion).append(QLatin1String("-gdb" QTC_HOST_EXE_SUFFIX));
@@ -302,6 +315,30 @@ FileName AndroidConfigurations::openJDKPath() const
return m_config.openJDKLocation;
}
+void AndroidConfigurations::detectToolchainHost()
+{
+ QStringList hostPatterns;
+ switch (HostOsInfo::hostOs()) {
+ case HostOsInfo::HostOsLinux:
+ hostPatterns << QLatin1String("linux*");
+ break;
+ case HostOsInfo::HostOsWindows:
+ hostPatterns << QLatin1String("windows*");
+ break;
+ case HostOsInfo::HostOsMac:
+ hostPatterns << QLatin1String("darwin*");
+ break;
+ default: /* unknown host */ return;
+ }
+
+ FileName path = m_config.ndkLocation;
+ QDirIterator it(path.appendPath(QLatin1String("prebuilt")).toString(), hostPatterns, QDir::Dirs);
+ if (it.hasNext()) {
+ it.next();
+ m_config.toolchainHost = it.fileName();
+ }
+}
+
FileName AndroidConfigurations::openJDKBinPath() const
{
FileName path = m_config.openJDKLocation;
diff --git a/src/plugins/android/androidconfigurations.h b/src/plugins/android/androidconfigurations.h
index fd3f6e1e775..80ac05d42b1 100644
--- a/src/plugins/android/androidconfigurations.h
+++ b/src/plugins/android/androidconfigurations.h
@@ -43,21 +43,6 @@ QT_END_NAMESPACE
namespace Android {
namespace Internal {
-#ifdef Q_OS_LINUX
- const QLatin1String ToolchainHost("linux-x86");
-#else
-# ifdef Q_OS_DARWIN
- const QLatin1String ToolchainHost("darwin-x86");
-# else
-# ifdef Q_OS_WIN32
- const QLatin1String ToolchainHost("windows");
-# else
-# warning No Android supported OSs found
- const QLatin1String ToolchainHost("linux-x86");
-# endif
-# endif
-#endif
-
class AndroidConfig
{
public:
@@ -70,6 +55,7 @@ public:
Utils::FileName antLocation;
Utils::FileName openJDKLocation;
Utils::FileName keystoreLocation;
+ QString toolchainHost;
unsigned partitionSize;
bool automaticKitCreation;
};
@@ -96,6 +82,7 @@ public:
Utils::FileName androidToolPath() const;
Utils::FileName antToolPath() const;
Utils::FileName emulatorToolPath() const;
+ Utils::FileName gccPath(ProjectExplorer::Abi::Architecture architecture, const QString &ndkToolChainVersion) const;
Utils::FileName gdbPath(ProjectExplorer::Abi::Architecture architecture, const QString &ndkToolChainVersion) const;
Utils::FileName openJDKPath() const;
Utils::FileName keytoolPath() const;
@@ -128,6 +115,7 @@ public slots:
private:
Utils::FileName toolPath(ProjectExplorer::Abi::Architecture architecture, const QString &ndkToolChainVersion) const;
Utils::FileName openJDKBinPath() const;
+ void detectToolchainHost();
AndroidConfigurations(QObject *parent);
void load();
diff --git a/src/plugins/android/androidqtversion.cpp b/src/plugins/android/androidqtversion.cpp
index 91f9e30c86a..e92bc0240f0 100644
--- a/src/plugins/android/androidqtversion.cpp
+++ b/src/plugins/android/androidqtversion.cpp
@@ -103,13 +103,8 @@ QList AndroidQtVersion::detectQtAbis() const
void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::Environment &env) const
{
- QString ndk_host = QLatin1String(
- Utils::HostOsInfo::isLinuxHost() ? "linux-x86" :
- Utils::HostOsInfo::isWindowsHost() ? "windows" :
- Utils::HostOsInfo::isMacHost() ? "darwin-x86" : "");
-
// this env vars are used by qmake mkspecs to generate makefiles (check QTDIR/mkspecs/android-g++/qmake.conf for more info)
- env.set(QLatin1String("ANDROID_NDK_HOST"), ndk_host);
+ env.set(QLatin1String("ANDROID_NDK_HOST"), AndroidConfigurations::instance().config().toolchainHost);
env.set(QLatin1String("ANDROID_NDK_ROOT"), AndroidConfigurations::instance().config().ndkLocation.toUserOutput());
Qt4Project *qt4pro = qobject_cast(ProjectExplorerPlugin::instance()->currentProject());
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp
index b41ad3225a1..8a0163df7d8 100644
--- a/src/plugins/android/androidsettingswidget.cpp
+++ b/src/plugins/android/androidsettingswidget.cpp
@@ -286,6 +286,7 @@ void AndroidSettingsWidget::sdkLocationEditingFinished()
void AndroidSettingsWidget::ndkLocationEditingFinished()
{
Utils::FileName location = Utils::FileName::fromUserInput(m_ui->NDKLocationLineEdit->text());
+ m_androidConfig.toolchainHost.clear(); // force toolchain host detection
if (!checkNDK(location))
return;
saveSettings(true);
diff --git a/src/plugins/android/androidtoolchain.cpp b/src/plugins/android/androidtoolchain.cpp
index b2ddc85f4fb..6bce5fe6c11 100644
--- a/src/plugins/android/androidtoolchain.cpp
+++ b/src/plugins/android/androidtoolchain.cpp
@@ -109,21 +109,7 @@ void AndroidToolChain::addToEnvironment(Environment &env) const
// TODO this vars should be configurable in projects -> build tab
// TODO invalidate all .pro files !!!
- QString ndkHost;
- switch (HostOsInfo::hostOs()) {
- case HostOsInfo::HostOsLinux:
- ndkHost = QLatin1String("linux-x86");
- break;
- case HostOsInfo::HostOsWindows:
- ndkHost = QLatin1String("windows");
- break;
- case HostOsInfo::HostOsMac:
- ndkHost = QLatin1String("darwin-x86");
- break;
- default:
- break;
- }
- env.set(QLatin1String("ANDROID_NDK_HOST"), ndkHost);
+ env.set(QLatin1String("ANDROID_NDK_HOST"), AndroidConfigurations::instance().config().toolchainHost);
env.set(QLatin1String("ANDROID_NDK_TOOLCHAIN_PREFIX"), AndroidConfigurations::toolchainPrefix(targetAbi().architecture()));
env.set(QLatin1String("ANDROID_NDK_TOOLS_PREFIX"), AndroidConfigurations::toolsPrefix(targetAbi().architecture()));
env.set(QLatin1String("ANDROID_NDK_TOOLCHAIN_VERSION"), m_ndkToolChainVersion);
@@ -300,12 +286,7 @@ QList AndroidToolChainFact
if (ati.architecture == Abi::UnknownArchitecture) // e.g. mipsel which is not yet supported
continue;
// AndroidToolChain *tc = new AndroidToolChain(arch, version, true);
- ati.compilerCommand = ndkPath;
- ati.compilerCommand.appendPath(QString::fromLatin1("toolchains/%1/prebuilt/%3/bin/%4")
- .arg(fileName)
- .arg(ToolchainHost)
- .arg(AndroidConfigurations::toolsPrefix(ati.architecture)));
- ati.compilerCommand.append(QLatin1String("-gcc" QTC_HOST_EXE_SUFFIX));
+ ati.compilerCommand = AndroidConfigurations::instance().gccPath(ati.architecture, ati.version);
// tc->setCompilerCommand(compilerPath);
result.append(ati);
}
@@ -332,12 +313,7 @@ QList AndroidToolChainFactory::createToolChainsForNdk(const Utils::
if (arch == Abi::UnknownArchitecture) // e.g. mipsel which is not yet supported
continue;
AndroidToolChain *tc = new AndroidToolChain(arch, version, true);
- FileName compilerPath = ndkPath;
- compilerPath.appendPath(QString::fromLatin1("toolchains/%1/prebuilt/%3/bin/%4")
- .arg(fileName)
- .arg(ToolchainHost)
- .arg(AndroidConfigurations::toolsPrefix(arch)));
- compilerPath.append(QLatin1String("-gcc" QTC_HOST_EXE_SUFFIX));
+ FileName compilerPath = AndroidConfigurations::instance().gccPath(arch, version);
tc->setCompilerCommand(compilerPath);
result.append(tc);
}
diff --git a/src/plugins/clearcase/clearcaseplugin.cpp b/src/plugins/clearcase/clearcaseplugin.cpp
index 04442011c01..2412ca1cc3b 100644
--- a/src/plugins/clearcase/clearcaseplugin.cpp
+++ b/src/plugins/clearcase/clearcaseplugin.cpp
@@ -555,21 +555,40 @@ QString ClearCasePlugin::ccGetPredecessor(const QString &version) const
return response.stdOut;
}
+//! Get a list of paths to active VOBs.
+//! Paths are relative to topLevel
QStringList ClearCasePlugin::ccGetActiveVobs() const
{
QStringList res;
QStringList args(QLatin1String("lsvob"));
- args << QLatin1String("-short");
- QString topLevel = currentState().topLevel();
+ const QString topLevel = currentState().topLevel();
const ClearCaseResponse response =
runCleartool(topLevel, args, m_settings.timeOutMS(), SilentRun);
if (response.error)
return res;
- foreach (QString dir, response.stdOut.split(QLatin1Char('\n'), QString::SkipEmptyParts)) {
- dir = dir.mid(1); // omit first slash
- QFileInfo fi(topLevel, dir);
- if (fi.exists())
- res.append(dir);
+
+ // format of output unix:
+ // * /path/to/vob /path/to/vob/storage.vbs
+ // format of output windows:
+ // * \vob \\share\path\to\vob\storage.vbs
+ QString prefix = topLevel;
+ if (!prefix.endsWith(QLatin1Char('/')))
+ prefix += QLatin1Char('/');
+
+ foreach (const QString &line, response.stdOut.split(QLatin1Char('\n'), QString::SkipEmptyParts)) {
+ const bool isActive = line.at(0) == QLatin1Char('*');
+ if (!isActive)
+ continue;
+
+ const QString dir =
+ QDir::fromNativeSeparators(line.mid(3, line.indexOf(QLatin1Char(' '), 3) - 3));
+ const QString relativeDir = QDir(topLevel).relativeFilePath(dir);
+
+ // Snapshot views does not necessarily have all active VOBs loaded, so we'll have to
+ // check if the dirs exists as well. Else the command will work, but the output will
+ // complain about the element not being loaded.
+ if (QFile::exists(prefix + relativeDir))
+ res.append(relativeDir);
}
return res;
}
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index 4056ddbd752..dace2102d9d 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -283,6 +283,7 @@ struct CanonicalSymbol
: editor(editor), info(info)
{
typeOfExpression.init(info.doc, info.snapshot);
+ typeOfExpression.setExpandTemplates(true);
}
const LookupContext &context() const
diff --git a/src/plugins/cpptools/cppchecksymbols.cpp b/src/plugins/cpptools/cppchecksymbols.cpp
index 4e8bd9e3e57..6ae41a37842 100644
--- a/src/plugins/cpptools/cppchecksymbols.cpp
+++ b/src/plugins/cpptools/cppchecksymbols.cpp
@@ -1227,6 +1227,7 @@ bool CheckSymbols::maybeAddFunction(const QList &candidates, NameAST
{
unsigned startToken = ast->firstToken();
bool isDestructor = false;
+ bool isConstructor = false;
if (DestructorNameAST *dtor = ast->asDestructorName()) {
isDestructor = true;
if (dtor->unqualified_name)
@@ -1251,6 +1252,8 @@ bool CheckSymbols::maybeAddFunction(const QList &candidates, NameAST
if (isDestructor != c->name()->isDestructorNameId())
continue;
+ isConstructor = isConstructorDeclaration(c);
+
Function *funTy = c->type()->asFunctionType();
if (! funTy) {
//Try to find a template function
@@ -1283,7 +1286,9 @@ bool CheckSymbols::maybeAddFunction(const QList &candidates, NameAST
}
if (matchType != Match_None) {
+ // decide how constructor and destructor should be highlighted
if (highlightCtorDtorAsType
+ && (isConstructor || isDestructor)
&& maybeType(ast->name)
&& kind == SemanticInfo::FunctionUse) {
return false;
@@ -1386,3 +1391,12 @@ void CheckSymbols::flush()
_usages.clear();
_usages.reserve(cap);
}
+
+bool CheckSymbols::isConstructorDeclaration(Symbol *declaration)
+{
+ Class *clazz = declaration->enclosingClass();
+ if (clazz && clazz->name())
+ return declaration->name()->isEqualTo(clazz->name());
+
+ return false;
+}
diff --git a/src/plugins/cpptools/cppchecksymbols.h b/src/plugins/cpptools/cppchecksymbols.h
index 69ac7e25304..814516f221e 100644
--- a/src/plugins/cpptools/cppchecksymbols.h
+++ b/src/plugins/cpptools/cppchecksymbols.h
@@ -166,6 +166,8 @@ protected:
void flush();
private:
+ bool isConstructorDeclaration(CPlusPlus::Symbol *declaration);
+
CPlusPlus::Document::Ptr _doc;
CPlusPlus::LookupContext _context;
CPlusPlus::TypeOfExpression typeOfExpression;
diff --git a/src/plugins/cpptools/cppcompletion_test.cpp b/src/plugins/cpptools/cppcompletion_test.cpp
index 657b6397aae..0af9130e96c 100644
--- a/src/plugins/cpptools/cppcompletion_test.cpp
+++ b/src/plugins/cpptools/cppcompletion_test.cpp
@@ -1796,3 +1796,50 @@ void CppToolsPlugin::test_completion_typedef_using_templates2()
QVERIFY(completions.contains(QLatin1String("Foo")));
QVERIFY(completions.contains(QLatin1String("bar")));
}
+
+void CppToolsPlugin::test_completion_namespace_alias_with_many_namespace_declarations()
+{
+ TestData data;
+ data.srcText =
+ "namespace NS1\n"
+ "{\n"
+ "namespace NS2\n"
+ "{\n"
+ "struct Foo1\n"
+ "{\n"
+ " int bar1;\n"
+ "};\n"
+ "}\n"
+ "}\n"
+ "namespace NS1\n"
+ "{\n"
+ "namespace NS2\n"
+ "{\n"
+ "struct Foo2\n"
+ "{\n"
+ " int bar2;\n"
+ "};\n"
+ "}\n"
+ "}\n"
+ "namespace NS = NS1::NS2;\n"
+ "int main()\n"
+ "{\n"
+ " @\n"
+ " // padding so we get the scope right\n"
+ "}\n"
+ ;
+ setup(&data);
+
+ Utils::ChangeSet change;
+ QString txt = QLatin1String("NS::");
+ change.insert(data.pos, txt);
+ QTextCursor cursor(data.doc);
+ change.apply(&cursor);
+ data.pos += txt.length();
+
+ QStringList completions = getCompletions(data);
+
+ QCOMPARE(completions.size(), 2);
+ QVERIFY(completions.contains(QLatin1String("Foo1")));
+ QVERIFY(completions.contains(QLatin1String("Foo2")));
+}
diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp
index 8f90aefb997..411619de287 100644
--- a/src/plugins/cpptools/cppcompletionassist.cpp
+++ b/src/plugins/cpptools/cppcompletionassist.cpp
@@ -502,7 +502,9 @@ public:
BasicProposalItem *operator()(Symbol *symbol)
{
- if (! symbol || ! symbol->name() || symbol->name()->isQualifiedNameId())
+ //using declaration can be qualified
+ if (! symbol || ! symbol->name() || (symbol->name()->isQualifiedNameId()
+ && ! symbol->asUsingDeclaration()))
return 0;
BasicProposalItem *previousItem = switchCompletionItem(0);
diff --git a/src/plugins/cpptools/cpptoolsplugin.h b/src/plugins/cpptools/cpptoolsplugin.h
index 179fa417623..4e6ead7b0a9 100644
--- a/src/plugins/cpptools/cpptoolsplugin.h
+++ b/src/plugins/cpptools/cpptoolsplugin.h
@@ -122,6 +122,7 @@ private slots:
void test_completion_template_specialization_with_pointer();
void test_completion_typedef_using_templates1();
void test_completion_typedef_using_templates2();
+ void test_completion_namespace_alias_with_many_namespace_declarations();
void test_format_pointerdeclaration_in_simpledeclarations();
void test_format_pointerdeclaration_in_simpledeclarations_data();
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index 78c42430757..c508cc2f4ab 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -381,8 +381,10 @@ void QmlEngine::tryToConnect(quint16 port)
if (state() == EngineRunRequested) {
if (isSlaveEngine()) {
// Probably cpp is being debugged and hence we did not get the output yet.
- if (!masterEngine()->isDying())
+ if (!masterEngine()->isDying()) {
+ m_noDebugOutputTimer.setInterval(4000);
m_noDebugOutputTimer.start();
+ }
else
appStartupFailed(tr("No application output received in time"));
} else {
diff --git a/src/plugins/qmldesigner/components/formeditor/resizecontroller.cpp b/src/plugins/qmldesigner/components/formeditor/resizecontroller.cpp
index c60d0cf5918..022c2aedea9 100644
--- a/src/plugins/qmldesigner/components/formeditor/resizecontroller.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/resizecontroller.cpp
@@ -158,6 +158,11 @@ ResizeController::ResizeController(const ResizeController &other)
}
+ResizeController::ResizeController(const WeakResizeController &resizeController)
+ : m_data(resizeController.m_data.toStrongRef())
+{
+}
+
ResizeController::~ResizeController()
{
}
@@ -263,11 +268,6 @@ FormEditorItem* ResizeController::formEditorItem() const
return m_data->formEditorItem.data();
}
-QWeakPointer ResizeController::weakPointer() const
-{
- return m_data;
-}
-
bool ResizeController::isTopLeftHandle(const ResizeHandleItem *handle) const
{
return handle == m_data->topLeftItem;
@@ -308,4 +308,41 @@ bool ResizeController::isBottomHandle(const ResizeHandleItem *handle) const
return handle == m_data->bottomItem;
}
+WeakResizeController ResizeController::toWeakResizeController() const
+{
+ return WeakResizeController(*this);
+}
+
+WeakResizeController::WeakResizeController()
+{
+
+}
+
+WeakResizeController::WeakResizeController(const WeakResizeController &resizeController)
+ : m_data(resizeController.m_data)
+{
+}
+
+WeakResizeController::WeakResizeController(const ResizeController &resizeController)
+ : m_data(resizeController.m_data.toWeakRef())
+{
+}
+
+WeakResizeController::~WeakResizeController()
+{
+}
+
+WeakResizeController &WeakResizeController::operator =(const WeakResizeController &other)
+{
+ if (m_data != other.m_data)
+ m_data = other.m_data;
+
+ return *this;
+}
+
+ResizeController WeakResizeController::toResizeController() const
+{
+ return ResizeController(*this);
+}
+
}
diff --git a/src/plugins/qmldesigner/components/formeditor/resizecontroller.h b/src/plugins/qmldesigner/components/formeditor/resizecontroller.h
index d0d53bef5f3..e5f47379081 100644
--- a/src/plugins/qmldesigner/components/formeditor/resizecontroller.h
+++ b/src/plugins/qmldesigner/components/formeditor/resizecontroller.h
@@ -41,15 +41,17 @@ class LayerItem;
class ResizeHandleItem;
class ResizeControllerData;
+class WeakResizeController;
+
class ResizeController
{
+ friend class WeakResizeController;
public:
- friend class ResizeHandleItem;
-
ResizeController();
ResizeController(LayerItem *layerItem, FormEditorItem *formEditorItem);
ResizeController(const ResizeController &resizeController);
+ ResizeController(const WeakResizeController &resizeController);
~ResizeController();
ResizeController& operator=(const ResizeController &other);
@@ -73,13 +75,32 @@ public:
bool isRightHandle(const ResizeHandleItem *handle) const;
bool isBottomHandle(const ResizeHandleItem *handle) const;
+ WeakResizeController toWeakResizeController() const;
+
+
private: // functions
ResizeController(const QSharedPointer &data);
- QWeakPointer weakPointer() const;
private: // variables
QSharedPointer m_data;
};
+class WeakResizeController
+{
+ friend class ResizeController;
+public:
+ WeakResizeController();
+ WeakResizeController(const WeakResizeController &resizeController);
+ WeakResizeController(const ResizeController &resizeController);
+ ~WeakResizeController();
+
+ WeakResizeController& operator=(const WeakResizeController &other);
+
+ ResizeController toResizeController() const;
+
+private: // variables
+ QWeakPointer m_data;
+};
+
}
#endif // RESIZECONTROLLER_H
diff --git a/src/plugins/qmldesigner/components/formeditor/resizehandleitem.cpp b/src/plugins/qmldesigner/components/formeditor/resizehandleitem.cpp
index 794812ed3b3..407a385cf21 100644
--- a/src/plugins/qmldesigner/components/formeditor/resizehandleitem.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/resizehandleitem.cpp
@@ -36,7 +36,7 @@ namespace QmlDesigner {
ResizeHandleItem::ResizeHandleItem(QGraphicsItem *parent, const ResizeController &resizeController)
: QGraphicsPixmapItem(QPixmap(":/icon/handle/resize_handle.png"), parent),
- m_resizeControllerData(resizeController.weakPointer())
+ m_weakResizeController(resizeController.toWeakResizeController())
{
setShapeMode(QGraphicsPixmapItem::BoundingRectShape);
setOffset(-pixmap().rect().center());
@@ -44,6 +44,10 @@ ResizeHandleItem::ResizeHandleItem(QGraphicsItem *parent, const ResizeController
setFlag(QGraphicsItem::ItemIgnoresTransformations, true);
}
+ResizeHandleItem::~ResizeHandleItem()
+{
+}
+
void ResizeHandleItem::setHandlePosition(const QPointF & globalPosition, const QPointF & itemSpacePosition)
{
m_itemSpacePosition = itemSpacePosition;
@@ -62,8 +66,7 @@ QPainterPath ResizeHandleItem::shape() const
ResizeController ResizeHandleItem::resizeController() const
{
- Q_ASSERT(!m_resizeControllerData.isNull());
- return ResizeController(m_resizeControllerData.toStrongRef());
+ return ResizeController(m_weakResizeController.toResizeController());
}
ResizeHandleItem* ResizeHandleItem::fromGraphicsItem(QGraphicsItem *item)
diff --git a/src/plugins/qmldesigner/components/formeditor/resizehandleitem.h b/src/plugins/qmldesigner/components/formeditor/resizehandleitem.h
index 1dc203347c1..35d68d5e8e3 100644
--- a/src/plugins/qmldesigner/components/formeditor/resizehandleitem.h
+++ b/src/plugins/qmldesigner/components/formeditor/resizehandleitem.h
@@ -48,7 +48,7 @@ public:
ResizeHandleItem(QGraphicsItem *parent, const ResizeController &resizeController);
-
+ ~ResizeHandleItem();
void setHandlePosition(const QPointF & globalPosition, const QPointF & itemSpacePosition);
int type() const;
@@ -72,7 +72,7 @@ public:
QPointF itemSpacePosition() const;
private:
- QWeakPointer m_resizeControllerData;
+ WeakResizeController m_weakResizeController;
QPointF m_itemSpacePosition;
};
diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
index 957b02a9e6f..9c36456e9d6 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
@@ -618,6 +618,7 @@ PropertyNameList NavigatorTreeModel::visibleProperties(const ModelNode &node) co
if (!propertyName.contains('.') && //do not show any dot properties, since they are tricky and unlikely to make sense
node.metaInfo().propertyIsWritable(propertyName) && !m_hiddenProperties.contains(propertyName) &&
!node.metaInfo().propertyIsEnumType(propertyName) && //Some enums have the same name as Qml types (e. g. Flow)
+ !node.metaInfo().propertyIsPrivate(propertyName) && //Do not show private properties
propertyName != node.metaInfo().defaultPropertyName()) { // TODO: ask the node instances
TypeName qmlType = qmlTypeInQtContainer(node.metaInfo().propertyTypeName(propertyName));
diff --git a/src/plugins/qmldesigner/componentsplugin/QtDesktop/ButtonSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml
similarity index 100%
rename from src/plugins/qmldesigner/componentsplugin/QtDesktop/ButtonSpecifics.qml
rename to src/plugins/qmldesigner/componentsplugin/Controls/ButtonSpecifics.qml
diff --git a/src/plugins/qmldesigner/componentsplugin/QtDesktop/CheckBoxSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/CheckBoxSpecifics.qml
similarity index 100%
rename from src/plugins/qmldesigner/componentsplugin/QtDesktop/CheckBoxSpecifics.qml
rename to src/plugins/qmldesigner/componentsplugin/Controls/CheckBoxSpecifics.qml
diff --git a/src/plugins/qmldesigner/componentsplugin/QtDesktop/ComboBoxSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml
similarity index 92%
rename from src/plugins/qmldesigner/componentsplugin/QtDesktop/ComboBoxSpecifics.qml
rename to src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml
index 677a3a0dc4e..151d47bd32b 100644
--- a/src/plugins/qmldesigner/componentsplugin/QtDesktop/ComboBoxSpecifics.qml
+++ b/src/plugins/qmldesigner/componentsplugin/Controls/ComboBoxSpecifics.qml
@@ -35,13 +35,6 @@ GroupBox {
caption: "Combo Box"
layout: VerticalLayout {
- ColorGroupBox {
- text: qsTr("Text")
- toolTip: qsTr("The text shown on the combobox")
- finished: finishedNotify
- backendColor: backendValues.textColor
- }
-
QWidget {
layout: HorizontalLayout {
Label {
diff --git a/src/plugins/qmldesigner/componentsplugin/QtDesktop/RadioButtonSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/RadioButtonSpecifics.qml
similarity index 100%
rename from src/plugins/qmldesigner/componentsplugin/QtDesktop/RadioButtonSpecifics.qml
rename to src/plugins/qmldesigner/componentsplugin/Controls/RadioButtonSpecifics.qml
diff --git a/src/plugins/qmldesigner/componentsplugin/QtDesktop/TextAreaSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/TextAreaSpecifics.qml
similarity index 100%
rename from src/plugins/qmldesigner/componentsplugin/QtDesktop/TextAreaSpecifics.qml
rename to src/plugins/qmldesigner/componentsplugin/Controls/TextAreaSpecifics.qml
diff --git a/src/plugins/qmldesigner/componentsplugin/QtDesktop/TextFieldSpecifics.qml b/src/plugins/qmldesigner/componentsplugin/Controls/TextFieldSpecifics.qml
similarity index 100%
rename from src/plugins/qmldesigner/componentsplugin/QtDesktop/TextFieldSpecifics.qml
rename to src/plugins/qmldesigner/componentsplugin/Controls/TextFieldSpecifics.qml
diff --git a/src/plugins/qmldesigner/componentsplugin/components.metainfo b/src/plugins/qmldesigner/componentsplugin/components.metainfo
index 8dbc57b9b80..206d719a246 100644
--- a/src/plugins/qmldesigner/componentsplugin/components.metainfo
+++ b/src/plugins/qmldesigner/componentsplugin/components.metainfo
@@ -1,94 +1,107 @@
MetaInfo {
Type {
- name: "QtDesktop.Button"
+ name: "QtQuick.Controls.Button"
icon: ":/componentsplugin/images/button16.png"
ItemLibraryEntry {
name: "Button"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/button.png"
version: "1.0"
- requiredImport: "QtDesktop"
+ requiredImport: "QtQuick.Controls"
Property { name: "text"; type: "QString"; value: "Button"; }
}
}
Type {
- name: "QtDesktop.CheckBox"
+ name: "QtQuick.Controls.SpinBox"
+ icon: ":/componentsplugin/images/window16.png"
+
+ ItemLibraryEntry {
+ name: "SpinBox"
+ category: "Qt Quick - Controls"
+ libraryIcon: ":/componentsplugin/images/window.png"
+ version: "1.0"
+ requiredImport: "QtQuick.Controls"
+ }
+ }
+
+ Type {
+ name: "QtQuick.Controls.CheckBox"
icon: ":/componentsplugin/images/checkbox16.png"
ItemLibraryEntry {
name: "Check Box"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/checkbox.png"
version: "1.0"
- requiredImport: "QtDesktop"
+ requiredImport: "QtQuick.Controls"
Property { name: "text"; type: "QString"; value: "Check Box"; }
}
}
Type {
- name: "QtDesktop.RadioButton"
+ name: "QtQuick.Controls.RadioButton"
icon: ":/componentsplugin/images/radiobutton16.png"
ItemLibraryEntry {
name: "Radio Button"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/radiobutton.png"
version: "1.0"
- requiredImport: "QtDesktop"
+ requiredImport: "QtQuick.Controls"
Property { name: "text"; type: "QString"; value: "Radio Button"; }
}
}
Type {
- name: "QtDesktop.ComboBox"
+ name: "QtQuick.Controls.ComboBox"
icon: ":/componentsplugin/images/combobox16.png"
ItemLibraryEntry {
name: "Combo Box"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/combobox.png"
version: "1.0"
- requiredImport: "QtDesktop"
+ requiredImport: "QtQuick.Controls"
}
}
Type {
- name: "QtDesktop.ButtonRow"
+ name: "QtQuick.Controls.ButtonRow"
icon: ":/componentsplugin/images/buttonrow16.png"
ItemLibraryEntry {
name: "Button Row"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/buttonrow.png"
version: "1.0"
}
}
Type {
- name: "QtDesktop.ButtonColumn"
+ name: "QtQuick.Controls.ButtonColumn"
icon: ":/componentsplugin/images/buttoncolumn16.png"
ItemLibraryEntry {
name: "Button Column"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/buttoncolumn.png"
version: "1.0"
}
}
Type {
- name: "QtDesktop.Label"
+ name: "QtQuick.Controls.Label"
icon: ":/componentsplugin/images/label16.png"
ItemLibraryEntry {
name: "Label"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/label.png"
version: "1.0"
@@ -97,12 +110,12 @@ MetaInfo {
}
Type {
- name: "QtDesktop.TextField"
+ name: "QtQuick.Controls.TextField"
icon: ":/componentsplugin/images/textfield16.png"
ItemLibraryEntry {
name: "Text Field"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/textfield.png"
version: "1.0"
@@ -111,43 +124,43 @@ MetaInfo {
}
Type {
- name: "QtDesktop.TextArea"
+ name: "QtQuick.Controls.TextArea"
icon: ":/componentsplugin/images/textarea16.png"
ItemLibraryEntry {
name: "Text Area"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/textarea.png"
version: "1.0"
}
}
Type {
- name: "QtDesktop.ProgressBar"
+ name: "QtQuick.Controls.ProgressBar"
icon: ":/componentsplugin/images/progressbar16.png"
ItemLibraryEntry {
name: "Progress Bar"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/progressbar.png"
version: "1.0"
}
}
Type {
- name: "QtDesktop.Slider"
+ name: "QtQuick.Controls.Slider"
icon: ":/componentsplugin/images/sliderh16.png"
ItemLibraryEntry {
name: "Slider (Horizontal)"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/sliderh.png"
version: "1.0"
}
ItemLibraryEntry {
name: "Slider (Vertical)"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/sliderh.png"
version: "1.0"
Property { name: "orientation"; type: "int"; value: "0"; }
@@ -155,19 +168,19 @@ MetaInfo {
}
Type {
- name: "QtDesktop.ScrollBar"
+ name: "QtQuick.Controls.ScrollBar"
icon: ":/componentsplugin/images/scrollbar16.png"
ItemLibraryEntry {
name: "Scroll Bar (Horizontal)"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/scrollbarh.png"
version: "1.0"
}
ItemLibraryEntry {
name: "Scroll Bar (Vertical)"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/componentsplugin/images/scrollbarv.png"
version: "1.0"
Property { name: "orientation"; type: "int"; value: "0"; }
@@ -175,15 +188,15 @@ MetaInfo {
}
Type {
- name: "QtDesktop.ScrollArea"
- icon: ":/desktopplugin//images/window16.png"
+ name: "QtQuick.Controls.ScrollArea"
+ icon: ":/componentsplugin/images/window16.png"
ItemLibraryEntry {
name: "Scroll Area"
- category: "Qt Quick - Components"
- libraryIcon: ":/desktopplugin/images/window.png"
+ category: "Qt Quick - Controls"
+ libraryIcon: ":/componentsplugin/images/window.png"
version: "1.0"
- requiredImport: "QtDesktop"
+ requiredImport: "QtQuick.Controls"
Property { name: "width"; type: "int"; value: 360; }
Property { name: "height"; type: "int"; value: 300; }
@@ -191,15 +204,15 @@ MetaInfo {
}
Type {
- name: "QtDesktop.GroupBox"
- icon: ":/desktopplugin//images/window16.png"
+ name: "QtQuick.Controls.GroupBox"
+ icon: ":/componentsplugin/images/window16.png"
ItemLibraryEntry {
name: "Group Box"
- category: "Qt Quick - Components"
- libraryIcon: ":/desktopplugin/images/window.png"
+ category: "Qt Quick - Controls"
+ libraryIcon: ":/componentsplugin/images/window.png"
version: "1.0"
- requiredImport: "QtDesktop"
+ requiredImport: "QtQuick.Controls"
Property { name: "width"; type: "int"; value: 360; }
Property { name: "height"; type: "int"; value: 300; }
@@ -207,15 +220,15 @@ MetaInfo {
}
Type {
- name: "QtDesktop.Frame"
+ name: "QtQuick.Controls.Frame"
icon: ":/desktopplugin//images/window16.png"
ItemLibraryEntry {
name: "Frame"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/desktopplugin/images/window.png"
version: "1.0"
- requiredImport: "QtDesktop"
+ requiredImport: "QtQuick.Controls"
Property { name: "width"; type: "int"; value: 360; }
Property { name: "height"; type: "int"; value: 300; }
@@ -223,15 +236,15 @@ MetaInfo {
}
Type {
- name: "QtDesktop.ToolBar"
+ name: "QtQuick.Controls.ToolBar"
icon: ":/desktopplugin/images/toolbar16.png"
ItemLibraryEntry {
name: "Tool Bar"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
libraryIcon: ":/desktopplugin/images/toolbar.png"
version: "1.0"
- requiredImport: "QtDesktop"
+ requiredImport: "QtQuick.Controls"
Property { name: "width"; type: "int"; value: 360; }
Property { name: "height"; type: "int"; value: 50; }
@@ -239,15 +252,15 @@ MetaInfo {
}
Type {
- name: "QtDesktop.Dial"
+ name: "QtQuick.Controls.Dial"
//icon: ":/desktopplugin/images/progressbar16.png"
ItemLibraryEntry {
name: "Dial"
- category: "Qt Quick - Components"
+ category: "Qt Quick - Controls"
//libraryIcon: ":/desktopplugin/images/progressbar.png"
version: "1.0"
- requiredImport: "QtDesktop"
+ requiredImport: "QtQuick.Controls"
Property { name: "width"; type: "int"; value: 100; }
Property { name: "height"; type: "int"; value: 100; }
diff --git a/src/plugins/qmldesigner/componentsplugin/componentsplugin.qrc b/src/plugins/qmldesigner/componentsplugin/componentsplugin.qrc
index b2d718aa6b4..c139996ee00 100644
--- a/src/plugins/qmldesigner/componentsplugin/componentsplugin.qrc
+++ b/src/plugins/qmldesigner/componentsplugin/componentsplugin.qrc
@@ -36,12 +36,12 @@
images/window.png
images/window16.png
-
- QtDesktop/ButtonSpecifics.qml
- QtDesktop/TextFieldSpecifics.qml
- QtDesktop/TextAreaSpecifics.qml
- QtDesktop/ComboBoxSpecifics.qml
- QtDesktop/CheckBoxSpecifics.qml
- QtDesktop/RadioButtonSpecifics.qml
+
+ Controls/ButtonSpecifics.qml
+ Controls/TextFieldSpecifics.qml
+ Controls/TextAreaSpecifics.qml
+ Controls/ComboBoxSpecifics.qml
+ Controls/CheckBoxSpecifics.qml
+ Controls/RadioButtonSpecifics.qml
diff --git a/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp b/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp
index df647e181f9..37af895cea9 100644
--- a/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp
+++ b/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.cpp
@@ -42,13 +42,15 @@ AddPropertyVisitor::AddPropertyVisitor(QmlDesigner::TextModifier &modifier,
const QmlDesigner::PropertyName &name,
const QString &value,
QmlRefactoring::PropertyType propertyType,
- const PropertyNameList &propertyOrder):
+ const PropertyNameList &propertyOrder,
+ const QmlDesigner::TypeName &dynamicTypeName) :
QMLRewriter(modifier),
m_parentLocation(parentLocation),
m_name(name),
m_value(value),
m_propertyType(propertyType),
- m_propertyOrder(propertyOrder)
+ m_propertyOrder(propertyOrder),
+ m_dynamicTypeName(dynamicTypeName)
{
}
@@ -147,6 +149,9 @@ void AddPropertyVisitor::addInMembers(QmlJS::AST::UiObjectInitializer *initializ
Q_ASSERT(!"unknown property type");
}
+ if (!m_dynamicTypeName.isEmpty())
+ newPropertyTemplate.prepend(QString(QLatin1String("property %1 ")).arg(QString::fromUtf8(m_dynamicTypeName)));
+
if (isOneLiner) {
if (needsPreceedingSemicolon)
newPropertyTemplate.prepend(QLatin1Char(';'));
diff --git a/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.h b/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.h
index c5da91fbaa9..869edf50030 100644
--- a/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.h
+++ b/src/plugins/qmldesigner/designercore/filemanager/addpropertyvisitor.h
@@ -45,7 +45,8 @@ public:
const QmlDesigner::PropertyName &name,
const QString &value,
QmlDesigner::QmlRefactoring::PropertyType propertyType,
- const PropertyNameList &propertyOrder);
+ const PropertyNameList &propertyOrder,
+ const QmlDesigner::TypeName &dynamicTypeName);
protected:
virtual bool visit(QmlJS::AST::UiObjectDefinition *ast);
@@ -60,6 +61,7 @@ private:
QString m_value;
QmlRefactoring::PropertyType m_propertyType;
PropertyNameList m_propertyOrder;
+ QmlDesigner::TypeName m_dynamicTypeName;
};
} // namespace Internal
diff --git a/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.cpp b/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.cpp
index a5646cdd02d..674e2a1aa7f 100644
--- a/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.cpp
+++ b/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.cpp
@@ -103,12 +103,16 @@ bool QmlRefactoring::addToObjectMemberList(int parentLocation, const QString &co
return visit(qmlDocument->qmlProgram());
}
-bool QmlRefactoring::addProperty(int parentLocation, const PropertyName &name, const QString &value, PropertyType propertyType)
+bool QmlRefactoring::addProperty(int parentLocation,
+ const PropertyName &name,
+ const QString &value,
+ PropertyType propertyType,
+ const TypeName &dynamicTypeName)
{
if (parentLocation < 0)
return false;
- AddPropertyVisitor visit(*textModifier, (quint32) parentLocation, name, value, propertyType, m_propertyOrder);
+ AddPropertyVisitor visit(*textModifier, (quint32) parentLocation, name, value, propertyType, m_propertyOrder, dynamicTypeName);
return visit(qmlDocument->qmlProgram());
}
diff --git a/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.h b/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.h
index 62359333791..c6376cfbf41 100644
--- a/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.h
+++ b/src/plugins/qmldesigner/designercore/filemanager/qmlrefactoring.h
@@ -60,7 +60,11 @@ public:
bool addToArrayMemberList(int parentLocation, const PropertyName &propertyName, const QString &content);
bool addToObjectMemberList(int parentLocation, const QString &content);
- bool addProperty(int parentLocation, const PropertyName &name, const QString &value, PropertyType propertyType);
+ bool addProperty(int parentLocation,
+ const PropertyName &name,
+ const QString &value,
+ PropertyType propertyType,
+ const TypeName &dynamicTypeName = TypeName());
bool changeProperty(int parentLocation, const PropertyName &name, const QString &value, PropertyType propertyType);
bool changeObjectType(int nodeLocation, const QString &newType);
diff --git a/src/plugins/qmldesigner/designercore/include/nodemetainfo.h b/src/plugins/qmldesigner/designercore/include/nodemetainfo.h
index c2c4766bb0a..0ece87b058c 100644
--- a/src/plugins/qmldesigner/designercore/include/nodemetainfo.h
+++ b/src/plugins/qmldesigner/designercore/include/nodemetainfo.h
@@ -79,6 +79,7 @@ public:
bool propertyIsWritable(const PropertyName &propertyName) const;
bool propertyIsListProperty(const PropertyName &propertyName) const;
bool propertyIsEnumType(const PropertyName &propertyName) const;
+ bool propertyIsPrivate(const PropertyName &propertyName) const;
QString propertyEnumScope(const PropertyName &propertyName) const;
QStringList propertyKeysForEnum(const PropertyName &propertyName) const;
QVariant propertyCastedValue(const PropertyName &propertyName, const QVariant &value) const;
diff --git a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
index 9a99ea08bdc..0a1b6ba0aa2 100644
--- a/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
+++ b/src/plugins/qmldesigner/designercore/metainfo/nodemetainfo.cpp
@@ -593,7 +593,7 @@ const QmlJS::CppComponentValue *NodeMetaInfoPrivate::getCppComponentValue() cons
return cppValue;
}
- return 0;
+ return value_cast(getObjectValue());
}
const QmlJS::ObjectValue *NodeMetaInfoPrivate::getObjectValue() const
@@ -1129,6 +1129,11 @@ bool NodeMetaInfo::propertyIsEnumType(const PropertyName &propertyName) const
return m_privateData->isPropertyEnum(propertyName);
}
+bool NodeMetaInfo::propertyIsPrivate(const PropertyName &propertyName) const
+{
+ return propertyName.startsWith("__");
+}
+
QString NodeMetaInfo::propertyEnumScope(const PropertyName &propertyName) const
{
return m_privateData->propertyEnumScope(propertyName);
diff --git a/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp b/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp
index 482a3e45d27..3346eef6a62 100644
--- a/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp
+++ b/src/plugins/qmldesigner/designercore/model/bindingproperty.cpp
@@ -62,6 +62,9 @@ void BindingProperty::setExpression(const QString &expression)
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
+ if (isDynamic())
+ qWarning() << "Calling BindingProperty::setExpression on dynamic property.";
+
if (name() == "id") { // the ID for a node is independent of the state, so it has to be set with ModelNode::setId
throw InvalidPropertyException(__LINE__, __FUNCTION__, __FILE__, name());
}
diff --git a/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp b/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp
index 0b41ad18eeb..1b438b2dfa5 100644
--- a/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp
+++ b/src/plugins/qmldesigner/designercore/model/qmlmodelview.cpp
@@ -124,7 +124,7 @@ QmlItemNode QmlModelView::createQmlItemNodeFromImage(const QString &imageName, c
}
}
- if (!model()->imports().contains(newImport))
+ if (!model()->hasImport(newImport, true, true))
model()->changeImports(QList() << newImport, QList());
QList > propertyPairList;
@@ -140,8 +140,13 @@ QmlItemNode QmlModelView::createQmlItemNodeFromImage(const QString &imageName, c
}
propertyPairList.append(qMakePair(PropertyName("source"), QVariant(relativeImageName)));
- newNode = createQmlItemNode("QtQuick.Image", -1, -1, propertyPairList);
- parentNode.nodeAbstractProperty("data").reparentHere(newNode);
+ NodeMetaInfo metaInfo = model()->metaInfo("QtQuick.Image");
+ if (metaInfo.isValid()) {
+ int minorVersion = metaInfo.minorVersion();
+ int majorVersion = metaInfo.majorVersion();
+ newNode = createQmlItemNode("QtQuick.Image", majorVersion, minorVersion, propertyPairList);
+ parentNode.nodeAbstractProperty("data").reparentHere(newNode);
+ }
Q_ASSERT(newNode.isValid());
diff --git a/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp b/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp
index 1fe6d0e0272..4fa4a8b82ba 100644
--- a/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp
+++ b/src/plugins/qmldesigner/designercore/model/qmltextgenerator.cpp
@@ -230,10 +230,21 @@ QString QmlTextGenerator::propertyToQml(const AbstractProperty &property, int in
{
QString result;
- if (property.isDefaultProperty())
+ if (property.isDefaultProperty()) {
result = toQml(property, indentDepth);
- else
- result = QString(indentDepth, QLatin1Char(' ')) + property.name() + QLatin1String(": ") + toQml(property, indentDepth);
+ } else {
+ if (property.isDynamic()) {
+ result = QString(indentDepth, QLatin1Char(' '))
+ + QLatin1String("property ")
+ + property.dynamicTypeName()
+ + QLatin1String(" ")
+ + property.name()
+ + QLatin1String(": ")
+ + toQml(property, indentDepth);
+ } else {
+ result = QString(indentDepth, QLatin1Char(' ')) + property.name() + QLatin1String(": ") + toQml(property, indentDepth);
+ }
+ }
result += QLatin1Char('\n');
diff --git a/src/plugins/qmldesigner/designercore/model/rewriteaction.cpp b/src/plugins/qmldesigner/designercore/model/rewriteaction.cpp
index 91875e09797..41abf3d2cb7 100644
--- a/src/plugins/qmldesigner/designercore/model/rewriteaction.cpp
+++ b/src/plugins/qmldesigner/designercore/model/rewriteaction.cpp
@@ -107,7 +107,7 @@ bool AddPropertyRewriteAction::execute(QmlRefactoring &refactoring, ModelNodePos
<< info();
}
} else {
- result = refactoring.addProperty(nodeLocation, m_property.name(), m_valueText, m_propertyType);
+ result = refactoring.addProperty(nodeLocation, m_property.name(), m_valueText, m_propertyType, m_property.dynamicTypeName());
if (!result) {
qDebug() << "*** AddPropertyRewriteAction::execute failed in addProperty("
diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
index e33fa21844c..b436ecdf851 100644
--- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
+++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp
@@ -69,7 +69,7 @@ namespace {
static inline QStringList supportedVersionsList()
{
QStringList list;
- list << QLatin1String("1.0") << QLatin1String("1.1") << QLatin1String("2.0");
+ list << QLatin1String("1.0") << QLatin1String("1.1") << QLatin1String("2.0") << QLatin1String("2.1");
return list;
}
@@ -776,9 +776,9 @@ bool TextToModelMerger::load(const QString &data, DifferenceHandler &differenceH
check.disableMessage(StaticAnalysis::ErrCouldNotResolvePrototypeOf);
foreach (StaticAnalysis::Type type, StaticAnalysis::Message::allMessageTypes()) {
- StaticAnalysis::Message message(type, AST::SourceLocation());
- if (message.severity == StaticAnalysis::MaybeWarning
- || message.severity == StaticAnalysis::Warning) {
+ StaticAnalysis::PrototypeMessageData prototypeMessageData = StaticAnalysis::Message::prototypeForMessageType(type);
+ if (prototypeMessageData.severity == StaticAnalysis::MaybeWarning
+ || prototypeMessageData.severity == StaticAnalysis::Warning) {
check.disableMessage(type);
}
}
@@ -1358,10 +1358,9 @@ void ModelValidator::signalHandlerSourceDiffer(SignalHandlerProperty &modelPrope
Q_ASSERT(0);
}
-void ModelValidator::shouldBeSignalHandlerProperty(AbstractProperty &modelProperty, const QString &javascript)
+void ModelValidator::shouldBeSignalHandlerProperty(AbstractProperty &modelProperty, const QString & /*javascript*/)
{
Q_UNUSED(modelProperty)
- Q_UNUSED(javascript)
Q_ASSERT(modelProperty.isSignalHandlerProperty());
Q_ASSERT(0);
}
diff --git a/src/plugins/qmldesigner/designercore/model/variantproperty.cpp b/src/plugins/qmldesigner/designercore/model/variantproperty.cpp
index 37800f1b52f..8c1bb0fd73f 100644
--- a/src/plugins/qmldesigner/designercore/model/variantproperty.cpp
+++ b/src/plugins/qmldesigner/designercore/model/variantproperty.cpp
@@ -61,6 +61,9 @@ void VariantProperty::setValue(const QVariant &value)
if (!isValid())
throw InvalidModelNodeException(__LINE__, __FUNCTION__, __FILE__);
+ if (isDynamic())
+ qWarning() << "Calling VariantProperty::setValue on dynamic property.";
+
if (value.isNull())
throw InvalidArgumentException(__LINE__, __FUNCTION__, __FILE__, name());
diff --git a/src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp b/src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp
index 955ed226d43..22b60051b28 100644
--- a/src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp
+++ b/src/plugins/qnx/blackberrydebugtokenrequestdialog.cpp
@@ -51,7 +51,7 @@ BlackBerryDebugTokenRequestDialog::BlackBerryDebugTokenRequestDialog(
m_ui->setupUi(this);
m_ui->progressBar->hide();
m_ui->status->clear();
- m_ui->debugTokenPath->setExpectedKind(Utils::PathChooser::Any);
+ m_ui->debugTokenPath->setExpectedKind(Utils::PathChooser::SaveFile);
m_ui->debugTokenPath->setPromptDialogTitle(tr("Request Debug Token"));
m_ui->debugTokenPath->setPromptDialogFilter(tr("BAR Files (*.bar)"));
@@ -67,8 +67,12 @@ BlackBerryDebugTokenRequestDialog::BlackBerryDebugTokenRequestDialog(
this, SLOT(requestDebugToken()));
connect(m_ui->debugTokenPath, SIGNAL(changed(QString)),
this, SLOT(validate()));
+ connect(m_ui->debugTokenPath, SIGNAL(beforeBrowsing()),
+ this, SLOT(setDefaultPath()));
connect(m_ui->debugTokenPath, SIGNAL(editingFinished()),
this, SLOT(appendExtension()));
+ connect(m_ui->debugTokenPath, SIGNAL(editingFinished()),
+ this, SLOT(expandPath()));
connect(m_ui->keystorePassword, SIGNAL(textChanged(QString)),
this, SLOT(validate()));
connect(m_ui->cskPassword, SIGNAL(textChanged(QString)),
@@ -133,16 +137,47 @@ void BlackBerryDebugTokenRequestDialog::requestDebugToken()
m_ui->keystorePassword->text(), m_ui->devicePin->text());
}
+void BlackBerryDebugTokenRequestDialog::setDefaultPath()
+{
+ const QString path = m_ui->debugTokenPath->path();
+ const QString defaultFileName = QLatin1String("/debugToken.bar");
+
+ if (path.isEmpty()) {
+ m_ui->debugTokenPath->setPath(QDir::homePath() + defaultFileName);
+ return;
+ }
+
+ const QFileInfo fileInfo(path);
+
+ if (fileInfo.isDir())
+ m_ui->debugTokenPath->setPath(path + defaultFileName);
+}
+
void BlackBerryDebugTokenRequestDialog::appendExtension()
{
QString path = m_ui->debugTokenPath->path();
+ if (path.isEmpty())
+ return;
+
if (!path.endsWith(QLatin1String(".bar"))) {
path += QLatin1String(".bar");
m_ui->debugTokenPath->setPath(path);
}
}
+void BlackBerryDebugTokenRequestDialog::expandPath()
+{
+ const QString path = m_ui->debugTokenPath->path();
+
+ if (path.isEmpty() || path.startsWith(QLatin1String("/")))
+ return;
+
+ const QFileInfo fileInfo(path);
+
+ m_ui->debugTokenPath->setPath(fileInfo.absoluteFilePath());
+}
+
void BlackBerryDebugTokenRequestDialog::checkBoxChanged(int state)
{
if (state == Qt::Checked) {
diff --git a/src/plugins/qnx/blackberrydebugtokenrequestdialog.h b/src/plugins/qnx/blackberrydebugtokenrequestdialog.h
index e31a1fd8885..e70f56d528b 100644
--- a/src/plugins/qnx/blackberrydebugtokenrequestdialog.h
+++ b/src/plugins/qnx/blackberrydebugtokenrequestdialog.h
@@ -57,7 +57,9 @@ public:
private slots:
void validate();
void requestDebugToken();
+ void setDefaultPath();
void appendExtension();
+ void expandPath();
void checkBoxChanged(int state);
void debugTokenArrived(int status);
diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp
index ee10f0d4e33..2c7506dd1a6 100644
--- a/src/plugins/qt4projectmanager/qt4nodes.cpp
+++ b/src/plugins/qt4projectmanager/qt4nodes.cpp
@@ -2154,7 +2154,7 @@ TargetInformation Qt4ProFileNode::targetInformation(QtSupport::ProFileReader *re
result.executable = QDir::cleanPath(destDir + QLatin1Char('/') + result.target);
//qDebug() << "##### updateTarget sets:" << result.workingDir << result.executable;
- Utils::HostOsInfo::appendExecutableSuffix(result.executable);
+ result.executable = Utils::HostOsInfo::withExecutableSuffix(result.executable);
result.valid = true;
if (readerBP)
@@ -2234,7 +2234,7 @@ QString Qt4ProFileNode::buildDir(Qt4BuildConfiguration *bc) const
bc = static_cast(m_project->activeTarget()->activeBuildConfiguration());
if (!bc)
return QString();
- return QDir(bc->buildDirectory()).absoluteFilePath(relativeDir);
+ return QDir::cleanPath(QDir(bc->buildDirectory()).absoluteFilePath(relativeDir));
}
void Qt4ProFileNode::updateCodeModelSupportFromBuild()
diff --git a/src/plugins/todo/todoitemsprovider.cpp b/src/plugins/todo/todoitemsprovider.cpp
index c20b1b560dc..b2e985a6338 100644
--- a/src/plugins/todo/todoitemsprovider.cpp
+++ b/src/plugins/todo/todoitemsprovider.cpp
@@ -108,7 +108,7 @@ void TodoItemsProvider::createScanners()
void TodoItemsProvider::setItemsListWithinStartupProject()
{
QHashIterator > it(m_itemsHash);
- QStringList fileNames = m_startupProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles);
+ QSet fileNames = QSet::fromList(m_startupProject->files(ProjectExplorer::Project::ExcludeGeneratedFiles));
while (it.hasNext()) {
it.next();
if (fileNames.contains(it.key()))
diff --git a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp
index 3eafda67425..e8b8e98f54e 100644
--- a/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp
+++ b/tests/auto/cplusplus/checksymbols/tst_checksymbols.cpp
@@ -176,9 +176,14 @@ private slots:
void test_checksymbols_StaticUse();
void test_checksymbols_VariableHasTheSameNameAsEnumUse();
void test_checksymbols_NestedClassOfEnclosingTemplateUse();
+ void test_checksymbols_8902_staticFunctionHighlightingAsMember_localVariable();
+ void test_checksymbols_8902_staticFunctionHighlightingAsMember_functionArgument();
+ void test_checksymbols_8902_staticFunctionHighlightingAsMember_templateParameter();
+ void test_checksymbols_8902_staticFunctionHighlightingAsMember_struct();
void test_checksymbols_QTCREATORBUG8890_danglingPointer();
void test_checksymbols_QTCREATORBUG8974_danglingPointer();
+ void operatorAsteriskOfNestedClassOfTemplateClass_QTCREATORBUG9006();
};
void tst_CheckSymbols::test_checksymbols_TypeUse()
@@ -445,6 +450,112 @@ void tst_CheckSymbols::test_checksymbols_NestedClassOfEnclosingTemplateUse()
TestData::check(source, expectedUses);
}
+void tst_CheckSymbols::test_checksymbols_8902_staticFunctionHighlightingAsMember_localVariable()
+{
+ const QByteArray source =
+ "struct Foo\n"
+ "{\n"
+ " static int foo();\n"
+ "};\n"
+ "\n"
+ "void bar()\n"
+ "{\n"
+ " int foo = Foo::foo();\n"
+ "}\n"
+ ;
+
+ const QList