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. how can i add more column in QListWidget ListMode?
QtWS25 Last Chance

how can i add more column in QListWidget ListMode?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 3.1k Views
  • 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.
  • O Offline
    O Offline
    opengpu2
    wrote on last edited by
    #1

    how can i add more column in QListWidget ListMode?
    i want to add more info more than the file name
    thank you

    p3c0P 1 Reply Last reply
    0
    • O opengpu2

      how can i add more column in QListWidget ListMode?
      i want to add more info more than the file name
      thank you

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

      @opengpu2 You can't. QListWidget is a single dimension widget as the lists itself are.
      Use QTableWidget or QTreeWidget to have more that one column.

      157

      1 Reply Last reply
      0
      • O Offline
        O Offline
        opengpu2
        wrote on last edited by
        #3

        thank you, iknow QTable can do this.
        but i want to switch between the IconMode and the ListMode, while the data set actually should be view as QListWidget.
        the column after the 1st one is just the custom data of the 1st one, eg. 1st one is fileName, after that i can show it's created time, file type, etc.
        thank you

        p3c0P 1 Reply Last reply
        0
        • O opengpu2

          thank you, iknow QTable can do this.
          but i want to switch between the IconMode and the ListMode, while the data set actually should be view as QListWidget.
          the column after the 1st one is just the custom data of the 1st one, eg. 1st one is fileName, after that i can show it's created time, file type, etc.
          thank you

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

          @opengpu2 AFAIK Using QListWidget that cannot be done. It has only one column.

          157

          1 Reply Last reply
          0
          • O Offline
            O Offline
            opengpu2
            wrote on last edited by
            #5

            i want to use QListWidget because i want to preview in IconMode. Meanwhile, i want to dynamically preview in ListMode but with multi-column(confilicts here, because the QListWidget only support 1 column).

            1 solution is when IconMode i use QListWidget, when "ListMode" i use QTree/QTableWidget, but this is very ugly...and not elegant at all...

            can i preview as IconMode in QTree/QTableWidget ?

            p3c0P 1 Reply Last reply
            0
            • O opengpu2

              i want to use QListWidget because i want to preview in IconMode. Meanwhile, i want to dynamically preview in ListMode but with multi-column(confilicts here, because the QListWidget only support 1 column).

              1 solution is when IconMode i use QListWidget, when "ListMode" i use QTree/QTableWidget, but this is very ugly...and not elegant at all...

              can i preview as IconMode in QTree/QTableWidget ?

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

              @opengpu2 In QTreeWidget or QTableWidget you can add your own widgets. For eg. to simulate IconMode you can create a widget consisting of QLabels for text and icon OR use QToolButton with toolButtonStyle as ToolButtonTextUnderIcon and then add this widget to QTreeWidget using setItemWidget OR setCellWidget for QTableWidget.

              157

              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