Commit d94e7f25 authored by Steven Ceuppens's avatar Steven Ceuppens Committed by Tobias Hunger
Browse files

Added QQuickItem to new class wizard



When creating a new class, you can select the "Base class" or "Type information"
QObject, QWidget, QDeclarativeItem... are available, but QQuickItem isn't..

Change-Id: I9fce6b6a43c915364fc405b99edd0b0d7ebab4fe
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 9417bea9
......@@ -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;
}
......
......@@ -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();
......
......@@ -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>
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment