Results 1 to 8 of 8

Thread: QPushButton clicked

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Jan 2017
    Posts
    58
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QPushButton clicked

    The first reason is that I just want to know it, if it is possible.
    The second, let's suppose that I have a application where is a lot of buttons and I'm not sure if is good / clean / .. make a lot of connections. I think that could be better make a event that is automatically called after every clicked button and inside this function (event) will be sth to get AccessibleName.

    Pseudocode:
    Qt Code:
    1. void MainWindow::event(sth) {
    2. if(sth->accessibleName == "btn1")
    3. // do stuff #1
    4. else if(sth->accessibleName == "btn2")
    5. // do stuff #2
    6. etc...
    7. }
    To copy to clipboard, switch view to plain text mode 

    So the main purpose of it is how to serve a lot of buttons.
    Last edited by ado130; 15th February 2017 at 09:57.

Similar Threads

  1. Replies: 0
    Last Post: 12th May 2013, 10:09
  2. Replies: 2
    Last Post: 26th October 2011, 15:41
  3. how can i get the QPushButton clicked on a QTable
    By showben in forum Qt Programming
    Replies: 2
    Last Post: 2nd March 2011, 15:42
  4. Qpushbutton clicked()
    By sasori1512 in forum Qt Programming
    Replies: 3
    Last Post: 20th February 2011, 02:03
  5. QPushButton color when clicked
    By ntp in forum Qt Programming
    Replies: 3
    Last Post: 30th April 2008, 18:34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.