From ae8406d82f541f6d9112bdac192e5e4e114d56aa Mon Sep 17 00:00:00 2001 From: David Faure Date: Wed, 6 May 2015 17:57:36 +0200 Subject: Deprecate ItemIsTristate in favor of ItemIsAutoTristate. This makes the behavior much more clear. You can get a tristate checkbox just by setting the CheckStateRole to PartiallyChecked, no tristate flag needed. The flag, on the other hand, enables the automatic-tristate behavior in QTreeViews (and only there), hence the new name for it. Change-Id: I18d292a8b8294c863eab806f3874d15dfb72556c Reviewed-by: Jarek Kobus --- src/gui/itemmodels/qstandarditemmodel.cpp | 2 +- src/gui/itemmodels/qstandarditemmodel.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/itemmodels') diff --git a/src/gui/itemmodels/qstandarditemmodel.cpp b/src/gui/itemmodels/qstandarditemmodel.cpp index ed2479302e..2bd19fb49e 100644 --- a/src/gui/itemmodels/qstandarditemmodel.cpp +++ b/src/gui/itemmodels/qstandarditemmodel.cpp @@ -1258,7 +1258,7 @@ void QStandardItem::setCheckable(bool checkable) void QStandardItem::setTristate(bool tristate) { Q_D(QStandardItem); - d->changeFlags(tristate, Qt::ItemIsTristate); + d->changeFlags(tristate, Qt::ItemIsAutoTristate); } /*! diff --git a/src/gui/itemmodels/qstandarditemmodel.h b/src/gui/itemmodels/qstandarditemmodel.h index 3dd613f907..d9530ac0bf 100644 --- a/src/gui/itemmodels/qstandarditemmodel.h +++ b/src/gui/itemmodels/qstandarditemmodel.h @@ -159,7 +159,7 @@ public: void setCheckable(bool checkable); inline bool isTristate() const { - return (flags() & Qt::ItemIsTristate) != 0; + return (flags() & Qt::ItemIsAutoTristate) != 0; } void setTristate(bool tristate); -- cgit v1.2.3