summaryrefslogtreecommitdiffabout
path: root/korganizer/calprintbase.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calprintbase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calprintbase.cpp102
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
@@ -26,9 +26,11 @@
#include <qpainter.h>
#include <qlayout.h>
-#include <qframe.h>
+#include <q3frame.h>
#include <qlabel.h>
-#include <qptrlist.h>
-#include <qintdict.h>
+#include <q3ptrlist.h>
+#include <q3intdict.h>
#include <qfontmetrics.h>
+//Added by qt3to4:
+#include <Q3VBoxLayout>
#include <kglobal.h>
@@ -146,6 +148,6 @@ CalPrintBase::~CalPrintBase()
QWidget *CalPrintBase::configWidget( QWidget *w )
{
- QFrame *wdg = new QFrame( w );
- QVBoxLayout *layout = new QVBoxLayout( wdg );
+ Q3Frame *wdg = new Q3Frame( w );
+ Q3VBoxLayout *layout = new Q3VBoxLayout( wdg );
QLabel *title = new QLabel( description(), wdg );
@@ -286,5 +288,5 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd,
// int lineSpacing = p.fontMetrics().lineSpacing();
const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem();
- p.drawText(x, y, width, height/4, AlignCenter, calSys->monthName( qd ) );
+ p.drawText(x, y, width, height/4, Qt::AlignCenter, calSys->monthName( qd ) );
int cellWidth = width/7;
@@ -302,5 +304,5 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd,
tmpStr=calSys->weekDayName( monthDate2 )[0].upper();
p.drawText(x+col*cellWidth, y+height/4, cellWidth, cellHeight,
- AlignCenter, tmpStr);
+ Qt::AlignCenter, tmpStr);
monthDate2 = monthDate2.addDays(1);
}
@@ -319,5 +321,5 @@ void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd,
p.drawText( x+col*cellWidth,
y+height/4+cellHeight+(row*cellHeight),
- cellWidth, cellHeight, AlignCenter,
+ cellWidth, cellHeight, Qt::AlignCenter,
tmpStr.setNum(monthDate.day()) );
monthDate = monthDate.addDays(1);
@@ -359,5 +361,5 @@ void CalPrintBase::drawDaysOfWeekBox(QPainter &p, const QDate &qd,
// width-2, height-2,
// QBrush( Dense7Pattern ) );
- p.drawText( x+5, y, width-10, height, AlignCenter | AlignVCenter,
+ p.drawText( x+5, y, width-10, height, Qt::AlignCenter | Qt::AlignVCenter,
calSys->weekDayName( qd ) );
}
@@ -402,8 +404,8 @@ void CalPrintBase::drawTimeLine(QPainter &p,
}
p.drawText(x+2, (int)currY+2, width/2-2, (int)cellHeight,
- AlignTop|AlignRight, numStr);
+ Qt::AlignTop|Qt::AlignRight, numStr);
p.setFont(QFont("helvetica", 10, QFont::Normal));
p.drawText(x+width/2, (int)currY+2, width/2+2, (int)(cellHeight/2)-3,
- AlignTop | AlignLeft, "00");
+ Qt::AlignTop | Qt::AlignLeft, "00");
} else {
QTime time( curTime.hour(), 0 );
@@ -411,5 +413,5 @@ void CalPrintBase::drawTimeLine(QPainter &p,
p.setFont(QFont("helvetica", 14, QFont::Bold));
p.drawText(x+2, (int)currY+2, width-4, (int)cellHeight/2-3,
- AlignTop|AlignLeft, numStr);
+ Qt::AlignTop|Qt::AlignLeft, numStr);
}
currY+=cellHeight;
@@ -473,5 +475,5 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList,
p.drawText( x+5, offset+5, width-10, height-10,
- AlignCenter | AlignVCenter | AlignJustify | WordBreak,
+ Qt::AlignCenter | Qt::AlignVCenter | Qt::AlignJustify | Qt::WordBreak,
text );
// reset the colors
@@ -494,5 +496,5 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList,
// p.fillRect(x+1, offset+1, width-2, height-2, QBrush(Dense5Pattern) );
p.drawText( x+5, offset+5, width-10, height-10,
- AlignLeft | AlignTop | AlignJustify ,
+ Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify ,
multiDayStr);
}
@@ -561,5 +563,5 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events,
// overlapping events
- QPtrList<KOrg::CellItem> cells;
+ Q3PtrList<KOrg::CellItem> cells;
cells.setAutoDelete( true );
@@ -569,5 +571,5 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events,
}
- QPtrListIterator<KOrg::CellItem> it1( cells );
+ Q3PtrListIterator<KOrg::CellItem> it1( cells );
for( it1.toFirst(); it1.current(); ++it1 ) {
KOrg::CellItem *placeItem = it1.current();
@@ -594,5 +596,5 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events,
}
- p.setBrush( QBrush( NoBrush ) );
+ p.setBrush( QBrush( Qt::NoBrush ) );
}
@@ -636,5 +638,5 @@ void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p,
p.drawRect( currentX, currentyPos+1, currentWidth+1, eventLength+1 );
p.drawText( currentX+3, currentyPos+2, currentWidth-5, eventLength-3,
- AlignLeft | AlignTop | AlignJustify | WordBreak,
+ Qt::AlignLeft | Qt::AlignTop | Qt::AlignJustify | Qt::TextWordWrap,
text);
// p.restore();
@@ -671,5 +673,5 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
p.setFont( QFont( "helvetica", 8, QFont::Bold, true ) );
- p.drawText( x+5, y, width-25, mSubHeaderHeight, AlignLeft | AlignVCenter,
+ p.drawText( x+5, y, width-25, mSubHeaderHeight, Qt::AlignLeft | Qt::AlignVCenter,
hstring );
}
@@ -681,5 +683,5 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
dayNumStr = local->formatDate(qd, true);
}
- p.drawText(x+5, y, width-10, mSubHeaderHeight, AlignRight | AlignVCenter,
+ p.drawText(x+5, y, width-10, mSubHeaderHeight, Qt::AlignRight | Qt::AlignVCenter,
dayNumStr);
Event::List eventList;
@@ -725,5 +727,5 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
p.drawText(x+5, y+textY, width-10, lineSpacing,
- AlignLeft|AlignBottom, outStr);
+ Qt::AlignLeft|Qt::AlignBottom, outStr);
textY+=lineSpacing;
}
@@ -744,5 +746,5 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
p.drawText(x+5, y+textY, width-10, lineSpacing,
- AlignLeft|AlignBottom, text);
+ Qt::AlignLeft|Qt::AlignBottom, text);
textY+=lineSpacing;
}
@@ -850,5 +852,5 @@ void CalPrintBase::drawMonth(QPainter &p, const QDate &qd, bool weeknumbers,
int calWeek = weekDate.weekNumber();
QRect rc(x, y+yoffset+cellHeight*row, xoffset-1, cellHeight);
- p.drawText( rc, AlignRight|AlignVCenter, QString::number(calWeek) );
+ p.drawText( rc, Qt::AlignRight|Qt::AlignVCenter, QString::number(calWeek) );
weekDate = weekDate.addDays(7);
}
@@ -898,5 +900,5 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
// This list keeps all starting points of the parent todos so the connection
// lines of the tree can easily be drawn (needed if a new page is started)
- static QPtrList<TodoParentStart> startPoints;
+ static Q3PtrList<TodoParentStart> startPoints;
if (level<1) {
startPoints.clear();
@@ -911,10 +913,10 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
}
int left = possummary+(level*10);
- rect = p.boundingRect(left, y, (posdue-left-5),-1, WordBreak, outStr);
+ rect = p.boundingRect(left, y, (posdue-left-5),-1, Qt::WordBreak, outStr);
//qDebug("bottom1 %d ", rect.bottom() );
if ( !item->description().isEmpty() && desc ) {
outStr = item->description();
rect = p.boundingRect( left+20, rect.bottom()+5, width-(left+10-x), -1,
- WordBreak, outStr );
+ Qt::WordBreak, outStr );
}
//qDebug("bottom2 %d y+h %d y %d ph %d", rect.bottom(), y+height, y , pageHeight );
@@ -934,6 +936,5 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
else
start = p.viewport().top();
- p.moveTo( center, start );
- p.lineTo( center, to );
+ p.drawLine( center, start, center, to );
rct->mSamePage=false;
}
@@ -952,10 +953,10 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
// Priority
outStr.setNum(priority);
- rect = p.boundingRect(pospriority, y + 10, 5, -1, AlignCenter, outStr);
+ rect = p.boundingRect(pospriority, y + 10, 5, -1, Qt::AlignCenter, outStr);
// Make it a more reasonable size
rect.setWidth(19);
rect.setHeight(19);
if ( priority > 0 && pospriority>=0 ) {
- p.drawText(rect, AlignCenter, outStr);
+ p.drawText(rect, Qt::AlignCenter, outStr);
p.drawRect(rect);
// cross out the rectangle for completed items
@@ -965,5 +966,5 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
} else if (item->cancelled() ) {
QPen pen = p.pen();
- p.setPen ( QPen ( black, 2) );
+ p.setPen ( QPen ( Qt::black, 2) );
p.drawLine( rect.left()+2,rect.top()+rect.height()/2, rect.right()-2, +rect.top()+rect.height()/2 );
p.setPen( pen );
@@ -982,7 +983,6 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
int to( rect.top() + (rect.height()/2)+1 );
int endx( rect.left() );
- p.moveTo(center, bottom);
- p.lineTo(center, to);
- p.lineTo(endx, to);
+ p.drawLine(center,bottom, center,to);
+ p.drawLine(center,to, endx,to);
}
@@ -1000,7 +1000,7 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
}
rect = p.boundingRect( left, rect.top(), (posdue-(left + rect.width() + 5)),
- -1, WordBreak, outStr);
+ -1, Qt::WordBreak, outStr);
QRect newrect;
- p.drawText( rect, WordBreak, outStr, -1, &newrect );
+ p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect );
//ft.setStrikeOut(false);
// p.setFont(ft);
@@ -1017,6 +1017,6 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
outStr = item->description();
rect = p.boundingRect( left+20, y, x+width-(left+10), -1,
- WordBreak, outStr );
- p.drawText( rect, WordBreak, outStr, -1, &newrect );
+ Qt::WordBreak, outStr );
+ p.drawText( rect, Qt::WordBreak, outStr, -1, &newrect );
}
@@ -1139,6 +1139,6 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd,
KLocale *local = KGlobal::locale();
QFont font("helvetica", 18, QFont::Bold);
- QPen penA( black,0);
- QPen penB( black,3);
+ QPen penA( Qt::black,0);
+ QPen penB( Qt::black,3);
p.setFont(font);
int lineSpacing = p.fontMetrics().lineSpacing();
@@ -1162,5 +1162,5 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd,
lineSpacing = p.fontMetrics().lineSpacing();
- p.drawText(0, lineSpacing * 0, width, lineSpacing, AlignRight |AlignTop, title );
+ p.drawText(0, lineSpacing * 0, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title );
title.truncate(0);
@@ -1172,5 +1172,5 @@ void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd,
p.setFont(QFont("Helvetica", 20, QFont::Bold, TRUE));
title += QString::number(fd.year());
- p.drawText(0, lineSpacing * 1, width, lineSpacing, AlignRight |AlignTop, title );
+ p.drawText(0, lineSpacing * 1, width, lineSpacing, Qt::AlignRight |Qt::AlignTop, title );
mSubHeaderHeight = tempStore ;
}
@@ -1198,5 +1198,5 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width,
p.setFont(QFont("helvetica", 12, QFont::Bold, true));
p.drawText(offsetLeft, mHeaderHeight + 5,
- width, mSubHeaderHeight, AlignHCenter | AlignVCenter,
+ width, mSubHeaderHeight, Qt::AlignHCenter | Qt::AlignVCenter,
dayName);
@@ -1255,8 +1255,8 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width,
width-4, cheight);
p.drawText(offsetLeft+12, offset+startMinuteOff+startTime*cellHeight+5, width-24,
- cheight-10, AlignHCenter | AlignTop, text);
+ cheight-10, Qt::AlignHCenter | Qt::AlignTop, text);
}
}
- p.setBrush(QBrush(NoBrush));
+ p.setBrush(QBrush(Qt::NoBrush));
mSubHeaderHeight = tempStore ;
}
@@ -1275,10 +1275,10 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth,
QString numStr;
for (int i = 0; i < hours; i++) {
- p.setPen(QPen(black,1));
+ p.setPen(QPen(Qt::black,1));
p.drawLine(0, offset+i*cellHeight, width, offset+i*cellHeight);
- p.setPen(QPen(gray,0));
+ p.setPen(QPen(Qt::gray,0));
p.drawLine(37, offset+i*cellHeight+(cellHeight/2),
width, offset+i*cellHeight+(cellHeight/2));
- p.setPen(QPen(black,0));
+ p.setPen(QPen(Qt::black,0));
if ( !KGlobal::locale()->use12Clock() ) {
@@ -1290,8 +1290,8 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth,
}
p.drawText(0, offset+i*cellHeight, 33, cellHeight/2,
- AlignTop|AlignRight, numStr);
+ Qt::AlignTop|Qt::AlignRight, numStr);
p.setFont(QFont("helvetica", 12, QFont::Bold));
p.drawText(37, offset+i*cellHeight, 45, cellHeight/2,
- AlignTop | AlignLeft, "00");
+ Qt::AlignTop | Qt::AlignLeft, "00");
} else {
QTime time( i + startHour, 0 );
@@ -1299,5 +1299,5 @@ void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth,
p.setFont(QFont("helvetica", 12, QFont::Bold));
p.drawText(4, offset+i*cellHeight, 70, cellHeight/2,
- AlignTop|AlignLeft, numStr);
+ Qt::AlignTop|Qt::AlignLeft, numStr);
}
} mSubHeaderHeight = tempStore ;