How can i get QAction or QPushButton name
I have a QDialog ,and I add three QWidget to the QDialog,
and I add some QPushButton and QAction to the QWidget,
now I want to get the name of QPushButton where the mouse curser is.
I used childeAt(event->pos()) at mouseMoveEvent(),But i just get the QWidget name ,i can't get the name of the QPushwButton.
Re: How can i get QAction or QPushButton name
Cast the childAt widget into QPushButton and see if u get the proper name.
What are u trying to achieve by the way, and can u share some code of what u have tried ?
Re: How can i get QAction or QPushButton name
Thank you !
I want to know the button name and set the button setChecked(true) whick is under the pos()
Re: How can i get QAction or QPushButton name
Doesn't the button handle press/release events out of the box? :) It toggles between checked and unchecked if you make it checkable... Why do you want the dialog to handle that?
Re: How can i get QAction or QPushButton name
I want the button is setChecked(true) when the button under the mouse,
and setChecked(false) when the mouse out side the button.
Re: How can i get QAction or QPushButton name
And what do u want to do when the button is checked ??
You may better look at QWidget::enterEvent and QWidget::leaveEvent