summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaitem.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koagendaitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp23
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
@@ -56,6 +56,20 @@ 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,
const char *name,WFlags) :
QWidget(parent, name), mIncidence(incidence), mDate(qd)
@@ -63,6 +77,7 @@ KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
#endif
+ new KOAgendaItemWhatsThis(this);
int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase
setWFlags ( wflags);
mAllDay = allday;
@@ -72,7 +87,12 @@ KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool
xPaintCoord = -1;
yPaintCoord = -1;
}
-
+QString KOAgendaItem::getWhatsThisText()
+{
+ if ( mIncidence )
+ return KIncidenceFormatter::instance()->getFormattedText( mIncidence );
+ return "KOAgendaItem::getWhatsThisText()::internal error";
+}
void KOAgendaItem::init ( Incidence *incidence, QDate qd )
{
mIncidence = incidence;
@@ -504,7 +524,6 @@ void KOAgendaItem::computeText()
}
QString tipText = mIncidence->summary();
- QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence ));
if ( !mIncidence->doesFloat() ) {
if ( mIncidence->type() == "Event" ) {
if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) {