KConfigXT Support for ToolTips?
Jeff Mitchell
kde-dev at emailgoeshere.com
Sat Apr 5 03:29:05 BST 2008
Louai Al-Khanji wrote:
> On Saturday 05 April 2008 02:35:03 Allen Winter wrote:
>> Howdy,
>>
>> I noticed that a <whatsthis> element is supported in *.kcfg files
>> but <tooltip> is not.
>>
>> Why? Is it possible and a good idea to add tooltips?
>
> Does whatsthis actually work? I tried using it a while ago after finding it
> but it seemed broken. I haven't yet had the time to look into it further,
> might be pebcak.
>
It works. Here's an example:
QLabel* m_label_details = new QLabel( "<qt>(<a href='details'>" + i18n(
"Details" ) + "</a>)</qt>", this ); //clickable label to show whatsthis
m_label_details->setTextInteractionFlags( Qt::LinksAccessibleByMouse |
Qt::LinksAccessibleByKeyboard ); //make it actually clickable...important!
connect( m_label_details, SIGNAL( linkActivated(const QString &) ),
this, SLOT( slotDetailsActivated(const QString &) ) );
m_details = QString( "<em>%1</em><br />" "<table>%2</table>" ).arg(
title, table ); //title and table are html
and in slotDetailsActivated:
QWhatsThis::showText( QCursor::pos(), "<qt>" + m_details + "</qt>",
Amarok::mainWindow() );
<qt> is actually a synonym for <html> IIRC, and yes, it's redundant there.
--Jeff
More information about the kde-core-devel
mailing list