-rw-r--r-- | korganizer/kodaymatrix.cpp | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 52fd1e8..4f681b3 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -23,11 +23,20 @@ */ #include <qevent.h> #include <qpainter.h> -#include <qptrlist.h> +#include <q3ptrlist.h> #include <qtimer.h> -#include <qwhatsthis.h> +#include <q3whatsthis.h> +//Added by qt3to4: +#include <QDragLeaveEvent> +#include <Q3Frame> +#include <QDragEnterEvent> +#include <QDragMoveEvent> +#include <QDropEvent> +#include <QResizeEvent> +#include <QMouseEvent> +#include <QPaintEvent> #include <kglobal.h> #include <kdebug.h> #include <klocale.h> @@ -53,17 +62,17 @@ // D Y N A M I C T I P // ============================================================================ DynamicTip::DynamicTip( QWidget * parent ) - : QToolTip( parent ) + /* TODO:hacker: : QToolTip( parent ) */ { matrix = (KODayMatrix*)parent; } -class KODaymatrixWhatsThis :public QWhatsThis +class KODaymatrixWhatsThis :public Q3WhatsThis { public: - KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;}; + KODaymatrixWhatsThis( KODayMatrix* view ) : Q3WhatsThis( view ),_view (view) { ;}; ~KODaymatrixWhatsThis() { ; }; protected: virtual QString text( const QPoint& p ) @@ -90,9 +99,9 @@ void DynamicTip::maybeTip( const QPoint &pos ) //show holiday names only QString str = matrix->getHolidayLabel(col+row*7); if (str.isEmpty()) return; - tip(rct, str); + /* TODO:hacker: tip(rct, str);*/ } // ============================================================================ @@ -102,9 +111,9 @@ void DynamicTip::maybeTip( const QPoint &pos ) const int KODayMatrix::NOSELECTION = -1000; const int KODayMatrix::NUMDAYS = 42; KODayMatrix::KODayMatrix( QWidget *parent, const char *name ) - : QFrame( parent, name , Qt::WRepaintNoErase ), mCalendar( 0 ) + : Q3Frame( parent, name , Qt::WNoAutoErase ), mCalendar( 0 ) { mLastView = -1; @@ -150,9 +159,9 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) int tmp = getDayIndexFrom(p.x(), p.y()); if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar ) return QString(); QDate mDate = days[tmp]; - QPtrList<Event> eventlist = mCalendar->events(mDate); + Q3PtrList<Event> eventlist = mCalendar->events(mDate); Event *event; QStringList mToolTip; for(event=eventlist.first();event != 0;event=eventlist.next()) { QString mToolTipText; @@ -204,9 +213,9 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) mToolTip.append( deTag( mToolTipText ) ); } mToolTip.sort(); if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { - QPtrList<Todo> todolist = mCalendar->todos(mDate); + Q3PtrList<Todo> todolist = mCalendar->todos(mDate); Todo *todo; for(todo=todolist.first();todo != 0;todo=todolist.next()) { QString mToolTipText; if ( !todo->doesFloat() ) @@ -219,9 +228,9 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) mToolTip.append( mToolTipText ); } } if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { - QPtrList<Journal> j_list = mCalendar->journals4Date( mDate ); + Q3PtrList<Journal> j_list = mCalendar->journals4Date( mDate ); Journal *j = j_list.first(); while ( j ) { QString mToolTipText; if ( !j->summary().isEmpty() ) { @@ -440,9 +449,9 @@ void KODayMatrix::updateViewTimed() int i; int timeSpan = NUMDAYS-1; - QPtrList<Event> events = mCalendar->events(); + Q3PtrList<Event> events = mCalendar->events(); Event *event; QDateTime dt; bool ok; bDays.fill( false); @@ -525,9 +534,9 @@ void KODayMatrix::updateViewTimed() } if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { bDays.fill( false); // insert due todos - QPtrList<Todo> todos = mCalendar->todos( ); + Q3PtrList<Todo> todos = mCalendar->todos( ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { //insertTodo( todo ); if ( todo->hasDueDate() ) { @@ -550,9 +559,9 @@ void KODayMatrix::updateViewTimed() } if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { bDays.fill( false); // insert due todos - QPtrList<Journal> todos = mCalendar->journals( ); + Q3PtrList<Journal> todos = mCalendar->journals( ); Journal *todo; for(todo = todos.first(); todo; todo = todos.next()) { int day = mStartDate.daysTo( todo->dtStart().date() ); if ( day >= 0 && day < timeSpan + 1) { @@ -574,9 +583,9 @@ void KODayMatrix::updateViewTimed() #else //qDebug("KODayMatrix::updateViewTimed "); for(int i = 0; i < NUMDAYS; i++) { // if events are set for the day then remember to draw it bold - QPtrList<Event> eventlist = mCalendar->events(days[i]); + Q3PtrList<Event> eventlist = mCalendar->events(days[i]); Event *event; int numEvents = eventlist.count(); QString holiStr = ""; bDays.clearBit(i); @@ -674,9 +683,9 @@ void KODayMatrix::updateEvents() if ( !mCalendar ) return; for( int i = 0; i < NUMDAYS; i++ ) { // if events are set for the day then remember to draw it bold - QPtrList<Event> eventlist = mCalendar->events( days[ i ] ); + Q3PtrList<Event> eventlist = mCalendar->events( days[ i ] ); int numEvents = eventlist.count(); Event *event; for( event = eventlist.first(); event != 0;event=eventlist.next()) { ushort recurType = event->doesRecur(); @@ -738,9 +747,9 @@ int KODayMatrix::getDayIndexFrom(int x, int y) void KODayMatrix::mousePressEvent (QMouseEvent* e) { - if ( e->button() == LeftButton ) + if ( e->button() == Qt::LeftButton ) mouseDown = true; mSelStart = getDayIndexFrom(e->x(), e->y()); if (mSelStart > NUMDAYS-1) mSelStart=NUMDAYS-1; mSelInit = mSelStart; @@ -751,9 +760,9 @@ void KODayMatrix::mousePressEvent (QMouseEvent* e) void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) { mRedrawNeeded = true; - if ( e->button() == LeftButton ) + if ( e->button() == Qt::LeftButton ) if ( ! mouseDown ) { return; } else @@ -1194,9 +1203,9 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) } else { //qDebug("NO redraw "); } - bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,CopyROP); + bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,QPainter::CompositionMode_Source); mRedrawNeeded = false; } // ---------------------------------------------------------------------------- @@ -1207,9 +1216,9 @@ void KODayMatrix::resizeEvent(QResizeEvent * e) { QRect sz = frameRect(); daysize.setHeight(sz.height()*7 / NUMDAYS); daysize.setWidth(sz.width() / 7); - QFrame::resizeEvent( e ); + Q3Frame::resizeEvent( e ); } QSize KODayMatrix::sizeHint() const { |