Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Grouping 20 pushbutton together (Solved)
QtWS25 Last Chance

Grouping 20 pushbutton together (Solved)

Scheduled Pinned Locked Moved Mobile and Embedded
8 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.
  • H Offline
    H Offline
    houmingc
    wrote on last edited by
    #1

    I have a requirement to make 20 pushbutton visible together.
    How can i achieve it. rather than individual ui->button->setVisible(true)

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      You can connect a common signal to all the QPushButton's setVisible slot and then emit that signal when required.

      157

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nils_heidorn
        wrote on last edited by
        #3

        Hi ! Or instead of putting them in a layout you can put them in a widget (and then layout that widget) and can simply use set visible on the "mother" widget.
        I do it that way all the time.

        Greetings,

        Nils

        1 Reply Last reply
        0
        • H Offline
          H Offline
          houmingc
          wrote on last edited by
          #4

          Answer

          1 Reply Last reply
          0
          • p3c0P Offline
            p3c0P Offline
            p3c0
            Moderators
            wrote on last edited by
            #5

            What does this mean ? Did this solve your query ?

            157

            1 Reply Last reply
            0
            • H Offline
              H Offline
              houmingc
              wrote on last edited by
              #6

              on_radioButton_clicked()
              {
              ui->widget->setVisible(false);
              ui->pushButton->setVisible(false);
              }

              on_radioButton2_clicked()
              {
              //ui->widget->setVisible(false);
              ui->pushButton->setVisible(false);
              }

              pushButton->setVisible work, but not widget->setVisible(false)

              1 Reply Last reply
              0
              • N Offline
                N Offline
                nils_heidorn
                wrote on last edited by
                #7

                Hi !

                Like i said, if you group all Elements in an oute widget containing a layout you can simply set this outer widget visible true/false an all siblings will follow.

                Greetings,

                Nils

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  houmingc
                  wrote on last edited by
                  #8

                  i put the pushButton onto the widget insteads of reverse. It work :>>>
                  Problem solved :>>>

                  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