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. Dynamically changing images with options QButtonGroup (QRadioButton)
Qt 6.11 is out! See what's new in the release blog

Dynamically changing images with options QButtonGroup (QRadioButton)

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 632 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.
  • P Offline
    P Offline
    Pedro_Monteiro
    wrote on last edited by
    #1

    Hello, I'm trying to change an image automatically as soon as the user makes a choice in two QButtonGroup of QRadioButton, a group has two options and the other has four options, so I intend to show eight different images depending on the options, how can I capture what group button was captured, associate it with the button of the other group and in real time to change the image? Is there any example like that?
    How to change a picture I know, I used QLabel and the method setPixmap() for that, what I lack is to know how to capture the signs of these QButtonGroup and automatically change the image.
    I hope I've been accurate in my description. Thank you for attention.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jakob
      wrote on last edited by
      #2

      @Pedro_Monteiro You'd need to write a slot that listens to one of the signals in http://doc.qt.io/qt-5/qbuttongroup.html#signals - choose whichever is best suited to the details of the rest of your code

      1 Reply Last reply
      1

      • Login

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