From ddf4b378f1e7eac62bd504a1e453cb7b894e21f2 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Sat, 25 Feb 2012 12:40:20 +0100 Subject: Inline and mark as deprecated images's serialNumber() These function are marked as obsolete since Qt 4.3 The motivation here was too fix QPixmap::serialNumber which is marked as QT_DEPRECATED_SINCE but was not inlined. But then I took the oportunity to do the same with all the other functions. Change-Id: Ic50a7857461fc402b2f2b4528c83e53e8e28ea30 Reviewed-by: Lars Knoll --- src/widgets/kernel/qicon.cpp | 8 ++------ src/widgets/kernel/qicon.h | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/kernel/qicon.cpp b/src/widgets/kernel/qicon.cpp index e579fac4f4..c848dd74f4 100644 --- a/src/widgets/kernel/qicon.cpp +++ b/src/widgets/kernel/qicon.cpp @@ -621,7 +621,8 @@ QIcon::operator QVariant() const return QVariant(QVariant::Icon, this); } -/*! \obsolete +/*! \fn int QIcon::serialNumber() const + \obsolete Returns a number that identifies the contents of this QIcon object. Distinct QIcon objects can have @@ -638,11 +639,6 @@ QIcon::operator QVariant() const \sa QPixmap::serialNumber() */ -int QIcon::serialNumber() const -{ - return d ? d->serialNum : 0; -} - /*! Returns a number that identifies the contents of this QIcon object. Distinct QIcon objects can have the same key if diff --git a/src/widgets/kernel/qicon.h b/src/widgets/kernel/qicon.h index 7bef500946..c6e07ba3e2 100644 --- a/src/widgets/kernel/qicon.h +++ b/src/widgets/kernel/qicon.h @@ -94,7 +94,9 @@ public: bool isDetached() const; void detach(); - int serialNumber() const; +#if QT_DEPRECATED_SINCE(5, 0) + QT_DEPRECATED inline int serialNumber() const { return cacheKey() >> 32; } +#endif qint64 cacheKey() const; void addPixmap(const QPixmap &pixmap, Mode mode = Normal, State state = Off); -- cgit v1.2.3 From 1cd4d6b1819f67b70dd359c7fc43ab06182cc34b Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 29 Feb 2012 00:00:27 +0100 Subject: QEvent (and subclasses): make ctors explicit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Do this regardless of whether the event subclass is public API or only used in examples. Examples are examples, used by others as templates or even copied verbatim, so they should also follow sound engineering rules. Anyway, there's only one in examples/... Change-Id: I586ff16407a956c9e89288fdd4377eed73f45c0f Reviewed-by: Samuel Rødal --- src/widgets/graphicsview/qgraphicssceneevent.h | 14 +++++++------- src/widgets/kernel/qgesture.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/graphicsview/qgraphicssceneevent.h b/src/widgets/graphicsview/qgraphicssceneevent.h index be93c47476..95de435846 100644 --- a/src/widgets/graphicsview/qgraphicssceneevent.h +++ b/src/widgets/graphicsview/qgraphicssceneevent.h @@ -66,7 +66,7 @@ class QGraphicsSceneEventPrivate; class Q_WIDGETS_EXPORT QGraphicsSceneEvent : public QEvent { public: - QGraphicsSceneEvent(Type type); + explicit QGraphicsSceneEvent(Type type); ~QGraphicsSceneEvent(); QWidget *widget() const; @@ -84,7 +84,7 @@ class QGraphicsSceneMouseEventPrivate; class Q_WIDGETS_EXPORT QGraphicsSceneMouseEvent : public QGraphicsSceneEvent { public: - QGraphicsSceneMouseEvent(Type type = None); + explicit QGraphicsSceneMouseEvent(Type type = None); ~QGraphicsSceneMouseEvent(); QPointF pos() const; @@ -132,7 +132,7 @@ class QGraphicsSceneWheelEventPrivate; class Q_WIDGETS_EXPORT QGraphicsSceneWheelEvent : public QGraphicsSceneEvent { public: - QGraphicsSceneWheelEvent(Type type = None); + explicit QGraphicsSceneWheelEvent(Type type = None); ~QGraphicsSceneWheelEvent(); QPointF pos() const; @@ -167,7 +167,7 @@ class Q_WIDGETS_EXPORT QGraphicsSceneContextMenuEvent : public QGraphicsSceneEve public: enum Reason { Mouse, Keyboard, Other }; - QGraphicsSceneContextMenuEvent(Type type = None); + explicit QGraphicsSceneContextMenuEvent(Type type = None); ~QGraphicsSceneContextMenuEvent(); QPointF pos() const; @@ -194,7 +194,7 @@ class QGraphicsSceneHoverEventPrivate; class Q_WIDGETS_EXPORT QGraphicsSceneHoverEvent : public QGraphicsSceneEvent { public: - QGraphicsSceneHoverEvent(Type type = None); + explicit QGraphicsSceneHoverEvent(Type type = None); ~QGraphicsSceneHoverEvent(); QPointF pos() const; @@ -227,7 +227,7 @@ class QGraphicsSceneHelpEventPrivate; class Q_WIDGETS_EXPORT QGraphicsSceneHelpEvent : public QGraphicsSceneEvent { public: - QGraphicsSceneHelpEvent(Type type = None); + explicit QGraphicsSceneHelpEvent(Type type = None); ~QGraphicsSceneHelpEvent(); QPointF scenePos() const; @@ -245,7 +245,7 @@ class QGraphicsSceneDragDropEventPrivate; class Q_WIDGETS_EXPORT QGraphicsSceneDragDropEvent : public QGraphicsSceneEvent { public: - QGraphicsSceneDragDropEvent(Type type = None); + explicit QGraphicsSceneDragDropEvent(Type type = None); ~QGraphicsSceneDragDropEvent(); QPointF pos() const; diff --git a/src/widgets/kernel/qgesture.h b/src/widgets/kernel/qgesture.h index 8c412680b8..5e121def41 100644 --- a/src/widgets/kernel/qgesture.h +++ b/src/widgets/kernel/qgesture.h @@ -270,7 +270,7 @@ class QGestureEventPrivate; class Q_WIDGETS_EXPORT QGestureEvent : public QEvent { public: - QGestureEvent(const QList &gestures); + explicit QGestureEvent(const QList &gestures); ~QGestureEvent(); QList gestures() const; -- cgit v1.2.3