Results 1 to 2 of 2

Thread: how i give action to button ? (qt+visual c++)

  1. #1
    Join Date
    Apr 2012
    Posts
    101
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default how i give action to button ? (qt+visual c++)

    Hi everybody
    i want to use qt in visual c++(it's my first application in qt)
    i integrate it , and i create new qt application , i modifate my project.ui where i add widget ,buton ,...
    but i do not know where i change the action of buton (where i give to this button a action )
    any idea ?
    (sory for my langage l'english is not my native langage)

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how i give action to button ? (qt+visual c++)

    To literally give button an action use ui->your_button_name->setAction(),
    but what I think you need is
    Qt Code:
    1. connect( ui->your_button_name, SIGNAL( clicked() ), target_object_ie_this, SLOT( name_of_target_slot() ) )
    To copy to clipboard, switch view to plain text mode 

    I would advise to familiarize yourself with Signals & Slots

Similar Threads

  1. Action using Push Button ?
    By steve.bush in forum Newbie
    Replies: 7
    Last Post: 25th February 2016, 15:36
  2. what should I give url?
    By sups in forum Qt Programming
    Replies: 1
    Last Post: 20th February 2011, 23:22
  3. [QT]Push button-no action
    By nqn in forum Newbie
    Replies: 4
    Last Post: 30th May 2010, 19:08
  4. Action-Menu-Button
    By hgedek in forum Newbie
    Replies: 1
    Last Post: 1st October 2007, 16:41
  5. No action checked in an exclusive action group
    By SkripT in forum Qt Programming
    Replies: 12
    Last Post: 13th February 2006, 06:19

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.