Commit 1f940786 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

Merge branch 'qml_renaming'

Conflicts:
	src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
	src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
parents 20d21db2 c7f7585b
......@@ -15,7 +15,7 @@ QFrame {
opacity: Behavior {
NumberAnimation {
easing: "easeInSine"
easing.type: "InSine"
duration: 200
}
}
......
......@@ -39,7 +39,7 @@
#include <QtGui/QApplication>
#ifndef NO_DECLARATIVE_BACKEND
# include <QtDeclarative/private/qmlstringconverters_p.h> // ### remove me
# include <QtDeclarative/private/qdeclarativestringconverters_p.h> // ### remove me
#endif
namespace QmlJS {
......@@ -141,7 +141,7 @@ public:
#ifndef NO_DECLARATIVE_BACKEND
bool ok = false;
QmlStringConverters::colorFromString(colorString, &ok);
QDeclarativeStringConverters::colorFromString(colorString, &ok);
if (!ok)
_message.message = QCoreApplication::translate("QmlJS::Check", "not a valid color");
#endif
......
......@@ -36,12 +36,11 @@
#include <QtCore/QDebug>
#ifndef NO_DECLARATIVE_BACKEND
# include <QtDeclarative/QmlType>
# include <QtDeclarative/QmlMetaType>
# include <QtDeclarative/private/qmlgraphicsanchors_p.h> // ### remove me
# include <QtDeclarative/private/qmlgraphicsrectangle_p.h> // ### remove me
# include <QtDeclarative/private/qmlvaluetype_p.h> // ### remove me
# include <QtDeclarative/private/qmlanimation_p.h> // ### remove me
# include <QtDeclarative/private/qdeclarativemetatype_p.h>
# include <QtDeclarative/private/qdeclarativeanchors_p.h> // ### remove me
# include <QtDeclarative/private/qdeclarativerectangle_p.h> // ### remove me
# include <QtDeclarative/private/qdeclarativevaluetype_p.h> // ### remove me
# include <QtDeclarative/private/qdeclarativeanimation_p.h> // ### remove me
#endif
using namespace QmlJS::Interpreter;
......@@ -232,8 +231,8 @@ void QmlObjectValue::processMembers(MemberProcessor *processor) const
const Value *QmlObjectValue::propertyValue(const QMetaProperty &prop) const
{
if (QmlMetaType::isQObject(prop.userType())) {
QmlType *qmlPropertyType = QmlMetaType::qmlType(prop.userType());
if (QDeclarativeMetaType::isQObject(prop.userType())) {
QDeclarativeType *qmlPropertyType = QDeclarativeMetaType::qmlType(prop.userType());
if (qmlPropertyType && !qmlPropertyType->qmlTypeName().isEmpty()) {
QString typeName = qmlPropertyType->qmlTypeName();
......@@ -254,7 +253,7 @@ const Value *QmlObjectValue::propertyValue(const QMetaProperty &prop) const
typeName.replace(QLatin1Char('.'), QLatin1Char('/'));
if (const ObjectValue *objectValue = engine()->newQmlObject(typeName, "", -1, -1)) // ### we should extend this to lookup the property types in the QmlType object, instead of the QMetaProperty.
if (const ObjectValue *objectValue = engine()->newQmlObject(typeName, "", -1, -1)) // ### we should extend this to lookup the property types in the QDeclarativeType object, instead of the QMetaProperty.
return objectValue;
}
}
......@@ -335,11 +334,11 @@ const Value *QmlObjectValue::propertyValue(const QMetaProperty &prop) const
} // end of switch
const QString typeName = prop.typeName();
if (typeName == QLatin1String("QmlGraphicsAnchorLine")) {
if (typeName == QLatin1String("QDeclarativeAnchorLine")) {
value = engine()->anchorLineValue();
}
if (value->asStringValue() && prop.name() == QLatin1String("easing")
&& isDerivedFrom(&QmlPropertyAnimation::staticMetaObject)) {
&& isDerivedFrom(&QDeclarativePropertyAnimation::staticMetaObject)) {
value = engine()->easingCurveNameValue();
}
......@@ -2156,13 +2155,13 @@ const Value *Engine::defaultValueForBuiltinType(const QString &typeName) const
#ifndef NO_DECLARATIVE_BACKEND
QmlObjectValue *Engine::newQmlObject(const QString &name, const QString &prefix, int majorVersion, int minorVersion)
{
if (name == QLatin1String("QmlGraphicsAnchors")) {
QmlObjectValue *object = new QmlObjectValue(&QmlGraphicsAnchors::staticMetaObject, QLatin1String("Anchors"), -1, -1, this);
if (name == QLatin1String("QDeclarativeAnchors")) {
QmlObjectValue *object = new QmlObjectValue(&QDeclarativeAnchors::staticMetaObject, QLatin1String("Anchors"), -1, -1, this);
return object;
} else if (name == QLatin1String("QmlGraphicsPen")) {
QmlObjectValue *object = new QmlObjectValue(&QmlGraphicsPen::staticMetaObject, QLatin1String("Pen"), -1, -1, this);
} else if (name == QLatin1String("QDeclarativePen")) {
QmlObjectValue *object = new QmlObjectValue(&QDeclarativePen::staticMetaObject, QLatin1String("Pen"), -1, -1, this);
return object;
} else if (name == QLatin1String("QmlGraphicsScaleGrid")) {
} else if (name == QLatin1String("QDeclarativeScaleGrid")) {
QmlObjectValue *object = new QmlObjectValue(&QObject::staticMetaObject, QLatin1String("ScaleGrid"), -1, -1, this);
object->setProperty("left", numberValue());
object->setProperty("top", numberValue());
......@@ -2174,7 +2173,7 @@ QmlObjectValue *Engine::newQmlObject(const QString &name, const QString &prefix,
// ### TODO: add support for QML packages
const QString componentName = prefix + QLatin1Char('/') + name;
if (QmlType *qmlType = QmlMetaType::qmlType(componentName.toUtf8(), majorVersion, minorVersion)) {
if (QDeclarativeType *qmlType = QDeclarativeMetaType::qmlType(componentName.toUtf8(), majorVersion, minorVersion)) {
const QString typeName = qmlType->qmlTypeName();
const QString strippedTypeName = typeName.mid(typeName.lastIndexOf('/') + 1);
QmlObjectValue *object = new QmlObjectValue(qmlType->metaObject(), strippedTypeName, majorVersion, minorVersion, this);
......
......@@ -31,8 +31,7 @@
#include "qmljsmetatypesystem.h"
#ifndef NO_DECLARATIVE_BACKEND
#include <QtDeclarative/QmlType>
#include <QtDeclarative/QmlMetaType>
#include <QtDeclarative/private/qdeclarativemetatype_p.h>
#endif // NO_DECLARATIVE_BACKEND
using namespace QmlJS;
......@@ -43,7 +42,7 @@ void MetaTypeSystem::reload(Interpreter::Engine *interpreter)
_importedTypes.clear();
#ifndef NO_DECLARATIVE_BACKEND
foreach (QmlType *type, QmlMetaType::qmlTypes()) {
foreach (QDeclarativeType *type, QDeclarativeMetaType::qmlTypes()) {
const QString fqType = type->qmlTypeName();
const int sepIdx = fqType.lastIndexOf(QLatin1Char('/'));
QString typeName;
......
......@@ -40,7 +40,7 @@ contains(QT_CONFIG, declarative) {
SUBDIRS += plugin_qmlprojectmanager \
plugin_qmlinspector
exists($$[QT_INSTALL_HEADERS]/QtDeclarative/private/qmlcontext_p.h) {
exists($$[QT_INSTALL_HEADERS]/QtDeclarative/private/qdeclarativecontext_p.h) {
SUBDIRS += plugin_qmldesigner
} else {
warning("QmlDesigner plugin disabled! It depends on private headers from QtDeclarative module, which seems not to be installed.")
......
......@@ -41,7 +41,7 @@ class QWidget;
class QIODevice;
class QProcess;
class QPlainTextEdit;
class QmlError;
class QDeclarativeError;
QT_END_NAMESPACE
namespace QmlDesigner {
......
......@@ -33,7 +33,7 @@
#include <QtGui/QTextEdit>
#include <QtGui/QMessageBox>
#include <QmlError>
#include <QDeclarativeError>
#include <model.h>
#include "designdocumentcontroller.h"
......
......@@ -42,7 +42,7 @@
#include <QtGui/QTabWidget>
#include <QtGui/QUndoGroup>
class QmlError;
class QDeclarativeError;
namespace QmlDesigner {
......
......@@ -54,9 +54,9 @@
#include <QFileIconProvider>
#include <QImageReader>
#include <QmlView>
#include <QmlGraphicsItem>
#include <private/qmlengine_p.h>
#include <QDeclarativeView>
#include <QDeclarativeItem>
#include <private/qdeclarativeengine_p.h>
namespace QmlDesigner {
......@@ -106,7 +106,7 @@ public:
Ui::ItemLibrary m_ui;
Internal::ItemLibraryModel *m_itemLibraryModel;
QmlView *m_itemsView;
QDeclarativeView *m_itemsView;
QDirModel *m_resourcesDirModel;
QString m_resourcePath;
QSize m_itemIconSize, m_resIconSize;
......@@ -147,24 +147,23 @@ ItemLibrary::ItemLibrary(QWidget *parent) :
m_d->m_ui.ItemLibraryTreeView->setAttribute(Qt::WA_MacShowFocusRect, false);
m_d->m_ui.ItemLibraryTreeView->setRootIndex(m_d->m_resourcesDirModel->index(m_d->m_resourcePath));
m_d->m_itemsView = new QmlView(this);
m_d->m_itemsView->setSource(QUrl("qrc:/ItemLibrary/qml/ItemsView.qml"));
m_d->m_itemsView = new QDeclarativeView(this);
m_d->m_itemsView->setAttribute(Qt::WA_OpaquePaintEvent);
m_d->m_itemsView->setAttribute(Qt::WA_NoSystemBackground);
m_d->m_itemsView->setAcceptDrops(false);
m_d->m_itemsView->setFocusPolicy(Qt::ClickFocus);
m_d->m_itemsView->setResizeMode(QmlView::SizeRootObjectToView);
m_d->m_itemsView->setResizeMode(QDeclarativeView::SizeRootObjectToView);
m_d->m_ui.ItemLibraryGridLayout->addWidget(m_d->m_itemsView, 0, 0);
m_d->m_itemLibraryModel = new Internal::ItemLibraryModel(QmlEnginePrivate::getScriptEngine(m_d->m_itemsView->engine()), this);
m_d->m_itemLibraryModel = new Internal::ItemLibraryModel(QDeclarativeEnginePrivate::getScriptEngine(m_d->m_itemsView->engine()), this);
m_d->m_itemLibraryModel->setItemIconSize(m_d->m_itemIconSize);
m_d->m_itemsView->rootContext()->setContextProperty(QLatin1String("itemLibraryModel"), m_d->m_itemLibraryModel);
m_d->m_itemsView->rootContext()->setContextProperty(QLatin1String("itemLibraryIconWidth"), m_d->m_itemIconSize.width());
m_d->m_itemsView->rootContext()->setContextProperty(QLatin1String("itemLibraryIconHeight"), m_d->m_itemIconSize.height());
m_d->m_itemsView->execute();
m_d->m_itemsView->setSource(QUrl("qrc:/ItemLibrary/qml/ItemsView.qml"));
QmlGraphicsItem *rootItem = qobject_cast<QmlGraphicsItem*>(m_d->m_itemsView->rootObject());
QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(m_d->m_itemsView->rootObject());
connect(rootItem, SIGNAL(itemSelected(int)), this, SLOT(showItemInfo(int)));
connect(rootItem, SIGNAL(itemDragged(int)), this, SLOT(startDragAndDrop(int)));
connect(this, SIGNAL(expandAllItems()), rootItem, SLOT(expandAll()));
......@@ -262,7 +261,7 @@ void ItemLibrary::startDragAndDrop(int itemLibId)
drag->setPreview(QPixmap::fromImage(image));
drag->setMimeData(mimeData);
QmlGraphicsItem *rootItem = qobject_cast<QmlGraphicsItem*>(m_d->m_itemsView->rootObject());
QDeclarativeItem *rootItem = qobject_cast<QDeclarativeItem*>(m_d->m_itemsView->rootObject());
connect(rootItem, SIGNAL(stopDragAndDrop()), drag, SLOT(stopDrag()));
drag->exec();
......
......@@ -44,7 +44,7 @@ namespace Internal {
template <class T>
ItemLibrarySortedModel<T>::ItemLibrarySortedModel(QObject *parent) :
QmlListModel(parent)
QDeclarativeListModel(parent)
{
}
......@@ -230,7 +230,7 @@ ItemLibrarySectionModel::ItemLibrarySectionModel(QScriptEngine *scriptEngine, in
QScriptValue::setProperty(QLatin1String("sectionLibId"), sectionLibId);
QScriptValue::setProperty(QLatin1String("sectionName"), sectionName);
QScriptValue::setProperty(QLatin1String("sectionEntries"),
scriptEngine->newVariant(QVariant::fromValue(static_cast<QmlListModel *>(&m_sectionEntries))));
scriptEngine->newVariant(QVariant::fromValue(static_cast<QDeclarativeListModel *>(&m_sectionEntries))));
}
......
......@@ -34,7 +34,7 @@
#include <QIcon>
#include <QVariant>
#include <QScriptEngine>
#include <private/qmllistmodel_p.h>
#include <private/qdeclarativelistmodel_p.h>
QT_FORWARD_DECLARE_CLASS(QMimeData);
......@@ -46,7 +46,7 @@ class ItemLibraryInfo;
namespace Internal {
template <class T>
class ItemLibrarySortedModel: public QmlListModel {
class ItemLibrarySortedModel: public QDeclarativeListModel {
public:
ItemLibrarySortedModel(QObject *parent = 0);
~ItemLibrarySortedModel();
......
......@@ -31,7 +31,6 @@
QT_BEGIN_NAMESPACE
QML_DEFINE_TYPE(Bauhaus,1,0,QBoxLayout,QBoxLayoutObject);
QBoxLayoutObject::QBoxLayoutObject(QObject *parent)
: QLayoutObject(parent), _layout(0)
......@@ -57,16 +56,22 @@ void QBoxLayoutObject::clearWidget()
{
}
QML_DEFINE_TYPE(Bauhaus,1,0,QHBoxLayout,QHBoxLayoutObject);
QHBoxLayoutObject::QHBoxLayoutObject(QObject *parent)
: QBoxLayoutObject(new QHBoxLayout, parent)
{
}
QML_DEFINE_TYPE(Bauhaus,1,0,QVBoxLayout,QVBoxLayoutObject);
QVBoxLayoutObject::QVBoxLayoutObject(QObject *parent)
: QBoxLayoutObject(new QVBoxLayout, parent)
{
}
void BasicLayouts::registerDeclarativeTypes()
{
QML_REGISTER_TYPE(Bauhaus,1,0,QBoxLayout,QBoxLayoutObject);
QML_REGISTER_TYPE(Bauhaus,1,0,QHBoxLayout,QHBoxLayoutObject);
QML_REGISTER_TYPE(Bauhaus,1,0,QVBoxLayout,QVBoxLayoutObject);
}
QT_END_NAMESPACE
......@@ -43,7 +43,7 @@ class QBoxLayoutObject : public QLayoutObject
{
Q_OBJECT
Q_PROPERTY(QmlListProperty<QWidget> children READ children)
Q_PROPERTY(QDeclarativeListProperty<QWidget> children READ children)
Q_PROPERTY(int topMargin READ topMargin WRITE setTopMargin)
Q_PROPERTY(int bottomMargin READ bottomMargin WRITE setBottomMargin)
......@@ -57,8 +57,8 @@ public:
explicit QBoxLayoutObject(QBoxLayout *, QObject *parent=0);
virtual QLayout *layout() const;
QmlListProperty<QWidget> children() {
return QmlListProperty<QWidget>(this, 0, children_append, 0, 0, children_clear);
QDeclarativeListProperty<QWidget> children() {
return QDeclarativeListProperty<QWidget>(this, 0, children_append, 0, 0, children_clear);
}
private:
......@@ -66,11 +66,11 @@ private:
void addWidget(QWidget *);
void clearWidget();
static void children_append(QmlListProperty<QWidget> *property, QWidget *widget) {
static void children_append(QDeclarativeListProperty<QWidget> *property, QWidget *widget) {
static_cast<QBoxLayoutObject*>(property->object)->addWidget(widget);
}
static void children_clear(QmlListProperty<QWidget> *property) {
static void children_clear(QDeclarativeListProperty<QWidget> *property) {
static_cast<QBoxLayoutObject*>(property->object)->clearWidget();
}
......@@ -172,6 +172,12 @@ QML_DECLARE_TYPE(QBoxLayoutObject);
QML_DECLARE_TYPE(QHBoxLayoutObject);
QML_DECLARE_TYPE(QVBoxLayoutObject);
class BasicLayouts {
public:
static void registerDeclarativeTypes();
};
QT_END_HEADER
#endif // BASICLAYOUTS_H
......@@ -29,10 +29,10 @@
#include "basicwidgets.h"
#include <qlayoutobject.h>
#include <private/graphicswidgets_p.h>
#include <qmlcontext.h>
#include <qmlengine.h>
#include <qmlcomponent.h>
//#include <private/graphicswidgets_p.h>
#include <QDeclarativeContext>
#include <QDeclarativeEngine>
#include <QDeclarativeComponent>
#include <QtCore/QDebug>
#include <QFile>
#include <QPixmap>
......@@ -104,9 +104,9 @@ class QWidgetDeclarativeUI : public QObject
{
Q_OBJECT
Q_PROPERTY(QmlListProperty<QObject> children READ children)
Q_PROPERTY(QDeclarativeListProperty<QObject> children READ children)
Q_PROPERTY(QLayoutObject *layout READ layout WRITE setLayout)
Q_PROPERTY(QmlListProperty<Action> actions READ actions)
Q_PROPERTY(QDeclarativeListProperty<Action> actions READ actions)
Q_PROPERTY(QFont font READ font CONSTANT)
Q_PROPERTY(QPoint pos READ pos)
......@@ -195,13 +195,14 @@ public:
emit mouseOverChanged();
}
void emitVisibleChanged()
{
emit visibleChanged();
}
QmlListProperty<QObject> children() {
return QmlListProperty<QObject>(this, 0, children_append, children_count, children_at, children_clear);
QDeclarativeListProperty<QObject> children() {
return QDeclarativeListProperty<QObject>(this, 0, children_append, children_count, children_at, children_clear);
}
QLayoutObject *layout() const { return _layout; }
......@@ -427,8 +428,8 @@ public:
}
QmlListProperty<Action> actions() {
return QmlListProperty<Action>(this, 0, actions_append, actions_count, actions_at, actions_clear);
QDeclarativeListProperty<Action> actions() {
return QDeclarativeListProperty<Action>(this, 0, actions_append, actions_count, actions_at, actions_clear);
}
private:
......@@ -439,7 +440,7 @@ private:
QGraphicsOpacityEffect *_graphicsOpacityEffect;
bool m_mouseOver;
static void children_append(QmlListProperty<QObject> *property, QObject *o) {
static void children_append(QDeclarativeListProperty<QObject> *property, QObject *o) {
QWidgetDeclarativeUI *p = static_cast<QWidgetDeclarativeUI *>(property->object);
QWidget *q = p->q;
if (QWidget *w = qobject_cast<QWidget *>(o))
......@@ -448,19 +449,19 @@ private:
o->setParent(q);
}
static int children_count(QmlListProperty<QObject> *property) {
static int children_count(QDeclarativeListProperty<QObject> *property) {
QWidgetDeclarativeUI *p = static_cast<QWidgetDeclarativeUI *>(property->object);
QWidget *q = p->q;
return q->children().count();
}
static QObject * children_at(QmlListProperty<QObject> *property, int index) {
static QObject * children_at(QDeclarativeListProperty<QObject> *property, int index) {
QWidgetDeclarativeUI *p = static_cast<QWidgetDeclarativeUI *>(property->object);
QWidget *q = p->q;
return q->children().at(index);
}
static void children_clear(QmlListProperty<QObject> *property) {
static void children_clear(QDeclarativeListProperty<QObject> *property) {
QWidgetDeclarativeUI *p = static_cast<QWidgetDeclarativeUI *>(property->object);
QWidget *q = p->q;
QObjectList c = q->children();
......@@ -469,25 +470,25 @@ private:
}
// ### Original had an insert, and removeAt
static void actions_append(QmlListProperty<Action> *property, Action *o) {
static void actions_append(QDeclarativeListProperty<Action> *property, Action *o) {
QWidgetDeclarativeUI *p = static_cast<QWidgetDeclarativeUI *>(property->object);
QWidget *w = p->q;
o->setParent(w);
w->addAction(o);
}
static int actions_count(QmlListProperty<Action> *property) {
static int actions_count(QDeclarativeListProperty<Action> *property) {
QWidgetDeclarativeUI *p = static_cast<QWidgetDeclarativeUI *>(property->object);
QWidget *w = p->q;
return w->actions().count();
}
static Action *actions_at(QmlListProperty<Action> *property, int index) {
static Action *actions_at(QDeclarativeListProperty<Action> *property, int index) {
QWidgetDeclarativeUI *p = static_cast<QWidgetDeclarativeUI *>(property->object);
QWidget *w = p->q;
return qobject_cast<Action *>(w->actions().at(index));
}
static void actions_clear(QmlListProperty<Action> *property) {
static void actions_clear(QDeclarativeListProperty<Action> *property) {
QWidgetDeclarativeUI *p = static_cast<QWidgetDeclarativeUI *>(property->object);
QWidget *w = p->q;
......@@ -674,7 +675,7 @@ public:
}
private:
//if not for the at() function, we could use QmlList instead
//if not for the at() function, we could use QDeclarativeList instead
QMenu *menu;
......@@ -865,7 +866,7 @@ class WidgetLoader : public QWidget
Q_PROPERTY(QString sourceString READ sourceString WRITE setSourceString NOTIFY sourceChanged)
Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
Q_PROPERTY(QWidget *widget READ widget NOTIFY widgetChanged)
Q_PROPERTY(QmlComponent *component READ component NOTIFY sourceChanged)
Q_PROPERTY(QDeclarativeComponent *component READ component NOTIFY sourceChanged)
public:
WidgetLoader(QWidget * parent = 0) : QWidget(parent), m_source(QUrl()), m_widget(0),
......@@ -884,7 +885,7 @@ public:
{ setSource(QUrl(url)); }
QWidget *widget() const;
QmlComponent *component() const
QDeclarativeComponent *component() const
{ return m_component; }
signals:
......@@ -894,7 +895,7 @@ signals:
private:
QUrl m_source;
QWidget *m_widget;
QmlComponent *m_component;
QDeclarativeComponent *m_component;
QVBoxLayout *m_layout;
QHash<QString, QWidget*> m_cachedWidgets;
};
......@@ -936,7 +937,7 @@ void WidgetLoader::setSource(const QUrl &source)
m_widget = m_cachedWidgets.value(source.toString());
m_widget->show();
} else {
m_component = new QmlComponent(qmlEngine(this), m_source, this);
m_component = new QDeclarativeComponent(qmlEngine(this), m_source, this);
if (m_component) {
emit sourceChanged();
......@@ -952,7 +953,7 @@ void WidgetLoader::setSource(const QUrl &source)
return;
}
QmlContext *ctxt = new QmlContext(qmlContext(this));
QDeclarativeContext *ctxt = new QDeclarativeContext(qmlContext(this));
ctxt->addDefaultObject(this);
QObject *obj = m_component->create(ctxt);
......@@ -1170,17 +1171,17 @@ class QTabWidgetDeclarativeUI : public QObject
{
Q_OBJECT
Q_PROPERTY(QmlListProperty<QTabObject> tabs READ tabs)
Q_PROPERTY(QDeclarativeListProperty<QTabObject> tabs READ tabs)
Q_CLASSINFO("DefaultProperty", "tabs")
public:
QTabWidgetDeclarativeUI(QObject *other) : QObject(other) {}
QmlListProperty<QTabObject> tabs() {
return QmlListProperty<QTabObject>(this, 0, tabs_append, 0, 0, tabs_clear);
QDeclarativeListProperty<QTabObject> tabs() {
return QDeclarativeListProperty<QTabObject>(this, 0, tabs_append, 0, 0, tabs_clear);
}
private:
static void tabs_append(QmlListProperty<QTabObject> *property, QTabObject *o) {
static void tabs_append(QDeclarativeListProperty<QTabObject> *property, QTabObject *o) {
QTabWidget *tw = static_cast<QTabWidget*>(property->object->parent());
if (!o->icon().isNull())
tw->addTab(o->content(), o->icon(), o->label());
......@@ -1188,7 +1189,7 @@ private:
tw->addTab(o->content(), o->label());
}
static void tabs_clear(QmlListProperty<QTabObject> *property) {
static void tabs_clear(QDeclarativeListProperty<QTabObject> *property) {
QTabWidget *tw = static_cast<QTabWidget*>(property->object->parent());
tw->clear();
}
......@@ -1203,68 +1204,71 @@ public:
{}
};
QT_END_NAMESPACE
QML_DEFINE_EXTENDED_TYPE(Bauhaus,1,0,QWidget,QWidget,QWidgetDeclarativeUI);
//display
QML_DEFINE_TYPE(Bauhaus,1,0,QProgressBar,QProgressBar)
QML_DEFINE_TYPE(Bauhaus,1,0,QLCDNumber,QLCDNumber)
//input
QML_DEFINE_TYPE(Bauhaus,1,0,QLineEdit,QLineEdit)
QML_DEFINE_TYPE(Bauhaus,1,0,QTextEdit,QTextEdit)
QML_DEFINE_TYPE(Bauhaus,1,0,QPlainTextEdit,QPlainTextEdit)
QML_DEFINE_TYPE(Bauhaus,1,0,QSpinBox,QSpinBox)
QML_DEFINE_TYPE(Bauhaus,1,0,QDoubleSpinBox,QDoubleSpinBox)
QML_DEFINE_TYPE(Bauhaus,1,0,QSlider,QSlider)
QML_DEFINE_TYPE(Bauhaus,1,0,QDateTimeEdit,QDateTimeEdit)
QML_DEFINE_TYPE(Bauhaus,1,0,QDateEdit,QDateEdit)
QML_DEFINE_TYPE(Bauhaus,1,0,QTimeEdit,QTimeEdit)
QML_DEFINE_TYPE(Bauhaus,1,0,QFontComboBox,QFontComboBox)
QML_DEFINE_TYPE(Bauhaus,1,0,QDial,QDial)
QML_DEFINE_TYPE(Bauhaus,1,0,QScrollBar,QScrollBar)
QML_DEFINE_TYPE(Bauhaus,1,0,QCalendarWidget, QCalendarWidget)
QML_DECLARE_TYPE(MyGroupBox)
QML_DECLARE_TYPE(WidgetLoader)
QML_DECLARE_TYPE(WidgetFrame)
//QML_DEFINE_TYPE(Bauhaus,1,0,QComboBox,QComboBox); //need a way to populate
//QML_DEFINE_EXTENDED_TYPE(QComboBox,QComboBox, QComboBox); //need a way to populate
//buttons
//QML_DEFINE_TYPE(Bauhaus,1,0,QPushButton,QPushButton);
QML_DEFINE_TYPE(Bauhaus,1,0,QCheckBox,QCheckBox)
QML_DEFINE_TYPE(Bauhaus,1,0,QGroupBox,QGroupBox)
QML_DEFINE_TYPE(Bauhaus,1,0,QAction,Action)
QML_DEFINE_TYPE(Bauhaus,1,0,QRadioButton,QRadioButton)