Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to add multiple values inside a single cell of pyside2 QTableWidget?
Forum Updated to NodeBB v4.3 + New Features

How to add multiple values inside a single cell of pyside2 QTableWidget?

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 3 Posters 1.8k 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
    haider
    wrote on last edited by
    #1

    I am working on a GUI using pyside2, where I have multiple values for columns of a single record. The soultion I have thought for this is that I will show data in QTableWidget and inside table widget show multiple values inside a single cell. Does anyone has any idea how to add multiple values inside a single cell of QTableWidget.
    Thanks

    JonBJ 1 Reply Last reply
    0
    • H haider

      I am working on a GUI using pyside2, where I have multiple values for columns of a single record. The soultion I have thought for this is that I will show data in QTableWidget and inside table widget show multiple values inside a single cell. Does anyone has any idea how to add multiple values inside a single cell of QTableWidget.
      Thanks

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by JonB
      #2

      @haider
      You have to start by thinking out what display/interface/editability you want for these. For example, a comma-separated string list? Separate items on lines of their own? A combo box? A complete sub-table?

      H 1 Reply Last reply
      1
      • JonBJ JonB

        @haider
        You have to start by thinking out what display/interface/editability you want for these. For example, a comma-separated string list? Separate items on lines of their own? A combo box? A complete sub-table?

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

        @JonB it can be a separate items on lines of their own or a complete sub table. Any solution would be helpful for me

        1 Reply Last reply
        0
        • H Offline
          H Offline
          haider
          wrote on last edited by
          #4

          @Denni-0 said in How to add multiple values inside a single cell of pyside2 QTableWidget?:

          JonB to put more than one value within a single cell you pretty much have to combine them within code prior to putting them into that cell -- basically treat each cell as if it were like a QLineEdit without all the bells/whistles that come with a QLineEdit object

          My other question would be why are even wanting to do this as it seems like that would be rather confusing to the User and be a semi-nightmare when it came to editing -- why not just add more columns? If its a header issue then there are ways to get a header to span more than one column.

          As for how to manipulate this data you might want to look into the Data Model aspect of PyQt

          @Denni-0 if we can span header to more then one columns then can you help me how we can do that with pyside2

          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