summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoviewitem.cpp
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/kotodoviewitem.cpp
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoviewitem.cpp42
1 files changed, 23 insertions, 19 deletions
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 <klocale.h>
#include <kdebug.h>
-#include <qapp.h>
+#include <qapplication.h>
+#include <QDesktopWidget>
+//Added by qt3to4:
+#include <Q3PointArray>
+#include <QPixmap>
#include <kglobal.h>
#include <kiconloader.h>
@@ -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<KOTodoViewItem*>(myChild))->stateChange(state);
}
@@ -383,12 +387,12 @@ bool KOTodoViewItem::isAlternate()
{
KOTodoViewItem *item;
bool previous = true;
- if (QListViewItem::parent())
+ if (Q3ListViewItem::parent())
{
- item = static_cast<KOTodoViewItem *>(QListViewItem::parent());
+ item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent());
if (item)
previous = item->m_odd;
- item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild());
+ item = static_cast<KOTodoViewItem *>(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 )