Commit 618d7dd 1 parent 24963b3 commit 618d7dd Copy full SHA for 618d7dd
File tree 4 files changed +7
-25
lines changed
4 files changed +7
-25
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ namespace {
181
181
182
182
183
183
FolderStatusModel::FolderStatusModel (QObject *parent)
184
- : QAbstractTableModel (parent)
184
+ : QAbstractListModel (parent)
185
185
, _accountState(nullptr )
186
186
{
187
187
}
@@ -342,11 +342,6 @@ Folder *FolderStatusModel::folder(const QModelIndex &index) const
342
342
return _folders.at (index .row ())->_folder ;
343
343
}
344
344
345
- int FolderStatusModel::columnCount (const QModelIndex &) const
346
- {
347
- return 1 ;
348
- }
349
-
350
345
int FolderStatusModel::rowCount (const QModelIndex &parent) const
351
346
{
352
347
Q_ASSERT (!parent.isValid ());
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ namespace {
40
40
* @brief The FolderStatusModel class
41
41
* @ingroup gui
42
42
*/
43
- class FolderStatusModel : public QAbstractTableModel
43
+ class FolderStatusModel : public QAbstractListModel
44
44
{
45
45
Q_OBJECT
46
46
QML_ELEMENT
@@ -65,11 +65,10 @@ class FolderStatusModel : public QAbstractTableModel
65
65
~FolderStatusModel () override ;
66
66
void setAccountState (const AccountStatePtr &accountState);
67
67
68
- QVariant data (const QModelIndex &index, int role) const override ;
69
68
Folder *folder (const QModelIndex &index) const ;
70
- int columnCount (const QModelIndex &parent = QModelIndex()) const override ;
71
- int rowCount (const QModelIndex &parent = QModelIndex()) const override ;
72
69
70
+ QVariant data (const QModelIndex &index, int role) const override ;
71
+ int rowCount (const QModelIndex &parent = QModelIndex()) const override ;
73
72
QHash<int , QByteArray> roleNames () const override ;
74
73
75
74
public Q_SLOTS:
Original file line number Diff line number Diff line change 22
22
using namespace OCC ::Spaces;
23
23
24
24
SpacesModel::SpacesModel (QObject *parent)
25
- : QAbstractTableModel (parent)
25
+ : QAbstractListModel (parent)
26
26
{
27
27
}
28
28
@@ -34,15 +34,6 @@ int SpacesModel::rowCount(const QModelIndex &parent) const
34
34
return static_cast <int >(_spacesList.size ());
35
35
}
36
36
37
- int SpacesModel::columnCount (const QModelIndex &parent) const
38
- {
39
- Q_ASSERT (checkIndex (parent));
40
- if (parent.isValid ()) {
41
- return 0 ;
42
- }
43
- return 1 ;
44
- }
45
-
46
37
QVariant SpacesModel::data (const QModelIndex &index, int role) const
47
38
{
48
39
Q_ASSERT (checkIndex (index , QAbstractItemModel::CheckIndexOption::IndexIsValid));
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ class Space;
23
23
};
24
24
25
25
namespace OCC ::Spaces {
26
- class SpacesModel : public QAbstractTableModel
26
+ class SpacesModel : public QAbstractListModel
27
27
{
28
28
Q_OBJECT
29
29
@@ -43,14 +43,11 @@ class SpacesModel : public QAbstractTableModel
43
43
explicit SpacesModel (QObject *parent = nullptr );
44
44
45
45
int rowCount (const QModelIndex &parent = QModelIndex()) const override ;
46
- int columnCount (const QModelIndex &parent = QModelIndex()) const override ;
47
-
48
46
QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override ;
47
+ QHash<int , QByteArray> roleNames () const override ;
49
48
50
49
void setSpacesManager (GraphApi::SpacesManager *spacesManager);
51
50
52
- QHash<int , QByteArray> roleNames () const override ;
53
-
54
51
private:
55
52
GraphApi::SpacesManager *_spacesManager = nullptr ;
56
53
QVector<GraphApi::Space *> _spacesList;
You can’t perform that action at this time.
0 commit comments