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. Imitate QRadioButton for QGroupBox
QtWS25 Last Chance

Imitate QRadioButton for QGroupBox

Scheduled Pinned Locked Moved General and Desktop
qradiobuttonqgroupbox
5 Posts 3 Posters 1.6k 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.
  • D Offline
    D Offline
    david.luggen
    wrote on 28 Jul 2015, 14:31 last edited by
    #1

    Hello

    I try to create a customized QGroupBox which contains QWidget elements. These elements aren't QRadioButtons but have a similar behaviour, they are checkable and so on but also have additional sub-elements inside them. Is it possible to configure these QWidget elements in a way, that the QGroupBox sees them as QRadioButtons, so that exclusive selection is enabled?

    Thanks for any help!

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      QT-static-prgm
      wrote on 28 Jul 2015, 14:38 last edited by
      #2

      You could use the press slot of your elements to disable the others in the group. So if one is checked, the others switch to unchecked

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mrjj
        Lifetime Qt Champion
        wrote on 28 Jul 2015, 14:41 last edited by
        #3

        Hi

        I think the elements must be inherited from QAbstractButton for this to work.

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          QT-static-prgm
          wrote on 28 Jul 2015, 14:58 last edited by
          #4

          Or from checkbox, or graphicssceneitem if it's something on the graphicsview. It depends on the element

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mrjj
            Lifetime Qt Champion
            wrote on 28 Jul 2015, 15:05 last edited by
            #5

            Hi
            Checkbox is a QAbstractButton child.
            I think QButtonGroup is the one doing the real work of "exclusive" so I wonder if its possible to
            create a child of QButtonGroup and teach it to handle new types.
            But for QGroupBox, I did not trip over anything that suggest it can use another QButtonGroup. :(

            1 Reply Last reply
            0

            2/5

            28 Jul 2015, 14:38

            • Login

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