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. I want to perform a function when the radio button is pressed in QT

I want to perform a function when the radio button is pressed in QT

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 2.3k 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.
  • S Offline
    S Offline
    segtteee
    wrote on last edited by
    #1
    This post is deleted!
    1 Reply Last reply
    -1
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by dheerendra
      #2

      Have you looked at the signals available in QRadioButton like checked(), clicked(), pressed() etc ? Make signal & slot communication with clicked() signal.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      S 1 Reply Last reply
      0
      • dheerendraD dheerendra

        Have you looked at the signals available in QRadioButton like checked(), clicked(), pressed() etc ? Make signal & slot communication with clicked() signal.

        S Offline
        S Offline
        segtteee
        wrote on last edited by
        #3

        @dheerendra
        are you saying this?
        if (ui->radioButton_on->isChecked())
        {
        ui->command->setText();
        }
        between the setText() , i enter the command but it doesn't work

        1 Reply Last reply
        0
        • dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by dheerendra
          #4

          Is the radioButton already checked ? If yes, then only it works. Otherwise it does not work. Since u r telling it does not work, i'm sure it is not checked. Who is supposed to click on the RadioButton ?

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          S 1 Reply Last reply
          0
          • dheerendraD dheerendra

            Is the radioButton already checked ? If yes, then only it works. Otherwise it does not work. Since u r telling it does not work, i'm sure it is not checked. Who is supposed to click on the RadioButton ?

            S Offline
            S Offline
            segtteee
            wrote on last edited by
            #5

            @dheerendra
            i will test qt , check button . and add code
            "if (ui->radioButton_on->isChecked())
            {
            ui->command->setText("mon 1");
            }"
            but device dosen't work.

            1 Reply Last reply
            0
            • dheerendraD Offline
              dheerendraD Offline
              dheerendra
              Qt Champions 2022
              wrote on last edited by
              #6
              1. Can you confirm whether RadioButton is selected ?
              2. Can you confirm whether code piece you pasted here, is executed ?
              3. Can you tell me when above code piece executed ? Is it based on some condition ? OR
              4. Are you expecting the above code piece to be executed when you click on the radioButton ?

              Dheerendra
              @Community Service
              Certified Qt Specialist
              http://www.pthinks.com

              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