Qt which button was clicked




















Add a comment. Active Oldest Votes. Improve this answer. Thank you very good idea. But, my play function is a slot that doesn't take an argument. So, how can I do this thing with my play function? Kuba hasn't forgotten Monica Kuba hasn't forgotten Monica Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.

After creation the icon can be changed using setIcon To get the current icon of the button use icon. To set the position and the size of the button use setGeometry. If you want just to modify the size of the button use resize. QPushButton emits signals if an event occurs. To handle the button connect its appropriate signal to a slot:. To copy to clipboard, switch view to plain text mode. Qt Code: Switch view. Re: How to checked if button is clicked Can you give a simple example?? Added after 5 minutes:.

Re: How to checked if button is clicked Here is the simple example:- widget. QWidget parent. QApplication a argc, argv ;.

Widget w;. To label the button, we pass a python string to the constructor:. There are two ways of doing this; using the old style or the new style, which is more pythonic. You can find more information about both these styles in the Signals and Slots in PySide6 wiki page.

The QPushButton has a predefined signal called clicked , which is triggered every time the button is clicked.



0コメント

  • 1000 / 1000