forked from qt-creator/qt-creator
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: Daniel Teske <daniel.teske@digia.com> Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Tobias Hunger
parent
9417bea9ac
commit
d94e7f259b
@@ -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;
|
||||
|
Reference in New Issue
Block a user