Four signals of QPushButton: pressed (), clicked (), released (), toggled ()

This article is reproduced from: https://blog.csdn.net/weixin_43742643/article/details/101706477

  • pressed (): triggered when the mouse is pressed. The corresponding function is mousePressEvent ().
  • clicked (): Fired when the mouse is released. If the mouse is dragged outside the button area to release, it will not trigger. The corresponding function is mouseReleaseEvent (). Generally, this signal is used when the connect slot function.
  • released (): triggered when the mouse is released. It will trigger even if the mouse is dragged outside the button area. The corresponding function is mouseReleaseEvent ().
  • Under normal circumstances, click the button, the response sequence is: pressed () ---- about 215ms ---- released () ---- almost 0ms ---- clicked ().
  • toggled (): SetSetCheckable (true) and then click the button to trigger this signal. Generally used for multiple buttons to form QButtonGroup and setExclusive (true).


Copyright statement: This article is an original article of CSDN blogger "hAnjiaLE1998", which follows the CC 4.0 BY-SA copyright agreement. Please attach the original source link and this statement for reprint.
Original link: https://blog.csdn.net/weixin_43742643/article/details/101706477


 

Guess you like

Origin www.cnblogs.com/sggggr/p/12674878.html