PDA

View Full Version : how i give action to button ? (qt+visual c++)



rimie23
12th April 2012, 11:48
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)

Spitfire
13th April 2012, 09:05
To literally give button an action use ui->your_button_name->setAction(),
but what I think you need is
connect( ui->your_button_name, SIGNAL( clicked() ), target_object_ie_this, SLOT( name_of_target_slot() ) )

I would advise to familiarize yourself with Signals & Slots (http://doc.qt.nokia.com/4.7-snapshot/signalsandslots.html)