Basic QPushButton keyboard shortcut test fails under KDE session
David Edmundson
david at davidedmundson.co.uk
Thu May 12 20:51:01 UTC 2016
As with most bugs it's two people doing something a slightly wrong that
makes something actually wrong.
The documentation explitcitly says:
>shortcut : QKeySequence
>This property holds the _*mnemonic*_ associated with the button.
(emphasis mine)
http://doc.qt.io/qt-5/qabstractbutton.html#shortcut-prop
Your code isn't setting it to the mnemonic. It's setting it to something
unrelated.
So even though it seems to work /technically/ you're going against the
documentation.
Regardless of whether KDE code existed or not, you'd still have a bug if
you ever call setText later with a mnemonic or switched languages.
> So consider me sceptical to the way it now affects everything :)
So consider me equally sceptical that we have any duty to fix it :)
I tried to change qabstractbutton to have two shortcuts, but the problem
there is I potentially change the behaviour of the
QAbstractButton::shortcut accessor. Any thoughts on how to avoid that?
If we did want to make our code affect only KDE apps we could potentially
check the qApp->organisationDomain? KDE people - would that work?
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20160512/2bec7303/attachment.html>
More information about the Plasma-devel
mailing list