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/kotodoviewitem.cpp') diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index 519bb16..c21816d 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -19,7 +19,11 @@ #include #include -#include +#include +#include +//Added by qt3to4: +#include +#include #include #include @@ -27,14 +31,14 @@ #include "kotodoview.h" #include "koprefs.h" -KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) - : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) +KOTodoViewItem::KOTodoViewItem( Q3ListView *parent, Todo *todo, KOTodoView *kotodo) + : Q3CheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) { construct(); } KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) - : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) + : Q3CheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) { construct(); } @@ -80,7 +84,7 @@ void KOTodoViewItem::setSortKey(int column,const QString &key) void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, int y,int h) { - QListViewItem::paintBranches(p,cg,w,y,h); + Q3ListViewItem::paintBranches(p,cg,w,y,h); } #else #endif @@ -316,7 +320,7 @@ void KOTodoViewItem::stateChange(bool state) else setSortKey(2,QString::number(99)); } if ( state ) { - QListViewItem * myChild = firstChild(); + Q3ListViewItem * myChild = firstChild(); KOTodoViewItem *item; while( myChild ) { //qDebug("stateCH "); @@ -325,7 +329,7 @@ void KOTodoViewItem::stateChange(bool state) myChild = myChild->nextSibling(); } } else { - QListViewItem * myChild = parent(); + Q3ListViewItem * myChild = parent(); if ( myChild ) (static_cast(myChild))->stateChange(state); } @@ -383,12 +387,12 @@ bool KOTodoViewItem::isAlternate() { KOTodoViewItem *item; bool previous = true; - if (QListViewItem::parent()) + if (Q3ListViewItem::parent()) { - item = static_cast(QListViewItem::parent()); + item = static_cast(Q3ListViewItem::parent()); if (item) previous = item->m_odd; - item = static_cast(QListViewItem::parent()->firstChild()); + item = static_cast(Q3ListViewItem::parent()->firstChild()); } else { @@ -476,13 +480,13 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i // p->setBrush( KOPrefs::instance()->mHighlightColorKGlobalSettings::baseColor() ); //filling QColor fc = KOPrefs::instance()->mHighlightColor; if ( mTodo->percentComplete() == 100 ) - fc = darkGreen; + fc = Qt::darkGreen; p->drawRect( 2, 2, width-4, height()-4); p->fillRect( 3, 3, progress, height()-6, fc ); p->restore(); } else { - QCheckListItem::paintCell(p, _cg, column, width, alignment); + Q3CheckListItem::paintCell(p, _cg, column, width, alignment); } return; } @@ -494,12 +498,12 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); - QListView *lv = listView(); + Q3ListView *lv = listView(); if ( !lv ) return; int marg = 2;//lv->itemMargin(); int r = 0; - QCheckListItem::Type myType = QCheckListItem::CheckBox; + Q3CheckListItem::Type myType = Q3CheckListItem::CheckBox; int BoxSize = 20; int boxOffset = 2; int xOffset = 2; @@ -522,7 +526,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i if ( !pixmap( 0 ) ) r += BoxSize + 4; } else { - ASSERT( lv ); //### + Q_ASSERT( lv ); //### // QFontMetrics fm( lv->font() ); // int d = fm.height(); int x = 0; @@ -539,7 +543,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i x++; y++; if ( isOn() ) { - QPointArray a( 7*2 ); + Q3PointArray a( 7*2 ); int i, xx, yy; xx = x+xOffset+marg+(boxOffset/2); yy = y+5+boxOffset; @@ -555,7 +559,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i a.setPoint( 2*i+1, xx, yy+2 ); xx++; yy--; } - p->setPen( darkGreen ); + p->setPen( Qt::darkGreen ); p->drawLineSegments( a ); } //////////////////////// @@ -565,9 +569,9 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i p->translate( r, 0 ); p->setPen( QPen( _cg.text() ) ); - QListViewItem::paintCell( p, _cg, column, width - r, align ); + Q3ListViewItem::paintCell( p, _cg, column, width - r, align ); if ( mTodo->cancelled () ) { - p->setPen( black ); + p->setPen( Qt::black ); QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); int wid = br.width() +lineStart; if ( wid > width-3 ) -- cgit v0.9.0.2