diff --git a/src/libs/utils/newclasswidget.cpp b/src/libs/utils/newclasswidget.cpp index b564d5736734b79ffa9937ca50fec8c0a05800ee..a2a97fa5094f09c50272fadebed49594755b5f37 100644 --- a/src/libs/utils/newclasswidget.cpp +++ b/src/libs/utils/newclasswidget.cpp @@ -419,6 +419,8 @@ static inline NewClassWidget::ClassType classTypeForBaseClass(const QString &bas // Declarative Items if (baseClass == QLatin1String("QDeclarativeItem")) return NewClassWidget::ClassInheritsQDeclarativeItem; + if (baseClass == QLatin1String("QQuickItem")) + return NewClassWidget::ClassInheritsQQuickItem; return NewClassWidget::NoClassType; } diff --git a/src/libs/utils/newclasswidget.h b/src/libs/utils/newclasswidget.h index a9f1dc0d1fc8d3aefe1ad15190a4a9f05e07ad63..78c1852ebd9d73a40b4bd2c2cf44dd55b8066aed 100644 --- a/src/libs/utils/newclasswidget.h +++ b/src/libs/utils/newclasswidget.h @@ -71,9 +71,13 @@ class QTCREATOR_UTILS_EXPORT NewClassWidget : public QWidget Q_ENUMS(ClassType) public: - enum ClassType { NoClassType, ClassInheritsQObject, ClassInheritsQWidget, + enum ClassType { NoClassType, + ClassInheritsQObject, + ClassInheritsQWidget, ClassInheritsQDeclarativeItem, - SharedDataClass }; + ClassInheritsQQuickItem, + SharedDataClass + }; explicit NewClassWidget(QWidget *parent = 0); ~NewClassWidget(); diff --git a/src/libs/utils/newclasswidget.ui b/src/libs/utils/newclasswidget.ui index dc3c315e86b1e6e985f63f380f76ee31c9fbff71..7279892c553d7734980762431abf52392b1b9ae9 100644 --- a/src/libs/utils/newclasswidget.ui +++ b/src/libs/utils/newclasswidget.ui @@ -71,7 +71,12 @@ </item> <item> <property name="text"> - <string>Inherits QDeclarativeItem</string> + <string>Inherits QDeclarativeItem - Qt Quick 1</string> + </property> + </item> + <item> + <property name="text"> + <string>Inherits QQuickItem - Qt Quick 2</string> </property> </item> <item> diff --git a/src/plugins/cppeditor/cppclasswizard.cpp b/src/plugins/cppeditor/cppclasswizard.cpp index 64f56d7c3bc7cb4ba25863ac2ec6d63e8ed5de54..2f8cf1c4242c5a29a0e33ad6a9ad1d913948a87d 100644 --- a/src/plugins/cppeditor/cppclasswizard.cpp +++ b/src/plugins/cppeditor/cppclasswizard.cpp @@ -70,7 +70,8 @@ ClassNamePage::ClassNamePage(QWidget *parent) : << QLatin1String("QObject") << QLatin1String("QWidget") << QLatin1String("QMainWindow") - << QLatin1String("QDeclarativeItem")); + << QLatin1String("QDeclarativeItem") + << QLatin1String("QQuickItem")); m_newClassWidget->setBaseClassEditable(true); m_newClassWidget->setFormInputVisible(false); m_newClassWidget->setNamespacesEnabled(true); @@ -250,6 +251,10 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par parentQObjectClass = QLatin1String("QDeclarativeItem"); defineQObjectMacro = true; break; + case Utils::NewClassWidget::ClassInheritsQQuickItem: + parentQObjectClass = QLatin1String("QQuickItem"); + defineQObjectMacro = true; + break; case Utils::NewClassWidget::NoClassType: case Utils::NewClassWidget::SharedDataClass: break;