From a08aff328d4393031d5ba7d622c2b05705a89d73 Mon Sep 17 00:00:00 2001 From: Michael Krelin Date: Wed, 04 Jul 2007 11:23:42 +0000 Subject: initial public commit of qt4 port --- (limited to 'korganizer/kodaymatrix.cpp') diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 52fd1e8..4f681b3 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -24,9 +24,18 @@ #include #include -#include +#include #include -#include +#include +//Added by qt3to4: +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -54,15 +63,15 @@ // ============================================================================ 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: @@ -91,7 +100,7 @@ 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);*/ } @@ -103,7 +112,7 @@ 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 ) { @@ -151,7 +160,7 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar ) return QString(); QDate mDate = days[tmp]; - QPtrList eventlist = mCalendar->events(mDate); + Q3PtrList eventlist = mCalendar->events(mDate); Event *event; QStringList mToolTip; for(event=eventlist.first();event != 0;event=eventlist.next()) { @@ -205,7 +214,7 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) } mToolTip.sort(); if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { - QPtrList todolist = mCalendar->todos(mDate); + Q3PtrList todolist = mCalendar->todos(mDate); Todo *todo; for(todo=todolist.first();todo != 0;todo=todolist.next()) { QString mToolTipText; @@ -220,7 +229,7 @@ QString KODayMatrix::getWhatsThisText( QPoint p ) } } if (KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { - QPtrList j_list = mCalendar->journals4Date( mDate ); + Q3PtrList j_list = mCalendar->journals4Date( mDate ); Journal *j = j_list.first(); while ( j ) { QString mToolTipText; @@ -441,7 +450,7 @@ void KODayMatrix::updateViewTimed() int i; int timeSpan = NUMDAYS-1; - QPtrList events = mCalendar->events(); + Q3PtrList events = mCalendar->events(); Event *event; QDateTime dt; bool ok; @@ -526,7 +535,7 @@ void KODayMatrix::updateViewTimed() if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) { bDays.fill( false); // insert due todos - QPtrList todos = mCalendar->todos( ); + Q3PtrList todos = mCalendar->todos( ); Todo *todo; for(todo = todos.first(); todo; todo = todos.next()) { //insertTodo( todo ); @@ -551,7 +560,7 @@ void KODayMatrix::updateViewTimed() if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) { bDays.fill( false); // insert due todos - QPtrList todos = mCalendar->journals( ); + Q3PtrList todos = mCalendar->journals( ); Journal *todo; for(todo = todos.first(); todo; todo = todos.next()) { int day = mStartDate.daysTo( todo->dtStart().date() ); @@ -575,7 +584,7 @@ void KODayMatrix::updateViewTimed() //qDebug("KODayMatrix::updateViewTimed "); for(int i = 0; i < NUMDAYS; i++) { // if events are set for the day then remember to draw it bold - QPtrList eventlist = mCalendar->events(days[i]); + Q3PtrList eventlist = mCalendar->events(days[i]); Event *event; int numEvents = eventlist.count(); QString holiStr = ""; @@ -675,7 +684,7 @@ void KODayMatrix::updateEvents() for( int i = 0; i < NUMDAYS; i++ ) { // if events are set for the day then remember to draw it bold - QPtrList eventlist = mCalendar->events( days[ i ] ); + Q3PtrList eventlist = mCalendar->events( days[ i ] ); int numEvents = eventlist.count(); Event *event; for( event = eventlist.first(); event != 0;event=eventlist.next()) { @@ -739,7 +748,7 @@ 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; @@ -752,7 +761,7 @@ void KODayMatrix::mousePressEvent (QMouseEvent* e) void KODayMatrix::mouseReleaseEvent (QMouseEvent* e) { mRedrawNeeded = true; - if ( e->button() == LeftButton ) + if ( e->button() == Qt::LeftButton ) if ( ! mouseDown ) { return; } @@ -1195,7 +1204,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) //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; } @@ -1208,7 +1217,7 @@ 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 -- cgit v0.9.0.2