misc cleanups

some upstream changes were not applied on purpose

upstream commits:
d76de69b4b

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2016-01-13 20:32:04 +02:00
parent 1e1b02ad5b
commit 97bc06753e
6 changed files with 6 additions and 80 deletions

View file

@ -1708,18 +1708,6 @@ void QGraphicsItem::setParentItem(QGraphicsItem *newParent)
d_ptr->setParentItemHelper(newParent, &newParentVariant, &thisPointerVariant);
}
/*!
\obsolete
Use childItems() instead.
\sa setParentItem()
*/
QList<QGraphicsItem *> QGraphicsItem::children() const
{
return childItems();
}
/*!
\since 4.4
@ -1797,24 +1785,6 @@ void QGraphicsItem::setFlag(GraphicsItemFlag flag, bool enabled)
setFlags(GraphicsItemFlags(d_ptr->flags) & ~flag);
}
/*!
\internal
Sets the flag \a flag on \a item and all its children, to \a enabled.
*/
static void _q_qgraphicsItemSetFlag(QGraphicsItem *item, QGraphicsItem::GraphicsItemFlag flag,
bool enabled)
{
if (item->flags() & flag) {
// If this item already has the correct flag set, we don't have to
// propagate it.
return;
}
item->setFlag(flag, enabled);
foreach (QGraphicsItem *child, item->children())
_q_qgraphicsItemSetFlag(child, flag, enabled);
}
/*!
Sets the item flags to \a flags. All flags in \a flags are enabled; all
flags not in \a flags are disabled.
@ -2975,16 +2945,6 @@ bool QGraphicsItem::acceptHoverEvents() const
return d_ptr->acceptsHover;
}
/*!
\obsolete
Call acceptHoverEvents() instead.
*/
bool QGraphicsItem::acceptsHoverEvents() const
{
return d_ptr->acceptsHover;
}
/*!
\since 4.4
@ -3027,16 +2987,6 @@ void QGraphicsItem::setAcceptHoverEvents(bool enabled)
}
}
/*!
\obsolete
Use setAcceptHoverEvents(\a enabled) instead.
*/
void QGraphicsItem::setAcceptsHoverEvents(bool enabled)
{
setAcceptHoverEvents(enabled);
}
/*! \since 4.6
Returns true if an item accepts \l{QTouchEvent}{touch events};
@ -5077,21 +5027,6 @@ QList<QGraphicsItem *> QGraphicsItem::collidingItems(Qt::ItemSelectionMode mode)
return QList<QGraphicsItem *>();
}
/*!
Returns true if this item's bounding rect is completely obscured by the
opaque shape of any of colliding items above it (i.e., with a higher Z
value than this item).
Its implementation is based on calling isObscuredBy(), which you can
reimplement to provide a custom obscurity algorithm.
\sa opaqueArea()
*/
bool QGraphicsItem::isObscured() const
{
return isObscured(QRectF());
}
/*!
\internal
@ -5110,15 +5045,11 @@ static bool qt_QGraphicsItem_isObscured(const QGraphicsItem *item,
}
/*!
\overload
\since 4.3
Returns true if \a rect is completely obscured by the opaque shape of any
of colliding items above it (i.e., with a higher Z value than this item).
Unlike the default isObscured() function, this function does not call
isObscuredBy().
\sa opaqueArea()
*/
bool QGraphicsItem::isObscured(const QRectF &rect) const

View file

@ -179,7 +179,6 @@ public:
QGraphicsWidget *window() const;
QGraphicsItem *panel() const;
void setParentItem(QGraphicsItem *parent);
QList<QGraphicsItem *> children() const; // ### obsolete
QList<QGraphicsItem *> childItems() const;
bool isWidget() const;
bool isWindow() const;
@ -242,8 +241,6 @@ public:
Qt::MouseButtons acceptedMouseButtons() const;
void setAcceptedMouseButtons(Qt::MouseButtons buttons);
bool acceptsHoverEvents() const; // ### obsolete
void setAcceptsHoverEvents(bool enabled); // ### obsolete
bool acceptHoverEvents() const;
void setAcceptHoverEvents(bool enabled);
bool acceptTouchEvents() const;
@ -336,8 +333,7 @@ public:
virtual bool collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
virtual bool collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
QList<QGraphicsItem *> collidingItems(Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
bool isObscured() const;
bool isObscured(const QRectF &rect) const; // ### Qt 5: merge with isObscured(), add QRectF arg to isObscuredBy()
bool isObscured(const QRectF &rect = QRectF()) const;
inline bool isObscured(qreal x, qreal y, qreal w, qreal h) const;
virtual bool isObscuredBy(const QGraphicsItem *item) const;
virtual QPainterPath opaqueArea() const;

View file

@ -287,7 +287,7 @@ void QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(QGraphicsSceneMouseEvent
// grabber child widget.
if (embeddedMouseGrabber && type == QEvent::MouseButtonRelease && !event->buttons()) {
Q_Q(QGraphicsProxyWidget);
if (q->rect().contains(event->pos()) && q->acceptsHoverEvents())
if (q->rect().contains(event->pos()) && q->acceptHoverEvents())
lastWidgetUnderMouse = alienWidget ? alienWidget : widget;
else // released on the frame our outside the item, or doesn't accept hover events.
lastWidgetUnderMouse = 0;

View file

@ -2501,7 +2501,7 @@ QGraphicsItemGroup *QGraphicsScene::createItemGroup(const QList<QGraphicsItem *>
*/
void QGraphicsScene::destroyItemGroup(QGraphicsItemGroup *group)
{
foreach (QGraphicsItem *item, group->children())
foreach (QGraphicsItem *item, group->childItems())
group->removeFromGroup(item);
removeItem(group);
delete group;
@ -5710,7 +5710,7 @@ void QGraphicsScene::setActiveWindow(QGraphicsWidget *widget)
QList<QGraphicsItem *> siblingWindows;
QGraphicsItem *parent = panel->parentItem();
// Raise ### inefficient for toplevels
foreach (QGraphicsItem *sibling, parent ? parent->children() : items()) {
foreach (QGraphicsItem *sibling, parent ? parent->childItems() : items()) {
if (sibling != panel && sibling->isWindow())
siblingWindows << sibling;
}

View file

@ -1454,7 +1454,7 @@ bool QGraphicsWidget::event(QEvent *event)
windowFrameEvent(event);
// Filter out hover events if they were sent to us only because of the
// decoration (special case in QGraphicsScenePrivate::dispatchHoverEvent).
if (!acceptsHoverEvents())
if (!acceptHoverEvents())
return true;
}
break;

View file

@ -65,8 +65,7 @@ endif()
katie_generate_misc("${SVG_HEADERS}" QtSvg)
katie_generate_public("${SVG_PUBLIC_HEADERS}" QtSvg)
katie_generate_map(QtSvg Q_SVG_EXPORT)
katie_resources("${SVG_SOURCES}")
katie_resources("${SVG_HEADERS}")
katie_resources(${SVG_SOURCES} ${SVG_HEADERS})
katie_setup_flags()
add_library(KtSvg ${KATIE_TYPE} ${SVG_SOURCES} ${SVG_HEADERS})