From 29b38bea45712c85a0c9f07bfa26524f3a35668f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 20 Sep 2017 11:36:42 +0200 Subject: Polish the StorageView example Introduce nullptr and override. Change the ready/valid columns to use check marks. Right-align the numerical columns. Add a shortcut to refresh. Sort by path, making sure the root volume is first. Task-number: QTBUG-60635 Change-Id: I74cda7647f544902aaf4d2a0ab76986f1523aa6f Reviewed-by: Gatis Paeglis --- examples/widgets/itemviews/storageview/storagemodel.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'examples/widgets/itemviews/storageview/storagemodel.h') diff --git a/examples/widgets/itemviews/storageview/storagemodel.h b/examples/widgets/itemviews/storageview/storagemodel.h index 2b37414d8d..787b2f04de 100644 --- a/examples/widgets/itemviews/storageview/storagemodel.h +++ b/examples/widgets/itemviews/storageview/storagemodel.h @@ -74,13 +74,17 @@ public: ColumnCount }; - explicit StorageModel(QObject *parent = 0); + explicit StorageModel(QObject *parent = nullptr); - int columnCount(const QModelIndex &parent) const; - int rowCount(const QModelIndex &parent) const; + int columnCount(const QModelIndex &parent) const override; + int rowCount(const QModelIndex &parent) const override; - QVariant data(const QModelIndex &index, int role) const; - QVariant headerData(int section, Qt::Orientation orientation, int role) const; + QVariant data(const QModelIndex &index, int role) const override; + Qt::ItemFlags flags(const QModelIndex &index) const override; + QVariant headerData(int section, Qt::Orientation orientation, int role) const override; + +public slots: + void refresh(); private: QList m_volumes; -- cgit v1.2.3