Skip to content

QToolButton: reimplement the fix for QTBUG-95255

The code in 188d7394 uses a connect() to a lambda, passing UniqueConnection to avoid establishing the connection more than once. The problem is that UniqueConnection does not work with lambdas; it works only with "regular" PMFs to QObject subclasses.

Re-do the same fix, but without a connection: use the checkStateSet() virtual from the base class that will notify us if setChecked() is being called on the tool button, and from there synchronize the state of the default action.

Change-Id: Id512812c562cd6d20bc1a489753b33c269919d32 Fixes: QTBUG-95255 Pick-to: 6.2 6.1 Reviewed-by: Volker Hilsheimer volker.hilsheimer@qt.io

(part cherry-picked from c9830c2f)

Edited by Marco Martin

Merge request reports