-rw-r--r-- | korganizer/koagendaitem.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 5f9ed92..df7d612 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -58,2 +58,16 @@ QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; +class KOAgendaItemWhatsThis :public QWhatsThis +{ +public: + KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; + +protected: + virtual QString text( const QPoint& ) + { + return _view->getWhatsThisText() ; + } +private: + KOAgendaItem * _view; +}; + KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, @@ -65,2 +79,3 @@ KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool #endif + new KOAgendaItemWhatsThis(this); int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase @@ -74,3 +89,8 @@ KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool } - +QString KOAgendaItem::getWhatsThisText() +{ + if ( mIncidence ) + return KIncidenceFormatter::instance()->getFormattedText( mIncidence ); + return "KOAgendaItem::getWhatsThisText()::internal error"; +} void KOAgendaItem::init ( Incidence *incidence, QDate qd ) @@ -506,3 +526,2 @@ void KOAgendaItem::computeText() QString tipText = mIncidence->summary(); - QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence )); if ( !mIncidence->doesFloat() ) { |