Hi
I have QCombox without items. After clicking on the combobox I would like to showmessage but I cannot find slot "Clicked" or something similar.
How to do it ?
Regards
Artur
Hi
I have QCombox without items. After clicking on the combobox I would like to showmessage but I cannot find slot "Clicked" or something similar.
How to do it ?
Regards
Artur
There is no such signal. If you want to have one, subclass, reimplement mouse events and emit such signal yourself.
... in short, add a pushButton, eish, that is just mean - lol.
No. Do as Wysota has said. The mouse event will hook clicking the combo box and emit a "clicked" signal - perhaps only sometimes (when the combo box is empty). If the combo box isn't empty, you get a signal from the clicked item.
If it is not problem please give me an example.
Thank you for help
How to do it using QMouseEvent.
How to determine that the left button of mouse was clicked on the Combobox.
Qt Code:
if(e->button() == Qt::LeftMouseButton) emit clicked(); }To copy to clipboard, switch view to plain text mode
My Code
Qt Code:
{ if (event->button()==Qt::LeftButton) emit clicked(); }To copy to clipboard, switch view to plain text mode
Should I create clicked signal ? because Now I have the following error: 'clicked' was not declared in this scope
but It is still not clear for me. The signal will be sent each time when the left button of mouse is clicked even if the pointer of mouse there is out of Combobox area.
Second question:
Is it possible to check using a method if a slot was called by signal or was called another method
for example:
I have a slot
Qt Code:
void Test:: test1 (void) { qDebug () << "TEST"; }To copy to clipboard, switch view to plain text mode
I can call it using the following code:
test();
or it can be called by signal.
I would like to know which method was used to call the slot.
Bookmarks