From dd9df8d31f2c484c3fea56b78f959ed912807ff1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 3 Dec 2015 13:55:13 +0100 Subject: [PATCH] QAbstractItemModelPrivate::Change: add some constexpr Change-Id: Ie852a20463af42db7d9959f8b79512e0d521e73d Reviewed-by: Friedemann Kleint --- src/corelib/itemmodels/qabstractitemmodel_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/itemmodels/qabstractitemmodel_p.h b/src/corelib/itemmodels/qabstractitemmodel_p.h index c2cbaf5298..466cefc261 100644 --- a/src/corelib/itemmodels/qabstractitemmodel_p.h +++ b/src/corelib/itemmodels/qabstractitemmodel_p.h @@ -126,9 +126,9 @@ public: } struct Change { - Change() : first(-1), last(-1) {} - Change(const Change &c) : parent(c.parent), first(c.first), last(c.last), needsAdjust(c.needsAdjust) {} - Change(const QModelIndex &p, int f, int l) : parent(p), first(f), last(l), needsAdjust(false) {} + Q_DECL_CONSTEXPR Change() : parent(), first(-1), last(-1), needsAdjust(false) {} + Q_DECL_CONSTEXPR Change(const QModelIndex &p, int f, int l) : parent(p), first(f), last(l), needsAdjust(false) {} + QModelIndex parent; int first, last; @@ -147,7 +147,7 @@ public: // rowsMoved signal. bool needsAdjust; - bool isValid() { return first >= 0 && last >= 0; } + Q_DECL_CONSTEXPR bool isValid() const { return first >= 0 && last >= 0; } }; QStack changes;