Diffstat (limited to 'korganizer/kotodoviewitem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 42 |
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 | |||
@@ -20,5 +20,9 @@ | |||
20 | #include <klocale.h> | 20 | #include <klocale.h> |
21 | #include <kdebug.h> | 21 | #include <kdebug.h> |
22 | #include <qapp.h> | 22 | #include <qapplication.h> |
23 | #include <QDesktopWidget> | ||
24 | //Added by qt3to4: | ||
25 | #include <Q3PointArray> | ||
26 | #include <QPixmap> | ||
23 | #include <kglobal.h> | 27 | #include <kglobal.h> |
24 | 28 | ||
@@ -28,6 +32,6 @@ | |||
28 | #include "koprefs.h" | 32 | #include "koprefs.h" |
29 | 33 | ||
30 | KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) | 34 | KOTodoViewItem::KOTodoViewItem( Q3ListView *parent, Todo *todo, KOTodoView *kotodo) |
31 | : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) | 35 | : Q3CheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) |
32 | { | 36 | { |
33 | construct(); | 37 | construct(); |
@@ -35,5 +39,5 @@ KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotod | |||
35 | 39 | ||
36 | KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) | 40 | KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) |
37 | : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) | 41 | : Q3CheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) |
38 | { | 42 | { |
39 | construct(); | 43 | construct(); |
@@ -81,5 +85,5 @@ void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, | |||
81 | int y,int h) | 85 | int y,int h) |
82 | { | 86 | { |
83 | QListViewItem::paintBranches(p,cg,w,y,h); | 87 | Q3ListViewItem::paintBranches(p,cg,w,y,h); |
84 | } | 88 | } |
85 | #else | 89 | #else |
@@ -317,5 +321,5 @@ void KOTodoViewItem::stateChange(bool state) | |||
317 | } | 321 | } |
318 | if ( state ) { | 322 | if ( state ) { |
319 | QListViewItem * myChild = firstChild(); | 323 | Q3ListViewItem * myChild = firstChild(); |
320 | KOTodoViewItem *item; | 324 | KOTodoViewItem *item; |
321 | while( myChild ) { | 325 | while( myChild ) { |
@@ -326,5 +330,5 @@ void KOTodoViewItem::stateChange(bool state) | |||
326 | } | 330 | } |
327 | } else { | 331 | } else { |
328 | QListViewItem * myChild = parent(); | 332 | Q3ListViewItem * myChild = parent(); |
329 | if ( myChild ) | 333 | if ( myChild ) |
330 | (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); | 334 | (static_cast<KOTodoViewItem*>(myChild))->stateChange(state); |
@@ -384,10 +388,10 @@ bool KOTodoViewItem::isAlternate() | |||
384 | KOTodoViewItem *item; | 388 | KOTodoViewItem *item; |
385 | bool previous = true; | 389 | bool previous = true; |
386 | if (QListViewItem::parent()) | 390 | if (Q3ListViewItem::parent()) |
387 | { | 391 | { |
388 | item = static_cast<KOTodoViewItem *>(QListViewItem::parent()); | 392 | item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent()); |
389 | if (item) | 393 | if (item) |
390 | previous = item->m_odd; | 394 | previous = item->m_odd; |
391 | item = static_cast<KOTodoViewItem *>(QListViewItem::parent()->firstChild()); | 395 | item = static_cast<KOTodoViewItem *>(Q3ListViewItem::parent()->firstChild()); |
392 | } | 396 | } |
393 | else | 397 | else |
@@ -477,5 +481,5 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
477 | QColor fc = KOPrefs::instance()->mHighlightColor; | 481 | QColor fc = KOPrefs::instance()->mHighlightColor; |
478 | if ( mTodo->percentComplete() == 100 ) | 482 | if ( mTodo->percentComplete() == 100 ) |
479 | fc = darkGreen; | 483 | fc = Qt::darkGreen; |
480 | p->drawRect( 2, 2, width-4, height()-4); | 484 | p->drawRect( 2, 2, width-4, height()-4); |
481 | p->fillRect( 3, 3, progress, height()-6, | 485 | p->fillRect( 3, 3, progress, height()-6, |
@@ -483,5 +487,5 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
483 | p->restore(); | 487 | p->restore(); |
484 | } else { | 488 | } else { |
485 | QCheckListItem::paintCell(p, _cg, column, width, alignment); | 489 | Q3CheckListItem::paintCell(p, _cg, column, width, alignment); |
486 | } | 490 | } |
487 | return; | 491 | return; |
@@ -495,10 +499,10 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
495 | p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); | 499 | p->fillRect( 0, 0, width, height(), _cg.brush( QColorGroup::Base ) ); |
496 | 500 | ||
497 | QListView *lv = listView(); | 501 | Q3ListView *lv = listView(); |
498 | if ( !lv ) | 502 | if ( !lv ) |
499 | return; | 503 | return; |
500 | int marg = 2;//lv->itemMargin(); | 504 | int marg = 2;//lv->itemMargin(); |
501 | int r = 0; | 505 | int r = 0; |
502 | QCheckListItem::Type myType = QCheckListItem::CheckBox; | 506 | Q3CheckListItem::Type myType = Q3CheckListItem::CheckBox; |
503 | int BoxSize = 20; | 507 | int BoxSize = 20; |
504 | int boxOffset = 2; | 508 | int boxOffset = 2; |
@@ -523,5 +527,5 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
523 | r += BoxSize + 4; | 527 | r += BoxSize + 4; |
524 | } else { | 528 | } else { |
525 | ASSERT( lv ); //### | 529 | Q_ASSERT( lv ); //### |
526 | //QFontMetrics fm( lv->font() ); | 530 | //QFontMetrics fm( lv->font() ); |
527 | //int d = fm.height(); | 531 | //int d = fm.height(); |
@@ -540,5 +544,5 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
540 | y++; | 544 | y++; |
541 | if ( isOn() ) { | 545 | if ( isOn() ) { |
542 | QPointArray a( 7*2 ); | 546 | Q3PointArray a( 7*2 ); |
543 | int i, xx, yy; | 547 | int i, xx, yy; |
544 | xx = x+xOffset+marg+(boxOffset/2); | 548 | xx = x+xOffset+marg+(boxOffset/2); |
@@ -556,5 +560,5 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
556 | xx++; yy--; | 560 | xx++; yy--; |
557 | } | 561 | } |
558 | p->setPen( darkGreen ); | 562 | p->setPen( Qt::darkGreen ); |
559 | p->drawLineSegments( a ); | 563 | p->drawLineSegments( a ); |
560 | } | 564 | } |
@@ -566,7 +570,7 @@ void KOTodoViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, i | |||
566 | p->translate( r, 0 ); | 570 | p->translate( r, 0 ); |
567 | p->setPen( QPen( _cg.text() ) ); | 571 | p->setPen( QPen( _cg.text() ) ); |
568 | QListViewItem::paintCell( p, _cg, column, width - r, align ); | 572 | Q3ListViewItem::paintCell( p, _cg, column, width - r, align ); |
569 | if ( mTodo->cancelled () ) { | 573 | if ( mTodo->cancelled () ) { |
570 | p->setPen( black ); | 574 | p->setPen( Qt::black ); |
571 | QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); | 575 | QRect br = p->boundingRect( 1,1,1,1,0,mTodo->summary() ); |
572 | int wid = br.width() +lineStart; | 576 | int wid = br.width() +lineStart; |