Results 1 to 10 of 10

Thread: button question

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Feb 2007
    Posts
    42
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: button question

    Quote Originally Posted by high_flyer View Post
    I gave you the 'guide', what more do you need?
    1. create a slot
    2. connect the clicked() signal to that slot
    3. in the slot emit the event
    in the book c++ gui programming with qt4 i found another way{create an action, populate a menu, connect the menu with button}


    Qt Code:
    1. oneAction= new QAction("do something!!", this);
    2. connect(oneAction, SIGNAL(triggered()), this, SLOT(action()));
    3. processMenu->addAction(oneAction);
    4. menuButton->setMenu(&processMenu);
    To copy to clipboard, switch view to plain text mode 

    what is the difference? between these 2 ways?
    Last edited by aegis; 31st March 2007 at 19:29.

Similar Threads

  1. Disable Checkable Button Question
    By jbpvr in forum Qt Programming
    Replies: 9
    Last Post: 20th March 2007, 17:57
  2. Mouse Over event on button
    By vishal.chauhan in forum Qt Programming
    Replies: 9
    Last Post: 10th January 2007, 05:03
  3. Button with signals and slots
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 4th December 2006, 22:24
  4. Push button double click
    By curtisw in forum Qt Programming
    Replies: 3
    Last Post: 15th February 2006, 16:40
  5. QLabel on a Button
    By cwalsh in forum Newbie
    Replies: 4
    Last Post: 12th January 2006, 16:06

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.