summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals.cid@kdab.com>2019-09-27 16:27:58 +0200
committerAlbert Astals Cid <albert.astals.cid@kdab.com>2019-10-03 17:10:43 +0200
commit127ed7e6e0f8939861cce7349e28a1dec9a7d6ed (patch)
tree6678e97bb99675c5c4a099e46070bc1b261e0ed1 /src/widgets/itemviews
parent0392a744530ac4868e33d5345c7197ac14d7320d (diff)
QTableWidget: Fix -Wdeprecated-copy warning
In file included from ../../include/QtCore/qlist.h:1, from ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/kernel/qobject.h:49, from ../../include/QtCore/qobject.h:1, from ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/kernel/qcoreapplication.h:46, from ../../include/QtCore/qcoreapplication.h:1, from /src/widgets/kernel/../../gui/kernel/../../corelib/global/qt_pch.h:66, from /src/widgets/kernel/../../gui/kernel/qt_gui_pch.h:48, from /src/widgets/kernel/qt_widgets_pch.h:48: ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h: In instantiation of ‘void QList<T>::node_construct(QList<T>::Node*, const T&) [with T = QTableWidgetSelectionRange]’: ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h:614:13: required from ‘void QList<T>::append(const T&) [with T = QTableWidgetSelectionRange]’ /src/widgets/itemviews/qtablewidget.cpp:2416:71: required from here ../../include/QtCore/../../../qtbase_dev_de_verdad/src/corelib/tools/qlist.h:471:35: warning: implicitly-declared ‘constexpr QTableWidgetSelectionRange& QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange&)’ is deprecated [-Wdeprecated-copy] 471 | else *reinterpret_cast<T*>(n) = t; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /src/widgets/itemviews/qtablewidget.cpp:40: /src/widgets/itemviews/qtablewidget.h:52:24: note: because ‘QTableWidgetSelectionRange’ has user-provided ‘QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange&)’ 52 | class Q_WIDGETS_EXPORT QTableWidgetSelectionRange | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: I72ca2dbf1d46a0f51a6fc7b7df80c79f937657de Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r--src/widgets/itemviews/qtablewidget.cpp6
-rw-r--r--src/widgets/itemviews/qtablewidget.h5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index a25a582881..b1dbafa997 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -923,10 +923,8 @@ QTableWidgetSelectionRange::QTableWidgetSelectionRange(int top, int left, int bo
Constructs a the table selection range by copying the given \a
other table selection range.
*/
-QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange &other)
- : top(other.top), left(other.left), bottom(other.bottom), right(other.right)
-{
-}
+QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange &other) = default;
+QTableWidgetSelectionRange &QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange &other) = default;
/*!
Destroys the table selection range.
diff --git a/src/widgets/itemviews/qtablewidget.h b/src/widgets/itemviews/qtablewidget.h
index d93032f3f0..0d93a0a075 100644
--- a/src/widgets/itemviews/qtablewidget.h
+++ b/src/widgets/itemviews/qtablewidget.h
@@ -49,14 +49,17 @@ QT_REQUIRE_CONFIG(tablewidget);
QT_BEGIN_NAMESPACE
+// ### Qt6 unexport the class, remove the user-defined special 3 and make it a literal type.
class Q_WIDGETS_EXPORT QTableWidgetSelectionRange
{
public:
QTableWidgetSelectionRange();
QTableWidgetSelectionRange(int top, int left, int bottom, int right);
- QTableWidgetSelectionRange(const QTableWidgetSelectionRange &other);
~QTableWidgetSelectionRange();
+ QTableWidgetSelectionRange(const QTableWidgetSelectionRange &other);
+ QTableWidgetSelectionRange &operator=(const QTableWidgetSelectionRange &other);
+
inline int topRow() const { return top; }
inline int bottomRow() const { return bottom; }
inline int leftColumn() const { return left; }