Qt-jambi-interest Archive, February 2008
Problem with QCalendarWidget and Tooltips
Message 1 in thread
I am trying to have a custom colored background day in
a QCalendarWidget that will show a tooltip when mouse
is moved over it. Here is the code I'm using:
QTextCharFormat fmt = new QTextCharFormat();
QBrush brBg = new QBrush();
brBg.setColor( QColor.green );
fmt.setBackground( brBg );
fmt.setToolTip( "My Tooltip" );
ui.calendarWidget.setDateTextFormat( dt, fmt );
The background of the date changes to green, however
the tooltip is never shown... Any idea on how to make
the tooltip work ? Is this a bug in QCalendarWidget ?
Thanks,
Danny
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
Message 2 in thread
Hi, Danny.
Danny Sporea wrote:
> The background of the date changes to green, however
> the tooltip is never shown... Any idea on how to make
> the tooltip work ? Is this a bug in QCalendarWidget ?
>
It is indeed a omission in QCalendarWidget. It will be fixed for Qt
Jambi 4.4 (and also for Qt 4.4.)
Unfortunately there is no work around that I can think of right now,
other than patching Qt itself and building everything from source,
because the problem is in the internal model. If you wish to do this,
however, let me know and I can e-mail you the patch.
-- Eskil