KF6 porting. KSelectAction::triggered signal

Sune Vuorela nospam at vuorela.dk
Wed Jan 3 08:01:11 GMT 2024


Hi

I just - during KF6 porting of an app - fall in an api trap:

Original code:

| connect(d->aZoom, QOverload<QAction *>::of(&KSelectAction::triggered),
| this, &PageView::slotZoom);

The wrong porting code:

| connect(d->aZoom, &KSelectAction::triggered,  this, &PageView::slotZoom);

The gotcha is that the QAction* overload, while with the same name, is
emitted under different rules than the only remaining triggered function
(from QAction)

The correct porting would have been:

| connect(d->aZoom, &KSelectAction::actionTriggered, this,
| &PageView::slotZoom);


So, just a heads up to whomever might hit this as well. (I wonder if one
has enough sources checked out to be able to grep this to see what might
be relevant.

/Sune



More information about the kde-devel mailing list