Qt 6.11 is out! See what's new in the release
blog
Force QPushButton release
General and Desktop
3
Posts
2
Posters
5.7k
Views
1
Watching
-
Hi all,
I have a QPushButton and 2 connection to its signal pressed and released:@
connect(button, SIGNAL(pressed()), this, SLOT(button_pressed()));
connect(button, SIGNAL(released()), this, SLOT(button_released()));
@then I have a timer that sometimes disable the button.
If I press the button and it become disabled I need to call button_released().
I need something like this:
@
connect(button, SIGNAL(disabled()), this, SLOT(button_released()));
@but button hasn't "disabled" signal.
-
What about to handle it in your timer, like this?
@
button->setEnabled(false);
if(button->isDown()) {
button->setDown(false);
button_released(); // or maybe emit released if you are in button subclass?
}
@