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
Forum Updated to NodeBB v4.3 + New Features

Imitate QRadioButton for QGroupBox

Scheduled Pinned Locked Moved General and Desktop
qradiobuttonqgroupbox
5 Posts 3 Posters 1.8k Views 2 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.
  • D Offline
    D Offline
    david.luggen
    wrote on 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
    • QT-static-prgmQ Offline
      QT-static-prgmQ Offline
      QT-static-prgm
      wrote on 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
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi

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

        1 Reply Last reply
        0
        • QT-static-prgmQ Offline
          QT-static-prgmQ Offline
          QT-static-prgm
          wrote on 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
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on 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

            • Login

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