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
@@ -16,29 +16,31 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
#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>
#include <klocale.h>
#include <kdebug.h>
#include <kconfig.h>
#include <kcalendarsystem.h>
#include <kprinter.h>
#include <libkcal/todo.h>
#include <libkcal/event.h>
#include <libkcal/calendar.h>
@@ -136,26 +138,26 @@ CalPrintBase::CalPrintBase( KPrinter *printer, Calendar *cal, KConfig *cfg )
: QObject(), mPrinter( printer ), mCalendar( cal ), mConfig( cfg )
{
}
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 );
QFont titleFont( title->font() );
titleFont.setPointSize( 20 );
titleFont.setBold( true );
title->setFont( titleFont );
layout->addWidget( title );
layout->addWidget( new QLabel( longDescription(), wdg ) );
layout->addSpacing( 20 );
layout->addWidget( new QLabel( i18n("This printing style does not "
"have any configuration options."),
@@ -276,58 +278,58 @@ void CalPrintBase::drawHeader( QPainter &p, QString title,
void CalPrintBase::drawSmallMonth(QPainter &p, const QDate &qd,
int x, int y, int width, int height)
{
bool firstCol = true;
QDate monthDate(QDate(qd.year(), qd.month(), 1));
QDate monthDate2;
int month = monthDate.month();
// draw the title
p.setFont(QFont("helvetica", 7, QFont::Bold));
// 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;
int cellHeight = height/8;
QString tmpStr;
// correct begin of week
int weekdayCol = weekdayColumn( qd.dayOfWeek() );
monthDate2 = monthDate.addDays(-weekdayCol);
// draw days of week
p.setFont(QFont("helvetica", 7, QFont::Bold));
for (int col = 0; col < 7; col++) {
// tmpStr.sprintf("%c",(const char*)monthDate2.dayName(monthDate2.dayOfWeek()));
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);
}
// draw separator line
p.drawLine(x, y+height/4+cellHeight, x+width, y+height/4+cellHeight);
for (int row = 0; row < 5; row++) {
for (int col = 0; col < 7; col++) {
if (monthDate.month() != month)
break;
if (firstCol) {
firstCol = true;
col = weekdayColumn( monthDate.dayOfWeek() );
}
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);
}
}
}
///////////////////////////////////////////////////////////////////////////////
/*
* This routine draws a header box over the main part of the calendar
* containing the days of the week.
@@ -349,25 +351,25 @@ void CalPrintBase::drawDaysOfWeek(QPainter &p,
void CalPrintBase::drawDaysOfWeekBox(QPainter &p, const QDate &qd,
int x, int y, int width, int height)
{
const KCalendarSystem *calSys = KOGlobals::self()->calendarSystem();
p.setFont( QFont( "helvetica", 10, QFont::Bold ) );
p.drawRect( x, y, width, height );
// p.fillRect( x+1, y+1,
// 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 ) );
}
void CalPrintBase::drawTimeLine(QPainter &p,
const QTime &fromTime, const QTime &toTime,
int x, int y, int width, int height)
{
p.drawRect(x, y, width, height);
int totalsecs=fromTime.secsTo(toTime);
float minlen=(float)height*60./(float)totalsecs;
@@ -392,34 +394,34 @@ void CalPrintBase::drawTimeLine(QPainter &p,
QString numStr;
if (newY < y+height) {
p.drawLine(x+width/2, (int)newY, x+width, (int)newY);
// draw the time:
if ( !KGlobal::locale()->use12Clock() ) {
numStr.setNum(curTime.hour());
if (cellHeight > 30) {
p.setFont(QFont("helvetica", 16, QFont::Bold));
} else {
p.setFont(QFont("helvetica", 12, QFont::Bold));
}
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 );
numStr = KGlobal::locale()->formatTime( time );
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;
} // enough space for half-hour line and time
if (curTime.secsTo(endTime)>3600)
curTime=curTime.addSecs(3600);
else curTime=endTime;
} // currTime<endTime
}
///////////////////////////////////////////////////////////////////////////////
@@ -463,46 +465,46 @@ void CalPrintBase::drawAllDayBox(QPainter &p, Event::List &eventList,
if ( currEvent->doesFloat() ) {
// set the colors according to the categories
QString text = currEvent->summary() ;
if ( ! currEvent->location().isEmpty() )
text += " ("+currEvent->location()+")";
if (expandable) {
if (mUseColors)
setCategoryColors(p, currEvent);
p.drawRect( x, offset, width, height );
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
p.setBrush( oldBrush );
p.setPen( oldPen );
p.setBackgroundColor(oldBgColor);
offset += height;
} else {
//if (!multiDayStr.isEmpty()) multiDayStr+=", ";
multiDayStr += text+"\n";
}
eventList.remove( itold );
}
}
if (!expandable) {
p.drawRect(x, offset, width, height);
if (!multiDayStr.isEmpty()) {
// 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);
}
} else {
height=offset-y;
}
}
void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events,
const QDate &qd, bool expandable,
QTime &fromTime, QTime &toTime,
int x, int y, int width, int height )
@@ -551,58 +553,58 @@ void CalPrintBase::drawAgendaDayBox( QPainter &p, Event::List &events,
if ( curTime.secsTo( toTime ) > 3600 )
curTime = curTime.addSecs( 3600 );
else curTime = toTime;
currY += cellHeight / 2;
}
QDateTime startPrintDate = QDateTime( qd, fromTime );
QDateTime endPrintDate = QDateTime( qd, toTime );
// Calculate horizontal positions and widths of events taking into account
// overlapping events
- QPtrList<KOrg::CellItem> cells;
+ Q3PtrList<KOrg::CellItem> cells;
cells.setAutoDelete( true );
Event::List::ConstIterator itEvents;
for( itEvents = events.begin(); itEvents != events.end(); ++itEvents ) {
cells.append( new PrintCellItem( *itEvents, qd ) );
}
- QPtrListIterator<KOrg::CellItem> it1( cells );
+ Q3PtrListIterator<KOrg::CellItem> it1( cells );
for( it1.toFirst(); it1.current(); ++it1 ) {
KOrg::CellItem *placeItem = it1.current();
KOrg::CellItem::placeItem( cells, placeItem );
}
QPen oldPen = p.pen();
QColor oldBgColor = p.backgroundColor();
QBrush oldBrush = p.brush();
p.setFont( QFont( "helvetica", 10 ) );
//p.setBrush( QBrush( Dense7Pattern ) );
for( it1.toFirst(); it1.current(); ++it1 ) {
PrintCellItem *placeItem = static_cast<PrintCellItem *>( it1.current() );
drawAgendaItem( placeItem, p, qd, startPrintDate, endPrintDate, minlen, x,
y, width );
p.setBrush( oldBrush );
p.setPen( oldPen );
p.setBackgroundColor( oldBgColor );
}
- p.setBrush( QBrush( NoBrush ) );
+ p.setBrush( QBrush( Qt::NoBrush ) );
}
void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p,
const QDate &qd,
const QDateTime &startPrintDate,
const QDateTime &endPrintDate,
float minlen, int x, int y, int width )
{
Event *event = item->event();
// set the colors according to the categories
@@ -626,25 +628,25 @@ void CalPrintBase::drawAgendaItem( PrintCellItem *item, QPainter &p,
int currentX = x + item->subCell() * currentWidth;
QString text = KGlobal::locale()->formatTime(event->dtStart().time())+
"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+
" "+event->summary();
if ( !event->location().isEmpty() )
text += " (" +event->location()+")";
// p.save();
QPen pe = p.pen();
pe.setWidth( 2 );
p.setPen( pe );
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();
}
}
void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
int x, int y, int width, int height,
bool fullDate)
{
QString dayNumStr;
QString ampm;
const KLocale*local = KGlobal::locale();
@@ -661,35 +663,35 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
p.drawRect( x, y, width, height );
// p.fillRect( x+1, y+1, width-2,height, QBrush(Dense7Pattern) );
p.drawRect( x, y, width, mSubHeaderHeight );
//p.fillRect( x+1, y+1, width-2, mSubHeaderHeight-2, QBrush(Dense7Pattern) );
QString hstring;
#ifndef KORG_NOPLUGINS
hstring=KOCore::self()->holiday(qd);
#endif
if (!hstring.isEmpty()) {
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 );
}
p.setFont(QFont("helvetica", 10, QFont::Bold));
if ( fullDate) {
// use short date format, if long date is too long
QFontMetrics fm ( p.font() );
if ( fm.width( dayNumStr ) > width -10 )
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;
eventList.fill( mCalendar->events( qd, true ));
Todo::List todos;
todos.fill( mCalendar->todos( qd ));
QString outStr;
p.setFont( QFont( "helvetica", 8 ) );
int lineSpacing = p.fontMetrics().lineSpacing();
int textY=mSubHeaderHeight+3; // gives the relative y-coord of the next printed entry
Event::List::ConstIterator it;
int entryCount = eventList.count() +todos.count();
@@ -715,44 +717,44 @@ void CalPrintBase::drawDayBox(QPainter &p, const QDate &qd,
if ( ! currEvent->location().isEmpty() )
outStr += " (" + currEvent->location()+")";
} else {
QTime t1 = currEvent->dtStart().time();
outStr = local->formatTime(t1);
outStr += " " + currEvent->summary();
}
} // doesFloat
p.drawText(x+5, y+textY, width-10, lineSpacing,
- AlignLeft|AlignBottom, outStr);
+ Qt::AlignLeft|Qt::AlignBottom, outStr);
textY+=lineSpacing;
}
if ( textY<height ) {
Todo::List::ConstIterator it2;
for( it2 = todos.begin(); it2 != todos.end() && textY<height; ++it2 ) {
Todo *todo = *it2;
QString text;
if (todo->hasDueDate()) {
if (!todo->doesFloat()) {
text += KGlobal::locale()->formatTime(todo->dtDue().time());
text += " ";
}
}
text += i18n("To-Do: %1").arg(todo->summary());
p.drawText(x+5, y+textY, width-10, lineSpacing,
- AlignLeft|AlignBottom, text);
+ Qt::AlignLeft|Qt::AlignBottom, text);
textY+=lineSpacing;
}
}
}
///////////////////////////////////////////////////////////////////////////////
void CalPrintBase::drawWeek(QPainter &p, const QDate &qd,
int x, int y, int width, int height)
{
QDate weekDate = qd;
@@ -840,25 +842,25 @@ void CalPrintBase::drawMonth(QPainter &p, const QDate &qd, bool weeknumbers,
int cellHeight = (height-yoffset) / rows;
if (weeknumbers) {
QFont oldFont(p.font());
QFont newFont(p.font());
newFont.setPointSize(7);
p.setFont(newFont);
xoffset += 18;
QDate weekDate(monthDate);
for (int row = 0; row<rows; row++) {
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);
}
p.setFont(oldFont);
}
drawDaysOfWeek( p, monthDate, monthDate.addDays(6), x+xoffset, y, width-xoffset, mSubHeaderHeight );
int cellWidth = (width-xoffset) / 7;
QColor back = p.backgroundColor();
bool darkbg = false;
for (int row = 0; row < rows; row++) {
for (int col = 0; col < 7; col++) {
@@ -888,145 +890,143 @@ void CalPrintBase::drawTodo( bool completed, int &count, Todo * item, QPainter &
if ( !completed && item->isCompleted() )
return;
QString outStr;
// int fontHeight = 10;
const KLocale *local = KGlobal::locale();
int priority=item->priority();
int posdue=posDueDt;
if (posdue<0) posdue=x+width;
QRect rect;
TodoParentStart startpt;
// 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();
}
// size of item
outStr=item->summary();
if ( ! item->location().isEmpty() )
outStr += " ("+item->location()+")";
if ( item->hasDueDate() && posDueDt>=0 ) {
outStr += " [" +local->formatDate(item->dtDue().date(),true)+"]";
}
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 );
// if too big make new page
if ( rect.bottom() > y+height) {
// first draw the connection lines from parent todos:
if (level > 0 && connectSubTodos) {
TodoParentStart *rct;
for ( rct = startPoints.first(); rct; rct = startPoints.next() ) {
int start;
int center = rct->mRect.left() + (rct->mRect.width()/2);
int to = p.viewport().bottom();
// draw either from start point of parent or from top of the page
if (rct->mSamePage)
start = rct->mRect.bottom() + 1;
else
start = p.viewport().top();
- p.moveTo( center, start );
- p.lineTo( center, to );
+ p.drawLine( center, start, center, to );
rct->mSamePage=false;
}
}
y=0;
height=pageHeight-y;
mPrinter->newPage();
}
// If this is a sub-item, r will not be 0, and we want the LH side of the priority line up
//to the RH side of the parent item's priority
if (r && pospriority >= 0 ) {
pospriority = r->mRect.right() + 1;
}
// 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
if ( item->isCompleted() ) {
p.drawLine( rect.topLeft(), rect.bottomRight() );
p.drawLine( rect.topRight(), rect.bottomLeft() );
} 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 );
}
}
startpt.mRect = rect; //save for later
// Connect the dots
if (level > 0 && connectSubTodos) {
int bottom;
int center( r->mRect.left() + (r->mRect.width()/2)+1 );
if (r->mSamePage )
bottom = r->mRect.bottom();//lutz + 1;
else
bottom = 0;
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);
}
// if completed, use strike out font
// LR does not work - font is underlined, not striked out
//QFont ft=p.font();
//ft.setStrikeOut( item->isCompleted() );
//p.setFont( ft );
// summary
outStr=item->summary();
if ( ! item->location().isEmpty() )
outStr += " ("+item->location()+")";
if ( item->hasDueDate() && posDueDt>=0 ) {
outStr += " [" +item->dtDueStr(true)+"]";
}
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);
// due
// if ( item->hasDueDate() && posDueDt>=0 ) {
// outStr = local->formatDate(item->dtDue().date(),true);
// rect = p.boundingRect(posdue, y, x+width, -1, AlignTop|AlignLeft, outStr);
// p.drawText(rect, AlignTop|AlignLeft, outStr);
// }
if ( !item->description().isEmpty() && desc ) {
y=newrect.bottom() + 5;
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 );
}
// Set the new line position
y=newrect.bottom() + 10; //set the line position
// If the item has subitems, we need to call ourselves recursively
Incidence::List l;l.fill( item->relations());
Incidence::List::ConstIterator it;
startPoints.append( &startpt );
for( it = l.begin(); it != l.end(); ++it ) {
count++;
drawTodo( completed, count, static_cast<Todo *>( *it ), p, connectSubTodos,
@@ -1129,58 +1129,58 @@ void CalPrintBase::drawSplitWeek( QPainter &p, const QDate &fd,
}
void CalPrintBase::drawSplitHeaderRight( QPainter &p, const QDate &fd,
const QDate &td,
const QDate &,
int width, int )
{
int tempStore = mSubHeaderHeight;
mSubHeaderHeight+= mSubHeaderHeight;
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();
QString title;
QString myOwner(mCalendar->getOwner());
if ( fd.month() == td.month() ) {
title = local->monthName(fd.month(), false) + ' ' + QString::number(fd.day()) + ' '
+ '-' + ' ' + QString::number(td.day());
} else {
title = local->monthName(fd.month(), false) + ' ' + QString::number(fd.day()) + ' '
+ '-' + ' ' + local->monthName(td.month(), false) + ' ' + QString::number(td.day());
}
// Grrrrrrr! why can't I set the font to a serif font?!?!?
QFont serifFont("Helvetica", 30);
// serifFont.setFamily("Serif");
// serifFont.setWeight(87);
// serifFont.setItalic(true);
p.setFont(serifFont);
QFontInfo info(p.font());
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);
p.setPen(penB );
p.drawLine(200, lineSpacing * 1, width, lineSpacing * 1);
p.setPen(penA );
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 ;
}
void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width,
int height, int offsetLeft )
{
int tempStore = mSubHeaderHeight;
mSubHeaderHeight+= mSubHeaderHeight;
int startHour = KOPrefs::instance()->mDayBegins;
int endHour = 20;
int offset = mHeaderHeight + mSubHeaderHeight + 10;
Event::List eventList; eventList.fill( mCalendar->events( qd, true ));
@@ -1188,25 +1188,25 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width,
Event *currEvent;
KLocale *local = KGlobal::locale();
QString dayName;
dayName = local->weekDayName(qd.dayOfWeek()) + ' ' + ' ' + QString::number(qd.day());
//p.setBrush(QBrush(black));
// width+1 to make sure there's a continuous, black bar across the top.
p.setPen( QPen(Qt::black,2));
p.drawRect(offsetLeft, mHeaderHeight + 5, width +1, mSubHeaderHeight);
p.setPen( Qt::black);
p.setFont(QFont("helvetica", 12, QFont::Bold, true));
p.drawText(offsetLeft, mHeaderHeight + 5,
- width, mSubHeaderHeight, AlignHCenter | AlignVCenter,
+ width, mSubHeaderHeight, Qt::AlignHCenter | Qt::AlignVCenter,
dayName);
p.setPen( QPen(Qt::black,2));
p.setFont(QFont("helvetica", 12));
p.setBrush(Qt::white);
it = eventList.begin();
int allDays = 0;
/*
while( it != eventList.end() ) {
Event *currEvent = *it;
if ( currEvent->doesFloat() ) {
p.drawRect( offsetLeft, offset, width, 35 );
@@ -1245,62 +1245,62 @@ void CalPrintBase::drawSplitDay( QPainter &p, const QDate &qd, int width,
startTime -= startHour;
int startMinuteOff = (int) (minuteInc *
currEvent->dtStart().time().minute());
QString text = currEvent->summary() ;
if ( ! currEvent->location().isEmpty() )
text += "\n("+currEvent->location()+")";
int endMinuteOff = (int) (minuteInc * currEvent->dtEnd().time().minute());
int cheight = (int) (minuteInc *
currEvent->dtStart().secsTo(currEvent->dtEnd()) / 60 );
p.drawRect(offsetLeft+2, 1+offset+startMinuteOff+startTime*cellHeight,
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 ;
}
void CalPrintBase::drawSplitTimes( QPainter &p, int width, int timeWidth,
int height )
{
int tempStore = mSubHeaderHeight;
mSubHeaderHeight+= mSubHeaderHeight;
int startHour = KOPrefs::instance()->mDayBegins;
int endHour = 20;
int offset = mHeaderHeight + mSubHeaderHeight + 10;
int hours = endHour - startHour;
int cellHeight = (height-offset) / hours; // hour increments.
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() ) {
numStr.setNum(i+startHour);
if (cellHeight > 40) {
p.setFont(QFont("helvetica", 16, QFont::Bold));
} else {
p.setFont(QFont("helvetica", 14, QFont::Bold));
}
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 );
numStr = KGlobal::locale()->formatTime( time );
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 ;
}
#endif