PDA

View Full Version : Problem with connection



Adonitos
7th April 2011, 20:34
Can someone please tell me how can I connect my toolbar ACTION with some some void private slots ??? It's emergency THX

Zlatomir
7th April 2011, 20:51
And what is the problem? Be a little more specific and show some code if you have to.

You don't know how to make a connection?
Read the signal and slots documentation (http://doc.qt.nokia.com/4.7/signalsandslots.html)

Is private slots the problem?
There is no problem here, private slots are available for connection, they are only private when executed as normal member functions.
//this is somehow an incomplete answer, since the slot execution invoked by connect is done inside the object itself - but this is "Qt internals" already and the first answer is enough for most users ;)

squidge
7th April 2011, 21:20
Or maybe he means QAction, but the answer is the same, check the docs or post a smart question (http://www.catb.org/~esr/faqs/smart-questions.html)

jwjoshua
8th April 2011, 12:43
Or maybe he needs a simple example:

Try this:



connect (ui->actionName, SIGNAL(triggered()), SLOT(slotName()));

high_flyer
8th April 2011, 12:56
It's emergency THX
:rolleyes: