summaryrefslogtreecommitdiffabout
path: root/korganizer/kodaymatrix.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kodaymatrix.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp47
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
@@ -21,15 +21,24 @@
with any edition of Qt, and distribute the resulting executable,
without including the source ode for Qt in the source distribution.
*/
#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>
#include <libkcal/vcaldrag.h>
@@ -51,21 +60,21 @@
// ============================================================================
// 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 )
{
return _view->getWhatsThisText( p ) ;
@@ -88,25 +97,25 @@ void DynamicTip::maybeTip( const QPoint &pos )
// kdDebug() << "DynamicTip::maybeTip matrix cell index [" <<
// col << "][" << row << "] => " <<(col+row*7) << endl;
//show holiday names only
QString str = matrix->getHolidayLabel(col+row*7);
if (str.isEmpty()) return;
- tip(rct, str);
+ /* TODO:hacker: tip(rct, str);*/
}
// ============================================================================
// K O D A Y M A T R I X
// ============================================================================
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;
oldW = 0;
oldH = 0;
@@ -148,13 +157,13 @@ 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;
QString text;
int multiday = 0;// 1 = start, 2 = midddle, 3 = end day
@@ -202,13 +211,13 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
mToolTipText += " (" + event->location() + ")";
//qDebug("TTT: %s ", mToolTipText.latin1());
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() )
mToolTipText += KGlobal::locale()->formatTime(todo->dtDue().time())+" ";
mToolTipText += todo->summary();
@@ -217,13 +226,13 @@ QString KODayMatrix::getWhatsThisText( QPoint p )
mToolTipText = deTag( mToolTipText);
mToolTipText = "<b>" + i18n("Todo: ") + "</b>"+ mToolTipText;
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() ) {
mToolTipText = j->summary().left(30);
if ( j->summary().length() > 30 )
@@ -438,13 +447,13 @@ void KODayMatrix::updateViewTimed()
}
#if 1
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);
pDays.fill( false);
hDays.fill( false);
@@ -523,13 +532,13 @@ void KODayMatrix::updateViewTimed()
pDays.setBit(i);
}
}
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() ) {
int day = mStartDate.daysTo( todo->dtDue().date() );
if ( day >= 0 && day < timeSpan + 1) {
@@ -548,13 +557,13 @@ 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) {
int i = day;
QString holiStr = mHolidays[i];
@@ -572,13 +581,13 @@ 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);
hDays.clearBit(i);
eDays.clearBit(i);
@@ -672,13 +681,13 @@ void KODayMatrix::updateView(QDate actdate)
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();
if ( ( recurType == Recurrence::rDaily &&
@@ -736,26 +745,26 @@ int KODayMatrix::getDayIndexFrom(int x, int y)
// M O U S E E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
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;
mSelEnd = mSelStart;
mRedrawNeeded = true;
repaint(false);
}
void KODayMatrix::mouseReleaseEvent (QMouseEvent* e)
{
mRedrawNeeded = true;
- if ( e->button() == LeftButton )
+ if ( e->button() == Qt::LeftButton )
if ( ! mouseDown ) {
return;
}
else
mouseDown = false;
int tmp = getDayIndexFrom(e->x(), e->y());
@@ -1192,26 +1201,26 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
p.setPen(mDefaultTextColor);
p.drawRect(0, 0, width(), height());
} 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;
}
// ----------------------------------------------------------------------------
// R E SI Z E E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
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
{
QFontMetrics fm ( font() );