简体   繁体   中英

QPushButton show/hide based on Mouse over event

I have one question regarding the QPushButton.

i want the QPushButton behaviour in such a way that it should be shown only when the focus is there on QPushButton, and when the focus is out then it should hide. Below is the image that have "View" button, it displayed only when the focus is there on the QPushButton.

在此处输入图片说明

Thanks, Neel

Subclass QWidget.

Create a QPushButton member.

Override the QWidget::enterEvent and QWidget::leaveEvent protected methods to show / hide the QPushButton.

Override the QWidget::resizeEvent to resize the QPushButton.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM