Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. GridView with sections
Forum Updated to NodeBB v4.3 + New Features

GridView with sections

Scheduled Pinned Locked Moved Solved QML and Qt Quick
7 Posts 3 Posters 1.3k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    FOXLISIN
    wrote on last edited by
    #1

    Hi. I need to find a solution for the following problem: display GridView with sections (like a ListView with sections). Is it possible?

    1 Reply Last reply
    0
    • F Offline
      F Offline
      FOXLISIN
      wrote on last edited by
      #2

      This is really important question, anyone :)

      p3c0P 1 Reply Last reply
      0
      • F FOXLISIN

        This is really important question, anyone :)

        p3c0P Offline
        p3c0P Offline
        p3c0
        Moderators
        wrote on last edited by
        #3

        @FOXLISIN As you can see there is no section built-in property for GridView 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 ?

        157

        F 1 Reply Last reply
        0
        • p3c0P p3c0

          @FOXLISIN As you can see there is no section built-in property for GridView 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 ?

          F Offline
          F Offline
          FOXLISIN
          wrote on last edited by
          #4

          @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

          p3c0P 1 Reply Last reply
          0
          • F FOXLISIN

            @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

            p3c0P Offline
            p3c0P Offline
            p3c0
            Moderators
            wrote on last edited by
            #5

            @FOXLISIN I think it could be achieved using ListView with delegate as a component containing GridView.

            157

            M 1 Reply Last reply
            1
            • p3c0P p3c0

              @FOXLISIN I think it could be achieved using ListView with delegate as a component containing GridView.

              M Offline
              M Offline
              medyakovvit
              wrote on last edited by medyakovvit
              #6

              @FOXLISIN
              @p3c0 said:

              @FOXLISIN I think it could be achieved using ListView with delegate as a component containing GridView.

              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;
              };
              
              F 1 Reply Last reply
              0
              • M medyakovvit

                @FOXLISIN
                @p3c0 said:

                @FOXLISIN I think it could be achieved using ListView with delegate as a component containing GridView.

                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;
                };
                
                F Offline
                F Offline
                FOXLISIN
                wrote on last edited by
                #7

                Thank you guys @p3c0 @medyakovvit
                I'll try to implement it as you say

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved