korganizer
koincidencetooltip.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <libkcal/incidence.h>
00026 #include <libkcal/incidenceformatter.h>
00027
00028 #include "koincidencetooltip.h"
00029 #include "koagendaitem.h"
00030
00036 void KOIncidenceToolTip::add ( QWidget * widget, Incidence *incidence,
00037 QToolTipGroup * group, const QString & longText )
00038 {
00039 if ( !widget || !incidence ) return;
00040 QToolTip::add(widget, IncidenceFormatter::toolTipString( incidence ), group, longText);
00041 }
00042
00043 void KOIncidenceToolTip::add(KOAgendaItem * item, Incidence * incidence, QToolTipGroup * group)
00044 {
00045 Q_UNUSED( incidence );
00046 Q_UNUSED( group );
00047 QToolTip::remove( item );
00048 new KOIncidenceToolTip( item );
00049 }
00050
00051 void KOIncidenceToolTip::maybeTip(const QPoint & pos)
00052 {
00053 Q_UNUSED( pos );
00054 KOAgendaItem *item = dynamic_cast<KOAgendaItem*>( parentWidget() );
00055 if ( !item )
00056 return;
00057 if ( mText.isEmpty() )
00058 mText = IncidenceFormatter::toolTipString( item->incidence() );
00059 tip( QRect( QPoint( 0, 0 ), item->size() ), mText );
00060 }
|