Results 1 to 2 of 2

Thread: pushButton click event

  1. #1
    Join Date
    Sep 2008
    Posts
    84
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default pushButton click event

    hii..
    I'm facing difficulty while using pushbutton click Event.
    Here is the code:
    Qt Code:
    1. connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(some_slot()));
    To copy to clipboard, switch view to plain text mode 

    I want the function to be access when the some_flag is TRUE;
    The flag is set TRUE else where in the code & initially the flag is FALSE.
    How can it be done?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: pushButton click event

    I'm not sure that I understand what your question properly, but maybe this can help
    Qt Code:
    1. void MyWidget::some_slot()
    2. {
    3. if (!m_someFlag)
    4. return;
    5. ...
    6. }
    To copy to clipboard, switch view to plain text mode 
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

Similar Threads

  1. Replies: 4
    Last Post: 21st March 2009, 13:51
  2. Replies: 4
    Last Post: 19th February 2009, 11:10
  3. Replies: 2
    Last Post: 4th August 2008, 07:44
  4. On click event for a QPixmap
    By rishid in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2008, 16:12
  5. The event fired by the mouse click on the frame
    By Placido Currò in forum Qt Programming
    Replies: 8
    Last Post: 3rd March 2007, 09:05

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.