QGraphicsItem: remove QtDeclarative 1 vestiges
This code is completely unused at this point. Change-Id: Id0ecd0125e59b08904ae722ad4319c5ff15620a6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
parent
ba3db0cacd
commit
7981501298
@ -7650,66 +7650,6 @@ void QGraphicsObject::updateMicroFocus()
|
|||||||
QGraphicsItem::updateMicroFocus();
|
QGraphicsItem::updateMicroFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGraphicsItemPrivate::children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item)
|
|
||||||
{
|
|
||||||
if (item) {
|
|
||||||
QGraphicsObject *graphicsObject = static_cast<QGraphicsObject *>(list->object);
|
|
||||||
if (QGraphicsItemPrivate::get(graphicsObject)->sendParentChangeNotification) {
|
|
||||||
item->setParentItem(graphicsObject);
|
|
||||||
} else {
|
|
||||||
QGraphicsItemPrivate::get(item)->setParentItemHelper(graphicsObject, nullptr, nullptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int QGraphicsItemPrivate::children_count(QDeclarativeListProperty<QGraphicsObject> *list)
|
|
||||||
{
|
|
||||||
QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));
|
|
||||||
return d->children.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
QGraphicsObject *QGraphicsItemPrivate::children_at(QDeclarativeListProperty<QGraphicsObject> *list, int index)
|
|
||||||
{
|
|
||||||
QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));
|
|
||||||
if (index >= 0 && index < d->children.size())
|
|
||||||
return d->children.at(index)->toGraphicsObject();
|
|
||||||
else
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QGraphicsItemPrivate::children_clear(QDeclarativeListProperty<QGraphicsObject> *list)
|
|
||||||
{
|
|
||||||
QGraphicsItemPrivate *d = QGraphicsItemPrivate::get(static_cast<QGraphicsObject *>(list->object));
|
|
||||||
int childCount = d->children.size();
|
|
||||||
if (d->sendParentChangeNotification) {
|
|
||||||
for (int index = 0; index < childCount; index++)
|
|
||||||
d->children.at(0)->setParentItem(nullptr);
|
|
||||||
} else {
|
|
||||||
for (int index = 0; index < childCount; index++)
|
|
||||||
QGraphicsItemPrivate::get(d->children.at(0))->setParentItemHelper(nullptr, nullptr, nullptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
|
||||||
Returns a list of this item's children.
|
|
||||||
|
|
||||||
The items are sorted by stacking order. This takes into account both the
|
|
||||||
items' insertion order and their Z-values.
|
|
||||||
|
|
||||||
*/
|
|
||||||
QDeclarativeListProperty<QGraphicsObject> QGraphicsItemPrivate::childrenList()
|
|
||||||
{
|
|
||||||
Q_Q(QGraphicsItem);
|
|
||||||
if (isObject) {
|
|
||||||
QGraphicsObject *that = static_cast<QGraphicsObject *>(q);
|
|
||||||
return QDeclarativeListProperty<QGraphicsObject>(that, &children, children_append,
|
|
||||||
children_count, children_at, children_clear);
|
|
||||||
} else {
|
|
||||||
//QGraphicsItem is not supported for this property
|
|
||||||
return QDeclarativeListProperty<QGraphicsObject>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
Returns the width of the item
|
Returns the width of the item
|
||||||
|
@ -500,13 +500,10 @@ class Q_WIDGETS_EXPORT QGraphicsObject : public QObject, public QGraphicsItem
|
|||||||
#if QT_CONFIG(graphicseffect)
|
#if QT_CONFIG(graphicseffect)
|
||||||
Q_PROPERTY(QGraphicsEffect *effect READ graphicsEffect WRITE setGraphicsEffect)
|
Q_PROPERTY(QGraphicsEffect *effect READ graphicsEffect WRITE setGraphicsEffect)
|
||||||
#endif
|
#endif
|
||||||
Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), QDeclarativeListProperty<QGraphicsObject> children
|
|
||||||
READ childrenList DESIGNABLE false NOTIFY childrenChanged)
|
|
||||||
Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal width READ width WRITE setWidth
|
Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal width READ width WRITE setWidth
|
||||||
NOTIFY widthChanged RESET resetWidth FINAL)
|
NOTIFY widthChanged RESET resetWidth FINAL)
|
||||||
Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal height READ height WRITE setHeight
|
Q_PRIVATE_PROPERTY(QGraphicsItem::d_func(), qreal height READ height WRITE setHeight
|
||||||
NOTIFY heightChanged RESET resetHeight FINAL)
|
NOTIFY heightChanged RESET resetHeight FINAL)
|
||||||
Q_CLASSINFO("DefaultProperty", "children")
|
|
||||||
Q_INTERFACES(QGraphicsItem)
|
Q_INTERFACES(QGraphicsItem)
|
||||||
public:
|
public:
|
||||||
explicit QGraphicsObject(QGraphicsItem *parent = nullptr);
|
explicit QGraphicsObject(QGraphicsItem *parent = nullptr);
|
||||||
|
@ -31,63 +31,6 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class QGraphicsItemPrivate;
|
class QGraphicsItemPrivate;
|
||||||
|
|
||||||
#ifndef QDECLARATIVELISTPROPERTY
|
|
||||||
#define QDECLARATIVELISTPROPERTY
|
|
||||||
template<typename T>
|
|
||||||
class QDeclarativeListProperty {
|
|
||||||
public:
|
|
||||||
typedef void (*AppendFunction)(QDeclarativeListProperty<T> *, T*);
|
|
||||||
typedef int (*CountFunction)(QDeclarativeListProperty<T> *);
|
|
||||||
typedef T *(*AtFunction)(QDeclarativeListProperty<T> *, int);
|
|
||||||
typedef void (*ClearFunction)(QDeclarativeListProperty<T> *);
|
|
||||||
|
|
||||||
QDeclarativeListProperty()
|
|
||||||
: object(nullptr), data(nullptr), append(nullptr), count(nullptr), at(nullptr), clear(nullptr), dummy1(nullptr), dummy2(nullptr) {}
|
|
||||||
QDeclarativeListProperty(QObject *o, QList<T *> &list)
|
|
||||||
: object(o), data(&list), append(qlist_append), count(qlist_count), at(qlist_at),
|
|
||||||
clear(qlist_clear), dummy1(nullptr), dummy2(nullptr) {}
|
|
||||||
QDeclarativeListProperty(QObject *o, void *d, AppendFunction a, CountFunction c = nullptr, AtFunction t = nullptr,
|
|
||||||
ClearFunction r = nullptr)
|
|
||||||
: object(o), data(d), append(a), count(c), at(t), clear(r), dummy1(nullptr), dummy2(nullptr) {}
|
|
||||||
|
|
||||||
bool operator==(const QDeclarativeListProperty &o) const {
|
|
||||||
return object == o.object &&
|
|
||||||
data == o.data &&
|
|
||||||
append == o.append &&
|
|
||||||
count == o.count &&
|
|
||||||
at == o.at &&
|
|
||||||
clear == o.clear;
|
|
||||||
}
|
|
||||||
|
|
||||||
QObject *object;
|
|
||||||
void *data;
|
|
||||||
|
|
||||||
AppendFunction append;
|
|
||||||
|
|
||||||
CountFunction count;
|
|
||||||
AtFunction at;
|
|
||||||
|
|
||||||
ClearFunction clear;
|
|
||||||
|
|
||||||
void *dummy1;
|
|
||||||
void *dummy2;
|
|
||||||
|
|
||||||
private:
|
|
||||||
static void qlist_append(QDeclarativeListProperty *p, T *v) {
|
|
||||||
((QList<T *> *)p->data)->append(v);
|
|
||||||
}
|
|
||||||
static int qlist_count(QDeclarativeListProperty *p) {
|
|
||||||
return ((QList<T *> *)p->data)->count();
|
|
||||||
}
|
|
||||||
static T *qlist_at(QDeclarativeListProperty *p, int idx) {
|
|
||||||
return ((QList<T *> *)p->data)->at(idx);
|
|
||||||
}
|
|
||||||
static void qlist_clear(QDeclarativeListProperty *p) {
|
|
||||||
return ((QList<T *> *)p->data)->clear();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class QGraphicsItemCache
|
class QGraphicsItemCache
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -190,7 +133,6 @@ public:
|
|||||||
void resolveDepth();
|
void resolveDepth();
|
||||||
void addChild(QGraphicsItem *child);
|
void addChild(QGraphicsItem *child);
|
||||||
void removeChild(QGraphicsItem *child);
|
void removeChild(QGraphicsItem *child);
|
||||||
QDeclarativeListProperty<QGraphicsObject> childrenList();
|
|
||||||
void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant,
|
void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant,
|
||||||
const QVariant *thisPointerVariant);
|
const QVariant *thisPointerVariant);
|
||||||
void childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem);
|
void childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem);
|
||||||
@ -378,11 +320,6 @@ public:
|
|||||||
virtual void subFocusItemChange();
|
virtual void subFocusItemChange();
|
||||||
virtual void focusScopeItemChange(bool isSubFocusItem);
|
virtual void focusScopeItemChange(bool isSubFocusItem);
|
||||||
|
|
||||||
static void children_append(QDeclarativeListProperty<QGraphicsObject> *list, QGraphicsObject *item);
|
|
||||||
static int children_count(QDeclarativeListProperty<QGraphicsObject> *list);
|
|
||||||
static QGraphicsObject *children_at(QDeclarativeListProperty<QGraphicsObject> *list, int);
|
|
||||||
static void children_clear(QDeclarativeListProperty<QGraphicsObject> *list);
|
|
||||||
|
|
||||||
inline QTransform transformToParent() const;
|
inline QTransform transformToParent() const;
|
||||||
inline void ensureSortedChildren();
|
inline void ensureSortedChildren();
|
||||||
static inline bool insertionOrder(QGraphicsItem *a, QGraphicsItem *b);
|
static inline bool insertionOrder(QGraphicsItem *a, QGraphicsItem *b);
|
||||||
@ -588,7 +525,6 @@ public:
|
|||||||
return item->type() == QGraphicsPixmapItem::Type
|
return item->type() == QGraphicsPixmapItem::Type
|
||||||
&& !(item->flags() & QGraphicsItem::ItemIsSelectable)
|
&& !(item->flags() & QGraphicsItem::ItemIsSelectable)
|
||||||
&& item->d_ptr->children.size() == 0;
|
&& item->d_ptr->children.size() == 0;
|
||||||
//|| (item->d_ptr->isObject && qobject_cast<QDeclarativeImage *>(q_func()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const QStyleOption *styleOption() const override
|
const QStyleOption *styleOption() const override
|
||||||
|
Loading…
Reference in New Issue
Block a user