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. radio Button Sorting in QTableWidget

radio Button Sorting in QTableWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 1.0k 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.
  • M Offline
    M Offline
    MarshMallow
    wrote on last edited by
    #1

    My table has first column as text and next three column as radioButton how can I sort the next RadioButton if they are clicked and corresponding directory. Please find the attached pic of my ui![alt text]0_1527679860708_Pathtype.PNG

    raven-worxR 1 Reply Last reply
    0
    • VRoninV Offline
      VRoninV Offline
      VRonin
      wrote on last edited by
      #2

      How do you implement those radio buttons?

      (please don't say setItemWidget, it just hurts more every time I see it)

      "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
      1
      • M MarshMallow

        My table has first column as text and next three column as radioButton how can I sort the next RadioButton if they are clicked and corresponding directory. Please find the attached pic of my ui![alt text]0_1527679860708_Pathtype.PNG

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by raven-worx
        #3

        @MarshMallow said in radio Button Sorting in QTableWidget:

        My table has first column as text and next three column as radioButton how can I sort the next RadioButton if they are clicked and corresponding directory.

        1. subclass a QSortFilterProxyModel and wrap it around your existing model and assign this model to your view
        2. reimplement it's lessThan() method
        3. implement the logic for your columns, call the base class implementation for irrelevant columns
        4. call sort() on the proxy model

        Also see this

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        3

        • Login

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