QTooltip on readOnly widget
I'm trying to add tooltips to a set of QLineEdit widgets that have been set to readOnly. These widgets are used for display purposes only, and only show a short cryptic mnemonic of an event. I'd like to add tooltips to these to show a more useful description of the abbreviated mnemonics, but it looks like the tooltips only show up if the QLineEdit widgets are not set as readOnly. (I'm using Qt 5.5).
I'm also hoping to be able to set these exclusively from Qt Designer.
Any help would be greatly appreciated. Thanks!
I just tried in Qt 5.13.1 on windows 10
with readonly QLineEdit and it still shows the tooltip
even when read only.
Also setting enabled to false, it still shows
So might be a bug in Qt 5.5 or it was simply changed later on.
Is there a reason you use 5.5 ?
@mrjj Yeah, I've got a suite of legacy applications, some of which use the old QWebkit, so I've been hesitant to upgrade/port to a newer version. This is for a bunch of Windows desktop applications built with mingw. Thanks.
Ok so the "revived" version
is not an option I guess.
That said the old webkit is a safety concern if the app is not purely internal.
I dont have 5.5 to test with but i wonder if you can install an event filter and
check for the QEvent::ToolTip and show it manually
like seen in
@mrjj OK, never mind... I don't know what I've done, but it seems as though the tooltips are working, without any apparent mods to the code.
Thanks for your time, though!
Yeah it does seem so.
I installed 5.5 and to my surprise the same sample did still show tooltip :)
Please mark as solved then :)