summaryrefslogtreecommitdiffstats
path: root/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-01-23 18:21:58 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2020-01-30 13:32:57 +0100
commit2130d282b1a2671049c90dd4e99e512b8009de9a (patch)
tree6786ba174134cd8263f54429b2ada2676bb7a77b /examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp
parent45967dfbd8192a14a324a75377d1860891845fbf (diff)
Change examples and snippets to pass QDate and QTime by value
They're value types, so we should show them being used as such. Change-Id: If9f0c366fac66306b7861f04e2f047540d444acc Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp')
-rw-r--r--examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp
index 4753d04d9b..430a086fd6 100644
--- a/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp
+++ b/examples/widgets/itemviews/customsortfiltermodel/mysortfilterproxymodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the examples of the Qt Toolkit.
@@ -60,7 +60,7 @@ MySortFilterProxyModel::MySortFilterProxyModel(QObject *parent)
//! [0]
//! [1]
-void MySortFilterProxyModel::setFilterMinimumDate(const QDate &date)
+void MySortFilterProxyModel::setFilterMinimumDate(QDate date)
{
minDate = date;
invalidateFilter();
@@ -68,7 +68,7 @@ void MySortFilterProxyModel::setFilterMinimumDate(const QDate &date)
//! [1]
//! [2]
-void MySortFilterProxyModel::setFilterMaximumDate(const QDate &date)
+void MySortFilterProxyModel::setFilterMaximumDate(QDate date)
{
maxDate = date;
invalidateFilter();
@@ -122,7 +122,7 @@ bool MySortFilterProxyModel::lessThan(const QModelIndex &left,
//! [5] //! [6]
//! [7]
-bool MySortFilterProxyModel::dateInRange(const QDate &date) const
+bool MySortFilterProxyModel::dateInRange(QDate date) const
{
return (!minDate.isValid() || date > minDate)
&& (!maxDate.isValid() || date < maxDate);