-rw-r--r-- | korganizer/kolistview.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index b21b419..732fc46 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -34,2 +34,3 @@ #include <qdir.h> +#include <qwhatsthis.h> #include <qregexp.h> @@ -49,2 +50,3 @@ #include <libkdepim/categoryselectdialog.h> +#include <libkcal/kincidenceformatter.h> #ifndef DESKTOP_VERSION @@ -64,2 +66,19 @@ + +class KOListViewWhatsThis :public QWhatsThis +{ +public: + KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; + +protected: + virtual QString text( const QPoint& p) + { + return _view->getWhatsThisText(p) ; + } +private: + QWidget* _wid; + KOListView * _view; +}; + + ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) @@ -226,2 +245,3 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, mListView->setColumnWidthMode(10, QListView::Manual); + new KOListViewWhatsThis(mListView->viewport(),this); @@ -297,2 +317,10 @@ KOListView::~KOListView() } +QString KOListView::getWhatsThisText(QPoint p) +{ + KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p ); + if ( item ) + return KIncidenceFormatter::instance()->getFormattedText( item->data() ); + return i18n("That is the list view" ); + +} |