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. QTableWidget or QTableView - Presenting many info in one table cell

QTableWidget or QTableView - Presenting many info in one table cell

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 474 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.
  • H Offline
    H Offline
    hbatalha
    wrote on last edited by hbatalha
    #1

    I just downloaded a program to download videos and after seeing this table (image below) I got curious on how I would create something similar in Qt.

    Screenshot_2.png

    I have used QTableWidget and I can't think of how to do this using it so I am guessing it's QTableView(haven't yet quite understood the model/view concept) but I took a quick look at its doc but couldn't have a idea on how to do that using it.

    1 Reply Last reply
    0
    • gde23G Offline
      gde23G Offline
      gde23
      wrote on last edited by
      #2

      You need to set a QStyledItemDelegate for the view.
      The delegate will replace the cell in the table showing your custom widget that you can style according to your needs.

      H 1 Reply Last reply
      2
      • gde23G gde23

        You need to set a QStyledItemDelegate for the view.
        The delegate will replace the cell in the table showing your custom widget that you can style according to your needs.

        H Offline
        H Offline
        hbatalha
        wrote on last edited by
        #3

        @gde23 I went and searched for it and from I could understand, I could use a QGridLayout to achieve something similar to the image in the OP, right?

        JonBJ 1 Reply Last reply
        0
        • H hbatalha

          @gde23 I went and searched for it and from I could understand, I could use a QGridLayout to achieve something similar to the image in the OP, right?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @hbatalha
          Depends how "similar" you mean by "similar".

          QStyledItemDelegate is the right way to go.

          H 1 Reply Last reply
          1
          • JonBJ JonB

            @hbatalha
            Depends how "similar" you mean by "similar".

            QStyledItemDelegate is the right way to go.

            H Offline
            H Offline
            hbatalha
            wrote on last edited by
            #5

            @JonB said in QTableWidget or QTableView - Presenting many info in one table cell:

            Depends how "similar" you mean by "similar".

            Let's say then, visually the same. Using QGridLayout in delegate class I can achieve that?

            1 Reply Last reply
            0
            • gde23G Offline
              gde23G Offline
              gde23
              wrote on last edited by
              #6

              For the layout on the delegate you can use a grid layout or cascaded horizontal/vertical layouts, that really does not matter.
              However, if you are not familiar with basic widget layouts I would suggest starting with something more basic than delegates.
              E.g. you can first setup the model/view, then make a standalone widget to be used as delegate, and finally setup the delegate.

              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