on xenial help sign in
item() function is still needed on other parts of GenericScopeView ^_^
0ef5061Albert Astals Cid
plugins/Dash/listviewwithpageheader.cpp+9
@@ -442,6 +442,15 @@ int ListViewWithPageHeader::createdItemCount() const
442 return m_visibleItems.count();
442 return m_visibleItems.count();
443}
443}
444
444
445+QQuickItem *ListViewWithPageHeader::item(int modelIndex) const
446+{
447+ ListItem *item = itemAtIndex(modelIndex);
448+ if (item)
449+ return item->m_item;
450+ else
451+ return nullptr;
452+}
453+
445bool ListViewWithPageHeader::maximizeVisibleArea(int modelIndex)
454bool ListViewWithPageHeader::maximizeVisibleArea(int modelIndex)
446{
455{
447 ListItem *listItem = itemAtIndex(modelIndex);
456 ListItem *listItem = itemAtIndex(modelIndex);
plugins/Dash/listviewwithpageheader.h+1
@@ -92,6 +92,7 @@ public:
92 Q_INVOKABLE void showHeader();
92 Q_INVOKABLE void showHeader();
93 Q_INVOKABLE int firstCreatedIndex() const;
93 Q_INVOKABLE int firstCreatedIndex() const;
94 Q_INVOKABLE int createdItemCount() const;
94 Q_INVOKABLE int createdItemCount() const;
95+ Q_INVOKABLE QQuickItem *item(int modelIndex) const;
95
96
96 // The index has to be created for this to try to do something
97 // The index has to be created for this to try to do something
97 // Created items are those visible and the precached ones
98 // Created items are those visible and the precached ones