[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    How to check if tooltip is visible (digital clock)?
From:       "=?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?=" <zajec5 () gmail ! com>
Date:       2008-03-30 17:37:14
Message-ID: b170af450803301037r584f8bd1v89e9ed83eebcb7b4 () mail ! gmail ! com
[Download RAW message or body]

I have problem with avoiding unneeded updates of tray icon. I mainly
mean situation when user wants to have seconds displayed. It's obvious
that I use Plasma::DataEngine and connectSource(...) with
updateInterval 1 sec.

The problem is inside Clock::dataUpdated(...). Every time this method
is called I recreate Plasma::ToolTipData:
Plasma::ToolTipData tipData;
tipData.mainText = currentDate;
setToolTip(tipData);

I wish to avoid recreating tooltip and calling setToolTip when tooltip
is not visible. Problem is that I am not sure how should I check
tooltip status. My basic idea is to create internal boolean variable
like isToolTipDisplayed. I wonder how to change it's status. My ideas:

1) I can intercept event(..) and detect QEvent::ToolTip
(isToolTipDisplayed=true) and QEvent::HoverLeave
(isToolTipDisplayed=false).

2) I can use already prepared updateToolTip()
(isToolTipDisplayed=true) which allows me not filtering events in
event(). But I can't get know that tooltip disappeared so I don't know
when to change isToolTipDisplayed to false.

Is the first solution good enought to use for such a important part of
KDE as digital clock (nearly everyone use it!)? Should we implement
sth similar to updateToolTip(), let's say: toolTipRemoved()? Or maybe
someone has better idea?

-- 
Rafał Miłecki
_______________________________________________
Panel-devel mailing list
Panel-devel@kde.org
https://mail.kde.org/mailman/listinfo/panel-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic