Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Close the widget when push the button

    General and Desktop
    qt5 pushbutton widget
    2
    3
    442
    Loading More Posts
    • 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
      deleted286 last edited by

      I have a push button which name is Ok. I want to close the widget when i clicked on Ok button. I've written the code below but it doesnt work. How can i do it?

      void uk_yapilandirma::on_Ok_toggled(bool checked)
      {
      if(checked == true) {
          ui->Ok->close();
      }
      }
      
      D JonB 2 Replies Last reply Reply Quote 0
      • D
        deleted286 @deleted286 last edited by

        @suslucoder
        I did it like this way, it works

        void uk_yapilandirma::on_Ok_clicked()
        {
            this->close();
        }
        
        1 Reply Last reply Reply Quote 0
        • JonB
          JonB @deleted286 last edited by

          @suslucoder said in Close the widget when push the button:

          want to close the widget when i clicked on Ok button.

          What widget (do you want to close)?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post