aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/libsample/modelindex.h
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2022-09-24 03:01:04 +0000
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2022-09-24 03:01:04 +0000
commit5a93b20553ab55b94fef60fa5f92387f4ead6bea (patch)
tree9f94db8d9fa6331dac49ff9a849b58d036aabcf3 /sources/shiboken6/tests/libsample/modelindex.h
parent09189296271176e32507100f32e9ee1b155b61f7 (diff)
parent76d6758a8d6f5136d5eba63e787fbf27ed5450e5 (diff)
Merge branch 6.3 into wip/6.3_pypywip/6.3_pypy
Diffstat (limited to 'sources/shiboken6/tests/libsample/modelindex.h')
-rw-r--r--sources/shiboken6/tests/libsample/modelindex.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/sources/shiboken6/tests/libsample/modelindex.h b/sources/shiboken6/tests/libsample/modelindex.h
index dd3ddc089..370b1bce3 100644
--- a/sources/shiboken6/tests/libsample/modelindex.h
+++ b/sources/shiboken6/tests/libsample/modelindex.h
@@ -34,21 +34,22 @@
class ModelIndex
{
public:
- ModelIndex() : m_value(0) {}
- ModelIndex(const ModelIndex& other) { m_value = other.m_value; }
+ ModelIndex() = default;
+
inline void setValue(int value) { m_value = value; }
inline int value() const { return m_value; }
static int getValue(const ModelIndex& index) { return index.value(); }
private:
- int m_value;
+ int m_value = 0;
};
class ReferentModelIndex
{
public:
- ReferentModelIndex() {}
- ReferentModelIndex(const ModelIndex& index) : m_index(index) {}
- ReferentModelIndex(const ReferentModelIndex& other) { m_index = other.m_index; }
+ ReferentModelIndex() = default;
+
+ explicit ReferentModelIndex(const ModelIndex& index) : m_index(index) {}
+
inline void setValue(int value) { m_index.setValue(value); }
inline int value() const { return m_index.value(); }
operator const ModelIndex&() const { return m_index; }
@@ -59,9 +60,10 @@ private:
class PersistentModelIndex
{
public:
- PersistentModelIndex() {}
- PersistentModelIndex(const ModelIndex& index) : m_index(index) {}
- PersistentModelIndex(const PersistentModelIndex& other) { m_index = other.m_index; }
+ PersistentModelIndex() = default;
+
+ explicit PersistentModelIndex(const ModelIndex& index) : m_index(index) {}
+
inline void setValue(int value) { m_index.setValue(value); }
inline int value() const { return m_index.value(); }
operator ModelIndex() const { return m_index; }