-rw-r--r-- | korganizer/calprintbase.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/korganizer/calprintbase.cpp b/korganizer/calprintbase.cpp index 7b7d54c..ecb9e03 100644 --- a/korganizer/calprintbase.cpp +++ b/korganizer/calprintbase.cpp | |||
@@ -27,7 +27,9 @@ | |||
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | #include <qframe.h> | 28 | #include <q3frame.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qptrlist.h> | 30 | #include <q3ptrlist.h> |
31 | #include <qintdict.h> | 31 | #include <q3intdict.h> |
32 | #include <qfontmetrics.h> | 32 | #include <qfontmetrics.h> |
33 | //Added by qt3to4: | ||
34 | #include <Q3VBoxLayout> | ||
33 | 35 | ||
@@ -147,4 +149,4 @@ QWidget *CalPrintBase::configWidget( QWidget *w ) | |||
147 | { | 149 | { |
148 | QFrame *wdg = new QFrame( w ); | 150 | Q3Frame *wdg = new Q3Frame( w ); |
149 | QVBoxLayout *layout = new QVBoxLayout( wdg ); | 151 | Q3VBoxLayout *layout = new Q3VBoxLayout( wdg ); |
150 | 152 | ||
@@ -287,3 +289,3 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, | |||
287 | const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); | 289 | const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem(); |
288 | p.drawText(x, y, width, height/4, AlignCenter, calSys->monthName( qd ) ); | 290 | p.drawText(x, y, width, height/4, Qt::AlignCenter, calSys->monthName( qd ) ); |
289 | 291 | ||
@@ -303,3 +305,3 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, | |||
303 | p.drawText(x+col*cellWidth, y+height/4, cellWidth, cellHeight, | 305 | p.drawText(x+col*cellWidth, y+height/4, cellWidth, cellHeight, |
304 | AlignCenter, tmpStr); | 306 | Qt::AlignCenter, tmpStr); |
305 | monthDate2 = monthDate2.addDays(1); | 307 | monthDate2 = monthDate2.addDays(1); |
@@ -320,3 +322,3 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd, | |||
320 | y+height/4+cellHeight+(row*cellHeight), | 322 | y+height/4+cellHeight+(row*cellHeight), |
321 | cellWidth, cellHeight, AlignCenter, | 323 | cellWidth, cellHeight, Qt::AlignCenter, |
322 | tmpStr.setNum(monthDate.day()) ); | 324 | tmpStr.setNum(monthDate.day()) ); |
@@ -360,3 +362,3 @@ void CalPrintBase::drawDaysOfWeekBox(QPainter &p, const QDate &qd, | |||
360 | // QBrush( Dense7Pattern ) ); | 362 | // QBrush( Dense7Pattern ) ); |
361 | p.drawText( x+5, y, width-10, height, AlignCenter | AlignVCenter, | 363 | p.drawText( x+5, y, width-10, height, Qt::AlignCenter | Qt::AlignVCenter, |
362 | calSys->weekDayName( qd ) ); | 364 | calSys->weekDayName( qd ) ); |
@@ -403,6 +405,6 @@ void CalPrintBase::drawTimeLine(QPainter &p, | |||
403 | p.drawText(x+2, (int)currY+2, width/2-2, (int)cellHeight, | 405 | p.drawText(x+2, (int)currY+2, width/2-2, (int)cellHeight, |
404 | AlignTop|AlignRight, numStr); | 406 | Qt::AlignTop|Qt::AlignRight, numStr); |
405 | p.setFont(QFont("helvetica", 10, QFont::Normal)); | 407 | p.setFont(QFont("helvetica", 10, QFont::Normal)); |
406 | p.drawText(x+width/2, (int)currY+2, width/2+2, (int)(cellHeight/2)-3, | 408 | p.drawText(x+width/2, (int)currY+2, width/2+2, (int)(cellHeight/2)-3, |
407 | AlignTop | AlignLeft, "00"); | 409 | Qt::AlignTop | Qt::AlignLeft, "00"); |
408 | } else { | 410 | } else { |
@@ -412,3 +414,3 @@ void CalPrintBase::drawTimeLine(QPainter &p, | |||
412 | p.drawText(x+2, (int)currY+2, width-4, (int)cellHeight/2-3, | 414 | p.drawText(x+2, (int)currY+2, width-4, (int)cellHeight/2-3, |
413 | AlignTop|AlignLeft, numStr); | 415 | Qt::AlignTop|Qt::AlignLeft, numStr); |
414 | } | 416 | } |
@@ -474,3 +476,3 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList, | |||
474 | p.drawText( x+5, offset+5, width-10, height-10, | 476 | p.drawText( x+5, offset+5, width-10, height-10, |
475 | AlignCenter | AlignVCenter | AlignJustify | WordBreak, | 477 | Qt::AlignCenter | Qt::AlignVCenter | Qt::AlignJustify | Qt::WordBreak, |
476 | text ); | 478 | text ); |
@@ -495,3 +497,3 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList, | |||
495 | p.drawText( x+5, offset+5, width-10, height-10, | 497 | p.drawText( x+5, offset+5, width-10, height-10, |
496 | AlignLeft | AlignTop | AlignJustify , | 498 | Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify , |
497 | multiDayStr); | 499 | multiDayStr); |
@@ -562,3 +564,3 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, | |||
562 | 564 | ||
563 | QPtrList<KOrg::CellItem> cells; | 565 | Q3PtrList<KOrg::CellItem> cells; |
564 | cells.setAutoDelete( true ); | 566 | cells.setAutoDelete( true ); |
@@ -570,3 +572,3 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, | |||
570 | 572 | ||
571 | QPtrListIterator<KOrg::CellItem> it1( cells ); | 573 | Q3PtrListIterator<KOrg::CellItem> it1( cells ); |
572 | for( it1.toFirst(); it1.current(); ++it1 ) { | 574 | for( it1.toFirst(); it1.current(); ++it1 ) { |
@@ -595,3 +597,3 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events, | |||
595 | 597 | ||
596 | p.setBrush( QBrush( NoBrush ) ); | 598 | p.setBrush( QBrush( Qt::NoBrush ) ); |
597 | } | 599 | } |
@@ -637,3 +639,3 @@ void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p, | |||
637 | p.drawText( currentX+3, currentyPos+2, currentWidth-5, eventLength-3, | 639 | p.drawText( currentX+3, currentyPos+2, currentWidth-5, eventLength-3, |
638 | AlignLeft | AlignTop | AlignJustify | WordBreak, | 640 | Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify | Qt::TextWordWrap, |
639 | text); | 641 | text); |
@@ -672,3 +674,3 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, | |||
672 | 674 | ||
673 | p.drawText( x+5, y, width-25, mSubHeaderHeight, AlignLeft | AlignVCenter, | 675 | p.drawText( x+5, y, width-25, mSubHeaderHeight, Qt::AlignLeft | Qt::AlignVCenter, |
674 | hstring ); | 676 | hstring ); |
@@ -682,3 +684,3 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, | |||
682 | } | 684 | } |
683 | p.drawText(x+5, y, width-10, mSubHeaderHeight, AlignRight | AlignVCenter, | 685 | p.drawText(x+5, y, width-10, mSubHeaderHeight, Qt::AlignRight | Qt::AlignVCenter, |
684 | dayNumStr); | 686 | dayNumStr); |
@@ -726,3 +728,3 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, | |||
726 | p.drawText(x+5, y+textY, width-10, lineSpacing, | 728 | p.drawText(x+5, y+textY, width-10, lineSpacing, |
727 | AlignLeft|AlignBottom, outStr); | 729 | Qt::AlignLeft|Qt::AlignBottom, outStr); |
728 | textY+=lineSpacing; | 730 | textY+=lineSpacing; |
@@ -745,3 +747,3 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd, | |||
745 | p.drawText(x+5, y+textY, width-10, lineSpacing, | 747 | p.drawText(x+5, y+textY, width-10, lineSpacing, |
746 | AlignLeft|AlignBottom, text); | 748 | Qt::AlignLeft|Qt::AlignBottom, text); |
747 | textY+=lineSpacing; | 749 | textY+=lineSpacing; |
@@ -851,3 +853,3 @@ void CalPrintBase::drawMonth(QPainter &p, const QDate &qd, bool weeknumbers, | |||
851 | QRect rc(x, y+yoffset+cellHeight*row, xoffset-1, cellHeight); | 853 | QRect rc(x, y+yoffset+cellHeight*row, xoffset-1, cellHeight); |
852 | p.drawText( rc, AlignRight|AlignVCenter, QString::number(calWeek) ); | 854 | p.drawText( rc, Qt::AlignRight|Qt::AlignVCenter, QString::number(calWeek) ); |
853 | weekDate = weekDate.addDays(7); | 855 | weekDate = weekDate.addDays(7); |
@@ -899,3 +901,3 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
899 | // lines of the tree can easily be drawn (needed if a new page is started) | 901 | // lines of the tree can easily be drawn (needed if a new page is started) |
900 | static QPtrList<TodoParentStart> startPoints; | 902 | static Q3PtrList<TodoParentStart> startPoints; |
901 | if (level<1) { | 903 | if (level<1) { |
@@ -912,3 +914,3 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
912 | int left = possummary+(level*10); | 914 | int left = possummary+(level*10); |
913 | rect = p.boundingRect(left, y, (posdue-left-5),-1, WordBreak, outStr); | 915 | rect = p.boundingRect(left, y, (posdue-left-5),-1, Qt::WordBreak, outStr); |
914 | //qDebug("bottom1 %d ", rect.bottom() ); | 916 | //qDebug("bottom1 %d ", rect.bottom() ); |
@@ -917,3 +919,3 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
917 | rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1, | 919 | rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1, |
918 | WordBreak, outStr ); | 920 | Qt::WordBreak, outStr ); |
919 | } | 921 | } |
@@ -935,4 +937,3 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
935 | start = p.viewport().top(); | 937 | start = p.viewport().top(); |
936 | p.moveTo( center, start ); | 938 | p.drawLine( center, start, center, to ); |
937 | p.lineTo( center, to ); | ||
938 | rct->mSamePage=false; | 939 | rct->mSamePage=false; |
@@ -953,3 +954,3 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
953 | outStr.setNum(priority); | 954 | outStr.setNum(priority); |
954 | rect = p.boundingRect(pospriority, y + 10, 5, -1, AlignCenter, outStr); | 955 | rect = p.boundingRect(pospriority, y + 10, 5, -1, Qt::AlignCenter, outStr); |
955 | // Make it a more reasonable size | 956 | // Make it a more reasonable size |
@@ -958,3 +959,3 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
958 | if ( priority > 0 && pospriority>=0 ) { | 959 | if ( priority > 0 && pospriority>=0 ) { |
959 | p.drawText(rect, AlignCenter, outStr); | 960 | p.drawText(rect, Qt::AlignCenter, outStr); |
960 | p.drawRect(rect); | 961 | p.drawRect(rect); |
@@ -966,3 +967,3 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
966 | QPen pen = p.pen(); | 967 | QPen pen = p.pen(); |
967 | p.setPen ( QPen ( black, 2) ); | 968 | p.setPen ( QPen ( Qt::black, 2) ); |
968 | p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 ); | 969 | p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 ); |
@@ -983,5 +984,4 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
983 | int endx( rect.left() ); | 984 | int endx( rect.left() ); |
984 | p.moveTo(center, bottom); | 985 | p.drawLine(center,bottom, center,to); |
985 | p.lineTo(center, to); | 986 | p.drawLine(center,to, endx,to); |
986 | p.lineTo(endx, to); | ||
987 | } | 987 | } |
@@ -1001,5 +1001,5 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
1001 | rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)), | 1001 | rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)), |
1002 | -1, WordBreak, outStr); | 1002 | -1, Qt::WordBreak, outStr); |
1003 | QRect newrect; | 1003 | QRect newrect; |
1004 | p.drawText( rect, WordBreak, outStr, -1, &newrect ); | 1004 | p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect ); |
1005 | //ft.setStrikeOut(false); | 1005 | //ft.setStrikeOut(false); |
@@ -1018,4 +1018,4 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter & | |||
1018 | rect = p.boundingRect( left+20, y, x+width-(left+10), -1, | 1018 | rect = p.boundingRect( left+20, y, x+width-(left+10), -1, |
1019 | WordBreak, outStr ); | 1019 | Qt::WordBreak, outStr ); |
1020 | p.drawText( rect, WordBreak, outStr, -1, &newrect ); | 1020 | p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect ); |
1021 | } | 1021 | } |
@@ -1140,4 +1140,4 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, | |||
1140 | QFont font("helvetica", 18, QFont::Bold); | 1140 | QFont font("helvetica", 18, QFont::Bold); |
1141 | QPen penA( black,0); | 1141 | QPen penA( Qt::black,0); |
1142 | QPen penB( black,3); | 1142 | QPen penB( Qt::black,3); |
1143 | p.setFont(font); | 1143 | p.setFont(font); |
@@ -1163,3 +1163,3 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, | |||
1163 | lineSpacing = p.fontMetrics().lineSpacing(); | 1163 | lineSpacing = p.fontMetrics().lineSpacing(); |
1164 | p.drawText(0, lineSpacing * 0, width, lineSpacing, AlignRight |AlignTop, title ); | 1164 | p.drawText(0, lineSpacing * 0, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title ); |
1165 | 1165 | ||
@@ -1173,3 +1173,3 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, | |||
1173 | title += QString::number(fd.year()); | 1173 | title += QString::number(fd.year()); |
1174 | p.drawText(0, lineSpacing * 1, width, lineSpacing, AlignRight |AlignTop, title ); | 1174 | p.drawText(0, lineSpacing * 1, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title ); |
1175 | mSubHeaderHeight = tempStore ; | 1175 | mSubHeaderHeight = tempStore ; |
@@ -1199,3 +1199,3 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, | |||
1199 | p.drawText(offsetLeft, mHeaderHeight + 5, | 1199 | p.drawText(offsetLeft, mHeaderHeight + 5, |
1200 | width, mSubHeaderHeight, AlignHCenter | AlignVCenter, | 1200 | width, mSubHeaderHeight, Qt::AlignHCenter | Qt::AlignVCenter, |
1201 | dayName); | 1201 | dayName); |
@@ -1256,6 +1256,6 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width, | |||
1256 | p.drawText(offsetLeft+12, offset+startMinuteOff+startTime*cellHeight+5, width-24, | 1256 | p.drawText(offsetLeft+12, offset+startMinuteOff+startTime*cellHeight+5, width-24, |
1257 | cheight-10, AlignHCenter | AlignTop, text); | 1257 | cheight-10, Qt::AlignHCenter | Qt::AlignTop, text); |
1258 | } | 1258 | } |
1259 | } | 1259 | } |
1260 | p.setBrush(QBrush(NoBrush)); | 1260 | p.setBrush(QBrush(Qt::NoBrush)); |
1261 | mSubHeaderHeight = tempStore ; | 1261 | mSubHeaderHeight = tempStore ; |
@@ -1276,8 +1276,8 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, | |||
1276 | for (int i = 0; i < hours; i++) { | 1276 | for (int i = 0; i < hours; i++) { |
1277 | p.setPen(QPen(black,1)); | 1277 | p.setPen(QPen(Qt::black,1)); |
1278 | p.drawLine(0, offset+i*cellHeight, width, offset+i*cellHeight); | 1278 | p.drawLine(0, offset+i*cellHeight, width, offset+i*cellHeight); |
1279 | p.setPen(QPen(gray,0)); | 1279 | p.setPen(QPen(Qt::gray,0)); |
1280 | p.drawLine(37, offset+i*cellHeight+(cellHeight/2), | 1280 | p.drawLine(37, offset+i*cellHeight+(cellHeight/2), |
1281 | width, offset+i*cellHeight+(cellHeight/2)); | 1281 | width, offset+i*cellHeight+(cellHeight/2)); |
1282 | p.setPen(QPen(black,0)); | 1282 | p.setPen(QPen(Qt::black,0)); |
1283 | 1283 | ||
@@ -1291,6 +1291,6 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, | |||
1291 | p.drawText(0, offset+i*cellHeight, 33, cellHeight/2, | 1291 | p.drawText(0, offset+i*cellHeight, 33, cellHeight/2, |
1292 | AlignTop|AlignRight, numStr); | 1292 | Qt::AlignTop|Qt::AlignRight, numStr); |
1293 | p.setFont(QFont("helvetica", 12, QFont::Bold)); | 1293 | p.setFont(QFont("helvetica", 12, QFont::Bold)); |
1294 | p.drawText(37, offset+i*cellHeight, 45, cellHeight/2, | 1294 | p.drawText(37, offset+i*cellHeight, 45, cellHeight/2, |
1295 | AlignTop | AlignLeft, "00"); | 1295 | Qt::AlignTop | Qt::AlignLeft, "00"); |
1296 | } else { | 1296 | } else { |
@@ -1300,3 +1300,3 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth, | |||
1300 | p.drawText(4, offset+i*cellHeight, 70, cellHeight/2, | 1300 | p.drawText(4, offset+i*cellHeight, 70, cellHeight/2, |
1301 | AlignTop|AlignLeft, numStr); | 1301 | Qt::AlignTop|Qt::AlignLeft, numStr); |
1302 | } | 1302 | } |