summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp97
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.h13
-rw-r--r--src/widgets/graphicsview/qgraphicsitemanimation.cpp17
-rw-r--r--src/widgets/graphicsview/qgraphicsitemanimation.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp90
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.h34
-rw-r--r--src/widgets/graphicsview/qgraphicssceneevent.h3
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsview.h9
-rw-r--r--tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp1
-rw-r--r--tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp15
11 files changed, 12 insertions, 273 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp
index ddb4e06fe2..12ee1713a9 100644
--- a/src/widgets/graphicsview/qgraphicsitem.cpp
+++ b/src/widgets/graphicsview/qgraphicsitem.cpp
@@ -1850,15 +1850,6 @@ void QGraphicsItem::setParentItem(QGraphicsItem *newParent)
}
/*!
- \fn QList<QGraphicsItem *> QGraphicsItem::children() const
- \obsolete
-
- Use childItems() instead.
-
- \sa setParentItem()
-*/
-
-/*!
\since 4.4
Returns a list of this item's children.
@@ -3170,12 +3161,6 @@ bool QGraphicsItem::acceptHoverEvents() const
return d_ptr->acceptsHover;
}
-/*!
- \fn bool QGraphicsItem::acceptsHoverEvents() const
- \obsolete
-
- Call acceptHoverEvents() instead.
-*/
/*!
\since 4.4
@@ -3219,13 +3204,6 @@ void QGraphicsItem::setAcceptHoverEvents(bool enabled)
}
}
-/*!
- \fn void QGraphicsItem::setAcceptsHoverEvents(bool enabled)
- \obsolete
-
- Use setAcceptHoverEvents(\a enabled) instead.
-*/
-
/*! \since 4.6
Returns \c true if an item accepts \l{QTouchEvent}{touch events};
@@ -4579,81 +4557,6 @@ void QGraphicsItem::resetTransform()
}
/*!
- \fn void QGraphicsItem::rotate(qreal angle)
- \obsolete
-
- Use
-
- \snippet code/src_gui_graphicsview_qgraphicsitem.cpp 20
-
- instead.
-
- Rotates the current item transformation \a angle degrees clockwise around
- its origin. To translate around an arbitrary point (x, y), you need to
- combine translation and rotation with setTransform().
-
- Example:
-
- \snippet code/src_gui_graphicsview_qgraphicsitem.cpp 6
-
- \sa setTransform(), transform(), scale(), shear(), translate()
-*/
-
-/*!
- \fn void QGraphicsItem::scale(qreal sx, qreal sy)
- \obsolete
-
- Use
-
- \snippet code/src_gui_graphicsview_qgraphicsitem.cpp 21
-
- instead.
-
- Scales the current item transformation by (\a sx, \a sy) around its
- origin. To scale from an arbitrary point (x, y), you need to combine
- translation and scaling with setTransform().
-
- Example:
-
- \snippet code/src_gui_graphicsview_qgraphicsitem.cpp 7
-
- \sa setTransform(), transform()
-*/
-
-/*!
- \fn void QGraphicsItem::shear(qreal sh, qreal sv)
- \obsolete
-
- Use
-
- \snippet code/src_gui_graphicsview_qgraphicsitem.cpp 22
-
- instead.
-
- Shears the current item transformation by (\a sh, \a sv).
-
- \sa setTransform(), transform()
-*/
-
-/*!
- \fn void QGraphicsItem::translate(qreal dx, qreal dy)
- \obsolete
-
- Use setPos() or setTransformOriginPoint() instead. For identical
- behavior, use
-
- \snippet code/src_gui_graphicsview_qgraphicsitem.cpp 23
-
- Translates the current item transformation by (\a dx, \a dy).
-
- If all you want is to move an item, you should call moveBy() or
- setPos() instead; this function changes the item's translation,
- which is conceptually separate from its position.
-
- \sa setTransform(), transform()
-*/
-
-/*!
This virtual function is called twice for all items by the
QGraphicsScene::advance() slot. In the first phase, all items are called
with \a phase == 0, indicating that items on the scene are about to
diff --git a/src/widgets/graphicsview/qgraphicsitem.h b/src/widgets/graphicsview/qgraphicsitem.h
index 0fb46fc9a8..5989c428f1 100644
--- a/src/widgets/graphicsview/qgraphicsitem.h
+++ b/src/widgets/graphicsview/qgraphicsitem.h
@@ -169,9 +169,6 @@ public:
QGraphicsWidget *window() const;
QGraphicsItem *panel() const;
void setParentItem(QGraphicsItem *parent);
-#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED inline QList<QGraphicsItem *> children() const { return childItems(); }
-#endif
QList<QGraphicsItem *> childItems() const;
bool isWidget() const;
bool isWindow() const;
@@ -233,10 +230,6 @@ public:
Qt::MouseButtons acceptedMouseButtons() const;
void setAcceptedMouseButtons(Qt::MouseButtons buttons);
-#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED inline bool acceptsHoverEvents() const { return acceptHoverEvents(); }
- QT_DEPRECATED inline void setAcceptsHoverEvents(bool enabled) { setAcceptHoverEvents(enabled); }
-#endif
bool acceptHoverEvents() const;
void setAcceptHoverEvents(bool enabled);
bool acceptTouchEvents() const;
@@ -287,12 +280,6 @@ public:
QTransform itemTransform(const QGraphicsItem *other, bool *ok = nullptr) const;
void setTransform(const QTransform &matrix, bool combine = false);
void resetTransform();
-#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED inline void rotate(qreal angle) { setTransform(QTransform().rotate(angle), true); }
- QT_DEPRECATED inline void scale(qreal sx, qreal sy) { setTransform(QTransform::fromScale(sx, sy), true); }
- QT_DEPRECATED inline void shear(qreal sh, qreal sv) { setTransform(QTransform().shear(sh, sv), true); }
- QT_DEPRECATED inline void translate(qreal dx, qreal dy) { setTransform(QTransform::fromTranslate(dx, dy), true); }
-#endif
void setRotation(qreal angle);
qreal rotation() const;
diff --git a/src/widgets/graphicsview/qgraphicsitemanimation.cpp b/src/widgets/graphicsview/qgraphicsitemanimation.cpp
index 45b4871e24..981a4634bb 100644
--- a/src/widgets/graphicsview/qgraphicsitemanimation.cpp
+++ b/src/widgets/graphicsview/qgraphicsitemanimation.cpp
@@ -550,23 +550,6 @@ void QGraphicsItemAnimation::setStep(qreal step)
afterAnimationStep(step);
}
-#if QT_DEPRECATED_SINCE(5, 13)
-/*!
- Resets the item to its starting position and transformation.
-
- \obsolete
-
- You can call setStep(0) instead.
-*/
-void QGraphicsItemAnimation::reset()
-{
- if (!d->item)
- return;
- d->startPos = d->item->pos();
- d->startTransform = d->item->transform();
-}
-#endif
-
/*!
\fn void QGraphicsItemAnimation::beforeAnimationStep(qreal step)
diff --git a/src/widgets/graphicsview/qgraphicsitemanimation.h b/src/widgets/graphicsview/qgraphicsitemanimation.h
index af54dfff93..2bd9206574 100644
--- a/src/widgets/graphicsview/qgraphicsitemanimation.h
+++ b/src/widgets/graphicsview/qgraphicsitemanimation.h
@@ -96,10 +96,6 @@ public:
public Q_SLOTS:
void setStep(qreal x);
-#if QT_DEPRECATED_SINCE(5, 13)
- QT_DEPRECATED_X("Use setStep(0) instead")
- void reset();
-#endif
protected:
virtual void beforeAnimationStep(qreal step);
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index 3a40452442..7c677f7d9c 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -1938,29 +1938,6 @@ void QGraphicsScene::setBspTreeDepth(int depth)
bspTree->setBspTreeDepth(depth);
}
-#if QT_DEPRECATED_SINCE(5, 13)
-/*!
- \property QGraphicsScene::sortCacheEnabled
- \brief whether sort caching is enabled
- \since 4.5
- \obsolete
-
- Since Qt 4.6, this property has no effect.
-*/
-bool QGraphicsScene::isSortCacheEnabled() const
-{
- Q_D(const QGraphicsScene);
- return d->sortCacheEnabled;
-}
-void QGraphicsScene::setSortCacheEnabled(bool enabled)
-{
- Q_D(QGraphicsScene);
- if (d->sortCacheEnabled == enabled)
- return;
- d->sortCacheEnabled = enabled;
-}
-#endif
-
/*!
Calculates and returns the bounding rect of all items on the scene. This
function works by iterating over all items, and because of this, it can
@@ -1991,18 +1968,6 @@ QList<QGraphicsItem *> QGraphicsScene::items(Qt::SortOrder order) const
}
/*!
- \fn QList<QGraphicsItem *> QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode) const
- \obsolete
- \since 4.3
-
- This convenience function is equivalent to calling items(QRectF(\a x, \a y, \a w, \a h), \a mode).
-
- This function is deprecated and returns incorrect results if the scene
- contains items that ignore transformations. Use the overload that takes
- a QTransform instead.
-*/
-
-/*!
\fn QList<QGraphicsItem *> QGraphicsScene::items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const
\overload
\since 4.6
@@ -2151,23 +2116,6 @@ QList<QGraphicsItem *> QGraphicsScene::collidingItems(const QGraphicsItem *item,
}
/*!
- \fn QGraphicsItem *QGraphicsScene::itemAt(const QPointF &position) const
- \overload
- \obsolete
-
- Returns the topmost visible item at the specified \a position, or
- \nullptr if there are no items at this position.
-
- This function is deprecated and returns incorrect results if the scene
- contains items that ignore transformations. Use the overload that takes
- a QTransform instead.
-
- Note: See items() for a definition of which items are considered visible by this function.
-
- \sa items(), collidingItems(), {QGraphicsItem#Sorting}{Sorting}
-*/
-
-/*!
\since 4.6
Returns the topmost visible item at the specified \a position, or \nullptr
@@ -2205,24 +2153,6 @@ QGraphicsItem *QGraphicsScene::itemAt(const QPointF &position, const QTransform
*/
/*!
- \fn QGraphicsScene::itemAt(qreal x, qreal y) const
- \overload
- \obsolete
-
- Returns the topmost visible item at the position specified by (\a x, \a
- y), or \nullptr if there are no items at this position.
-
- This convenience function is equivalent to calling \c
- {itemAt(QPointF(x, y))}.
-
- This function is deprecated and returns incorrect results if the scene
- contains items that ignore transformations. Use the overload that takes
- a QTransform instead.
-
- Note: See items() for a definition of which items are considered visible by this function.
-*/
-
-/*!
Returns a list of all currently selected items. The items are
returned in no particular order.
@@ -2275,25 +2205,7 @@ QPainterPath QGraphicsScene::selectionArea() const
*/
void QGraphicsScene::setSelectionArea(const QPainterPath &path, const QTransform &deviceTransform)
{
- setSelectionArea(path, Qt::IntersectsItemShape, deviceTransform);
-}
-
-/*!
- \overload
- \since 4.6
-
- Sets the selection area to \a path using \a mode to determine if items are
- included in the selection area.
-
- \a deviceTransform is the transformation that applies to the view, and needs to
- be provided if the scene contains items that ignore transformations.
-
- \sa clearSelection(), selectionArea()
-*/
-void QGraphicsScene::setSelectionArea(const QPainterPath &path, Qt::ItemSelectionMode mode,
- const QTransform &deviceTransform)
-{
- setSelectionArea(path, Qt::ReplaceSelection, mode, deviceTransform);
+ setSelectionArea(path, Qt::ReplaceSelection, Qt::IntersectsItemShape, deviceTransform);
}
/*!
diff --git a/src/widgets/graphicsview/qgraphicsscene.h b/src/widgets/graphicsview/qgraphicsscene.h
index e459b80970..a4cf5b4063 100644
--- a/src/widgets/graphicsview/qgraphicsscene.h
+++ b/src/widgets/graphicsview/qgraphicsscene.h
@@ -101,9 +101,6 @@ class Q_WIDGETS_EXPORT QGraphicsScene : public QObject
Q_PROPERTY(int bspTreeDepth READ bspTreeDepth WRITE setBspTreeDepth)
Q_PROPERTY(QPalette palette READ palette WRITE setPalette)
Q_PROPERTY(QFont font READ font WRITE setFont)
-#if QT_DEPRECATED_SINCE(5, 13)
- Q_PROPERTY(bool sortCacheEnabled READ isSortCacheEnabled WRITE setSortCacheEnabled)
-#endif
Q_PROPERTY(bool stickyFocus READ stickyFocus WRITE setStickyFocus)
Q_PROPERTY(qreal minimumRenderSize READ minimumRenderSize WRITE setMinimumRenderSize)
Q_PROPERTY(bool focusOnTouch READ focusOnTouch WRITE setFocusOnTouch)
@@ -141,11 +138,6 @@ public:
ItemIndexMethod itemIndexMethod() const;
void setItemIndexMethod(ItemIndexMethod method);
-#if QT_DEPRECATED_SINCE(5, 13)
- QT_DEPRECATED bool isSortCacheEnabled() const;
- QT_DEPRECATED void setSortCacheEnabled(bool enabled);
-#endif
-
int bspTreeDepth() const;
void setBspTreeDepth(int depth);
@@ -157,37 +149,19 @@ public:
QList<QGraphicsItem *> items(const QRectF &rect, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape, Qt::SortOrder order = Qt::DescendingOrder, const QTransform &deviceTransform = QTransform()) const;
QList<QGraphicsItem *> items(const QPolygonF &polygon, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape, Qt::SortOrder order = Qt::DescendingOrder, const QTransform &deviceTransform = QTransform()) const;
QList<QGraphicsItem *> items(const QPainterPath &path, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape, Qt::SortOrder order = Qt::DescendingOrder, const QTransform &deviceTransform = QTransform()) const;
-
- QList<QGraphicsItem *> collidingItems(const QGraphicsItem *item, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
-#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED inline QGraphicsItem *itemAt(const QPointF &position) const {
- QList<QGraphicsItem *> itemsAtPoint = items(position);
- return itemsAtPoint.isEmpty() ? nullptr : itemsAtPoint.first();
- }
-#endif
- QGraphicsItem *itemAt(const QPointF &pos, const QTransform &deviceTransform) const;
-#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED inline QList<QGraphicsItem *> items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const
- { return items(QRectF(x, y, w, h), mode); }
-#endif
inline QList<QGraphicsItem *> items(qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode, Qt::SortOrder order,
const QTransform &deviceTransform = QTransform()) const
{ return items(QRectF(x, y, w, h), mode, order, deviceTransform); }
-#if QT_DEPRECATED_SINCE(5, 0)
- QT_DEPRECATED inline QGraphicsItem *itemAt(qreal x, qreal y) const {
- QList<QGraphicsItem *> itemsAtPoint = items(QPointF(x, y));
- return itemsAtPoint.isEmpty() ? nullptr : itemsAtPoint.first();
- }
-#endif
+
+ QList<QGraphicsItem *> collidingItems(const QGraphicsItem *item, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape) const;
+ QGraphicsItem *itemAt(const QPointF &pos, const QTransform &deviceTransform) const;
inline QGraphicsItem *itemAt(qreal x, qreal y, const QTransform &deviceTransform) const
{ return itemAt(QPointF(x, y), deviceTransform); }
QList<QGraphicsItem *> selectedItems() const;
QPainterPath selectionArea() const;
void setSelectionArea(const QPainterPath &path, const QTransform &deviceTransform);
- void setSelectionArea(const QPainterPath &path, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape, const QTransform &deviceTransform = QTransform());
- void setSelectionArea(const QPainterPath &path, Qt::ItemSelectionOperation selectionOperation, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape, const QTransform &deviceTransform = QTransform());
- // ### Qt6 merge the last 2 functions and add a default: Qt::ItemSelectionOperation selectionOperation = Qt::ReplaceSelection
+ void setSelectionArea(const QPainterPath &path, Qt::ItemSelectionOperation selectionOperation = Qt::ReplaceSelection, Qt::ItemSelectionMode mode = Qt::IntersectsItemShape, const QTransform &deviceTransform = QTransform());
QGraphicsItemGroup *createItemGroup(const QList<QGraphicsItem *> &items);
void destroyItemGroup(QGraphicsItemGroup *group);
diff --git a/src/widgets/graphicsview/qgraphicssceneevent.h b/src/widgets/graphicsview/qgraphicssceneevent.h
index 9d940be2c0..4a47b642fe 100644
--- a/src/widgets/graphicsview/qgraphicssceneevent.h
+++ b/src/widgets/graphicsview/qgraphicssceneevent.h
@@ -47,9 +47,6 @@
#include <QtCore/qrect.h>
#include <QtGui/qpolygon.h>
#include <QtCore/qset.h>
-#if QT_DEPRECATED_SINCE(5, 5)
-#include <QtCore/qhash.h>
-#endif
QT_REQUIRE_CONFIG(graphicsview);
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index f7f33f9304..9c8042ba1a 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -198,8 +198,6 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime <
Note that setting a flag usually imposes a side effect, and this effect
can vary between paint devices and platforms.
- \value DontClipPainter This value is obsolete and has no effect.
-
\value DontSavePainterState When rendering, QGraphicsView protects the
painter state (see QPainter::save()) when rendering the background or
foreground, and when rendering each item. This allows you to leave the
diff --git a/src/widgets/graphicsview/qgraphicsview.h b/src/widgets/graphicsview/qgraphicsview.h
index 4c0b70bdd7..e69a5e7104 100644
--- a/src/widgets/graphicsview/qgraphicsview.h
+++ b/src/widgets/graphicsview/qgraphicsview.h
@@ -107,12 +107,9 @@ public:
Q_ENUM(ViewportUpdateMode)
enum OptimizationFlag {
-#if QT_DEPRECATED_SINCE(5, 14)
- DontClipPainter Q_DECL_ENUMERATOR_DEPRECATED_X("This flag is unused") = 0x1, // obsolete
-#endif
- DontSavePainterState = 0x2,
- DontAdjustForAntialiasing = 0x4,
- IndirectPainting = 0x8
+ DontSavePainterState = 0x1,
+ DontAdjustForAntialiasing = 0x2,
+ IndirectPainting = 0x4
};
Q_DECLARE_FLAGS(OptimizationFlags, OptimizationFlag)
diff --git a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
index f2423cb899..8f5782b0b8 100644
--- a/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
+++ b/tests/benchmarks/widgets/graphicsview/functional/GraphicsViewBenchmark/widgets/mainview.cpp
@@ -252,7 +252,6 @@ void MainView::construct()
#ifndef QT_NO_OPENGL
if (m_enableOpenGL) {
qDebug() << "OpenGL enabled";
- m_scene->setSortCacheEnabled(false);
setViewport(new QOpenGLWidget);
// Qt doc says: This is the preferred update mode for
diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 25fc439883..a9fba18f53 100644
--- a/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/benchmarks/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -423,23 +423,17 @@ static void addChildHelper(QGraphicsItem *parent, int n, bool rotate)
void tst_QGraphicsView::deepNesting_data()
{
QTest::addColumn<bool>("rotate");
- QTest::addColumn<bool>("sortCache");
QTest::addColumn<bool>("bsp");
- QTest::newRow("bsp, no transform") << false << false << true;
- QTest::newRow("bsp, rotation") << true << false << true;
- QTest::newRow("bsp, no transform, sort cache") << false << true << true;
- QTest::newRow("bsp, rotation, sort cache") << true << true << true;
- QTest::newRow("no transform") << false << false << false;
- QTest::newRow("rotation") << true << false << false;
- QTest::newRow("no transform, sort cache") << false << true << false;
- QTest::newRow("rotation, sort cache") << true << true << false;
+ QTest::newRow("bsp, no transform") << false << true;
+ QTest::newRow("bsp, rotation") << true << true;
+ QTest::newRow("no transform") << false << false;
+ QTest::newRow("rotation") << true << false;
}
void tst_QGraphicsView::deepNesting()
{
QFETCH(bool, rotate);
- QFETCH(bool, sortCache);
QFETCH(bool, bsp);
QGraphicsScene scene;
@@ -453,7 +447,6 @@ void tst_QGraphicsView::deepNesting()
}
}
scene.setItemIndexMethod(bsp ? QGraphicsScene::BspTreeIndex : QGraphicsScene::NoIndex);
- scene.setSortCacheEnabled(sortCache);
scene.setSceneRect(scene.sceneRect());
mView.setRenderHint(QPainter::Antialiasing);