How to link label with push Button
-
Hi i am new to Qt and my question is i want to link my label with push button. For example: i have taken a label and set an image on it,now i want that when i click on the label my push button should get enable and before that it should be disable.
And also i want to make my label clickable.
please anybody help me out with this with a proper example so that it will be easier for me to understand.
Thank You in advance. -
Hi,
There are 2 ways for making it clickable:
-
If you have subclassed the QLabel, override "mouseReleaseEvent":http://qt-project.org/doc/qt-5/qwidget.html#mouseReleaseEvent of your Label.
-
If not subclassed then use "eventFilter":http://qt-project.org/doc/qt-4.8/qobject.html#eventFilter method.
-
-
OK so you want to make your label clickable..
see
https://qt-project.org/wiki/Make-a-QLabel-Clickablehope it helps !!