Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Display album covers in a grid
Forum Updated to NodeBB v4.3 + New Features

Display album covers in a grid

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.3k Views 1 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
    fixxxer
    wrote on last edited by
    #1

    Hello guys,
    i am writing a music player and i need to create some pane where i can add music artists and generate album arts. Display should be image and text under the image.
    Image should be resizable(i can deal with that). Problem is that i cant find a containder that can for example get only 2 entries and still keep the predefined size.
    So far i found one kinda solution: used QListWidget in Icon mode. This is almost exactly what i need. Thing is that no matter how much entries are in the container,
    size of cover must be the same and also column count must be depending on the main window resize. So far the QListWidget works but i had different problem.
    When i am resizing the image (inserted as a Pixmap) the image goes below(or over) the text. I need the text to be below the image no matter the image size.
    So, bottom line, is there any way to do it with QListView or i need to use something like QGraphicsView (that i am too dumb to implement, cant understand anything).
    If i need to use GraphicsView can you show me example code?
    P.S. App is written in python. I have no idea how c++ even look so spare my soul and python me :D

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      Funny i say the same about python :)
      I cannot not handle the invisible { }

      Anyways, for the QListWidget in icon mode.

      Did you try the http://doc.qt.io/qt-5/qabstractitemview.html#iconSize-prop
      That way you can have them any size you want.

      else for GraphicsView , i would look at the 40.000 sample.
      http://doc.qt.io/qt-5/qtwidgets-graphicsview-chip-example.html
      (sorry c++) I dont know any where to get pyt samples from.

      F 1 Reply Last reply
      1
      • mrjjM mrjj

        Hi
        Funny i say the same about python :)
        I cannot not handle the invisible { }

        Anyways, for the QListWidget in icon mode.

        Did you try the http://doc.qt.io/qt-5/qabstractitemview.html#iconSize-prop
        That way you can have them any size you want.

        else for GraphicsView , i would look at the 40.000 sample.
        http://doc.qt.io/qt-5/qtwidgets-graphicsview-chip-example.html
        (sorry c++) I dont know any where to get pyt samples from.

        F Offline
        F Offline
        fixxxer
        wrote on last edited by
        #3

        @mrjj icon size makes icon grow and hide the text

        mrjjM 1 Reply Last reply
        0
        • F fixxxer

          @mrjj icon size makes icon grow and hide the text

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @fixxxer
          Hmm. It did not hide text for me. Just made icons bigger.
          I will have a look in the evening.

          1 Reply Last reply
          0
          • VRoninV Offline
            VRoninV Offline
            VRonin
            wrote on last edited by
            #5

            In QML is incredibly easy to do, using QWidgets you probably want a QTableView with a custom QStyledItemDelegate with a reimplemented paint() and sizeHint() that handles the design. You can use a proxy model to split your list of icons into multiple columns.

            I have 0 idea of how to write in python so I won't even try post a code draft

            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
            ~Napoleon Bonaparte

            On a crusade to banish setIndexWidget() from the holy land of Qt

            1 Reply Last reply
            2

            • Login

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