Solved GridView with sections
-
Hi. I need to find a solution for the following problem: display GridView with sections (like a ListView with sections). Is it possible?
-
This is really important question, anyone :)
-
@FOXLISIN As you can see there is no
section
built-in property forGridView
so it is not possible to use sections there. But you can always try to create your own custom elements to suit yur needs :)
Btw. can you explain what you re trying to achieve ? -
@p3c0 Thanks for your reply :)
I want to create emoji widget like emoji widget in "Slack".
See image: http://s32.postimg.org/9tggf3345/emoji_my.png -
@FOXLISIN I think it could be achieved using
ListView
with delegate as a component containingGridView
. -
@FOXLISIN I think it could be achieved using
ListView
with delegate as a component containingGridView
.And for example c++ model can be looked like:
class MyModel : public QAbstractListModel { ... // Some implementation ... QVector<SubModel*> m_subModels; }; class SubModel : public QAbstractListModel { ... // Some implementation ... QString m_sectionName; QVector<EmojiItem*> m_emojis; };
-
Thank you guys @p3c0 @medyakovvit
I'll try to implement it as you say