The QFileDialog::getSaveFileName() static method invoke a modal dialog, so the button loses focus. As a result, it never sees the mouse up event.
What you are doing is very non-standard behavior for a push button. Whoever is making this "specific requirement" does not seem to know much about accepted practice for user interaction.
In any case, you can send the button an event after your dialog method returns to force it back to an unpressed state:
QMouseEvent event( QEvent::MouseButtonRelease, pos, 0, 0, 0 );
QApplication::sendEvent( button, &event );
To copy to clipboard, switch view to plain text mode
Bookmarks