diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /korganizer/printing/calprintpluginbase.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korganizer/printing/calprintpluginbase.cpp')
-rw-r--r-- | korganizer/printing/calprintpluginbase.cpp | 508 |
1 files changed, 254 insertions, 254 deletions
diff --git a/korganizer/printing/calprintpluginbase.cpp b/korganizer/printing/calprintpluginbase.cpp index 44739db48..6f6762032 100644 --- a/korganizer/printing/calprintpluginbase.cpp +++ b/korganizer/printing/calprintpluginbase.cpp @@ -23,10 +23,10 @@ without including the source code for Qt in the source distribution. */ -#include <qpainter.h> -#include <qlayout.h> -#include <qframe.h> -#include <qlabel.h> +#include <tqpainter.h> +#include <tqlayout.h> +#include <tqframe.h> +#include <tqlabel.h> #include <kdebug.h> #include <kconfig.h> @@ -48,10 +48,10 @@ inline int round(const double x) class CalPrintPluginBase::TodoParentStart { public: - TodoParentStart( QRect pt = QRect(), bool page = true ) + TodoParentStart( TQRect pt = TQRect(), bool page = true ) : mRect( pt ), mSamePage( page ) {} - QRect mRect; + TQRect mRect; bool mSamePage; }; @@ -64,17 +64,17 @@ class CalPrintPluginBase::TodoParentStart class PrintCellItem : public KOrg::CellItem { public: - PrintCellItem( Event *event, const QDateTime &start, const QDateTime &end ) + PrintCellItem( Event *event, const TQDateTime &start, const TQDateTime &end ) : mEvent( event ), mStart( start), mEnd( end ) { } Event *event() const { return mEvent; } - QString label() const { return mEvent->summary(); } + TQString label() const { return mEvent->summary(); } - QDateTime start() const { return mStart; } - QDateTime end() const { return mEnd; } + TQDateTime start() const { return mStart; } + TQDateTime end() const { return mEnd; } /** Calculate the start and end date/time of the recurrence that happens on the given day */ @@ -96,7 +96,7 @@ class PrintCellItem : public KOrg::CellItem private: Event *mEvent; - QDateTime mStart, mEnd; + TQDateTime mStart, mEnd; }; @@ -118,21 +118,21 @@ CalPrintPluginBase::~CalPrintPluginBase() -QWidget *CalPrintPluginBase::createConfigWidget( QWidget *w ) +TQWidget *CalPrintPluginBase::createConfigWidget( TQWidget *w ) { - QFrame *wdg = new QFrame( w ); - QVBoxLayout *layout = new QVBoxLayout( wdg ); + TQFrame *wdg = new TQFrame( w ); + TQVBoxLayout *layout = new TQVBoxLayout( wdg ); - QLabel *title = new QLabel( description(), wdg ); - QFont titleFont( title->font() ); + TQLabel *title = new TQLabel( description(), wdg ); + TQFont titleFont( title->font() ); titleFont.setPointSize( 20 ); titleFont.setBold( true ); title->setFont( titleFont ); layout->addWidget( title ); - layout->addWidget( new QLabel( info(), wdg ) ); + layout->addWidget( new TQLabel( info(), wdg ) ); layout->addSpacing( 20 ); - layout->addWidget( new QLabel( i18n("This printing style does not " + layout->addWidget( new TQLabel( i18n("This printing style does not " "have any configuration options."), wdg ) ); layout->addStretch(); @@ -143,7 +143,7 @@ void CalPrintPluginBase::doPrint( KPrinter *printer ) { if ( !printer ) return; mPrinter = printer; - QPainter p; + TQPainter p; mPrinter->setColorMode( mUseColors?(KPrinter::Color):(KPrinter::GrayScale) ); @@ -155,7 +155,7 @@ void CalPrintPluginBase::doPrint( KPrinter *printer ) p.setViewport( margins, margins, p.viewport().width() - 2*margins, p.viewport().height() - 2*margins ); -// QRect vp( p.viewport() ); +// TQRect vp( p.viewport() ); // vp.setRight( vp.right()*2 ); // vp.setBottom( vp.bottom()*2 ); // p.setWindow( vp ); @@ -175,7 +175,7 @@ void CalPrintPluginBase::doLoadConfig() if ( mConfig ) { KConfigGroupSaver saver( mConfig, description() ); mConfig->sync(); - QDateTime currDate( QDate::currentDate() ); + TQDateTime currDate( TQDate::currentDate() ); mFromDate = mConfig->readDateTimeEntry( "FromDate", &currDate ).date(); mToDate = mConfig->readDateTimeEntry( "ToDate" ).date(); mUseColors = mConfig->readBoolEntry( "UseColors", true ); @@ -191,8 +191,8 @@ void CalPrintPluginBase::doSaveConfig() if ( mConfig ) { KConfigGroupSaver saver( mConfig, description() ); saveConfig(); - mConfig->writeEntry( "FromDate", QDateTime( mFromDate ) ); - mConfig->writeEntry( "ToDate", QDateTime( mToDate ) ); + mConfig->writeEntry( "FromDate", TQDateTime( mFromDate ) ); + mConfig->writeEntry( "ToDate", TQDateTime( mToDate ) ); mConfig->writeEntry( "UseColors", mUseColors ); mConfig->sync(); } else { @@ -226,50 +226,50 @@ KPrinter::Orientation CalPrintPluginBase::orientation() const -QTime CalPrintPluginBase::dayStart() +TQTime CalPrintPluginBase::dayStart() { - QTime start( 8,0,0 ); + TQTime start( 8,0,0 ); if ( mCoreHelper ) start = mCoreHelper->dayStart(); return start; } -void CalPrintPluginBase::setCategoryColors( QPainter &p, Incidence *incidence ) +void CalPrintPluginBase::setCategoryColors( TQPainter &p, Incidence *incidence ) { - QColor bgColor = categoryBgColor( incidence ); + TQColor bgColor = categoryBgColor( incidence ); if ( bgColor.isValid() ) p.setBrush( bgColor ); - QColor tColor( textColor( bgColor ) ); + TQColor tColor( textColor( bgColor ) ); if ( tColor.isValid() ) p.setPen( tColor ); } -QColor CalPrintPluginBase::categoryBgColor( Incidence *incidence ) +TQColor CalPrintPluginBase::categoryBgColor( Incidence *incidence ) { if (mCoreHelper && incidence) return mCoreHelper->categoryColor( incidence->categories() ); else - return QColor(); + return TQColor(); } -QColor CalPrintPluginBase::textColor( const QColor &color ) +TQColor CalPrintPluginBase::textColor( const TQColor &color ) { - return (mCoreHelper)?(mCoreHelper->textColor( color )):QColor(); + return (mCoreHelper)?(mCoreHelper->textColor( color )):TQColor(); } -bool CalPrintPluginBase::isWorkingDay( const QDate &dt ) +bool CalPrintPluginBase::isWorkingDay( const TQDate &dt ) { return (mCoreHelper)?( mCoreHelper->isWorkingDay( dt ) ):true; } -QString CalPrintPluginBase::holidayString( const QDate &dt ) +TQString CalPrintPluginBase::holidayString( const TQDate &dt ) { - return (mCoreHelper)?(mCoreHelper->holidayString(dt)):(QString::null); + return (mCoreHelper)?(mCoreHelper->holidayString(dt)):(TQString::null); } -Event *CalPrintPluginBase::holiday( const QDate &dt ) +Event *CalPrintPluginBase::holiday( const TQDate &dt ) { - QString hstring( holidayString( dt ) ); + TQString hstring( holidayString( dt ) ); if ( !hstring.isEmpty() ) { Event*holiday=new Event(); holiday->setSummary( hstring ); @@ -344,41 +344,41 @@ void CalPrintPluginBase::setBorderWidth( const int borderwidth ) -void CalPrintPluginBase::drawBox( QPainter &p, int linewidth, const QRect &rect ) +void CalPrintPluginBase::drawBox( TQPainter &p, int linewidth, const TQRect &rect ) { - QPen pen( p.pen() ); - QPen oldpen( pen ); + TQPen pen( p.pen() ); + TQPen oldpen( pen ); pen.setWidth( linewidth ); p.setPen( pen ); p.drawRect( rect ); p.setPen( oldpen ); } -void CalPrintPluginBase::drawShadedBox( QPainter &p, int linewidth, const QBrush &brush, const QRect &rect ) +void CalPrintPluginBase::drawShadedBox( TQPainter &p, int linewidth, const TQBrush &brush, const TQRect &rect ) { - QBrush oldbrush( p.brush() ); + TQBrush oldbrush( p.brush() ); p.setBrush( brush ); drawBox( p, linewidth, rect ); p.setBrush( oldbrush ); } -void CalPrintPluginBase::printEventString( QPainter &p, const QRect &box, const QString &str, int flags ) +void CalPrintPluginBase::printEventString( TQPainter &p, const TQRect &box, const TQString &str, int flags ) { - QRect newbox( box ); + TQRect newbox( box ); newbox.addCoords( 3, 1, -1, -1 ); p.drawText( newbox, (flags==-1)?(Qt::AlignTop | Qt::AlignJustify | Qt::BreakAnywhere):flags, str ); } -void CalPrintPluginBase::showEventBox( QPainter &p, const QRect &box, Incidence *incidence, const QString &str, int flags ) +void CalPrintPluginBase::showEventBox( TQPainter &p, const TQRect &box, Incidence *incidence, const TQString &str, int flags ) { - QPen oldpen( p.pen() ); - QBrush oldbrush( p.brush() ); - QColor bgColor( categoryBgColor( incidence ) ); + TQPen oldpen( p.pen() ); + TQBrush oldbrush( p.brush() ); + TQColor bgColor( categoryBgColor( incidence ) ); if ( mUseColors & bgColor.isValid() ) { p.setBrush( bgColor ); } else { - p.setBrush( QColor( 232, 232, 232 ) ); + p.setBrush( TQColor( 232, 232, 232 ) ); } drawBox( p, EVENT_BORDER_WIDTH, box ); @@ -391,21 +391,21 @@ void CalPrintPluginBase::showEventBox( QPainter &p, const QRect &box, Incidence } -void CalPrintPluginBase::drawSubHeaderBox(QPainter &p, const QString &str, - const QRect &box ) +void CalPrintPluginBase::drawSubHeaderBox(TQPainter &p, const TQString &str, + const TQRect &box ) { - drawShadedBox( p, BOX_BORDER_WIDTH, QColor( 232, 232, 232 ), box ); - QFont oldfont( p.font() ); - p.setFont( QFont( "sans-serif", 10, QFont::Bold ) ); + drawShadedBox( p, BOX_BORDER_WIDTH, TQColor( 232, 232, 232 ), box ); + TQFont oldfont( p.font() ); + p.setFont( TQFont( "sans-serif", 10, TQFont::Bold ) ); p.drawText( box, Qt::AlignCenter | Qt::AlignVCenter, str ); p.setFont( oldfont ); } -void CalPrintPluginBase::drawVerticalBox( QPainter &p, const QRect &box, const QString &str ) +void CalPrintPluginBase::drawVerticalBox( TQPainter &p, const TQRect &box, const TQString &str ) { p.save(); p.rotate( -90 ); - QRect rotatedBox( -box.top()-box.height(), box.left(), box.height(), box.width() ); + TQRect rotatedBox( -box.top()-box.height(), box.left(), box.height(), box.width() ); showEventBox( p, rotatedBox, 0, str, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine ); p.restore(); @@ -417,20 +417,20 @@ void CalPrintPluginBase::drawVerticalBox( QPainter &p, const QRect &box, const Q // Return value: If expand, bottom of the printed box, otherwise vertical end // of the printed contents inside the box. -int CalPrintPluginBase::drawBoxWithCaption( QPainter &p, const QRect &allbox, - const QString &caption, const QString &contents, bool sameLine, bool expand, const QFont &captionFont, const QFont &textFont ) +int CalPrintPluginBase::drawBoxWithCaption( TQPainter &p, const TQRect &allbox, + const TQString &caption, const TQString &contents, bool sameLine, bool expand, const TQFont &captionFont, const TQFont &textFont ) { - QFont oldFont( p.font() ); -// QFont captionFont( "sans-serif", 11, QFont::Bold ); -// QFont textFont( "sans-serif", 11, QFont::Normal ); -// QFont captionFont( "Tahoma", 11, QFont::Bold ); -// QFont textFont( "Tahoma", 11, QFont::Normal ); + TQFont oldFont( p.font() ); +// TQFont captionFont( "sans-serif", 11, TQFont::Bold ); +// TQFont textFont( "sans-serif", 11, TQFont::Normal ); +// TQFont captionFont( "Tahoma", 11, TQFont::Bold ); +// TQFont textFont( "Tahoma", 11, TQFont::Normal ); - QRect box( allbox ); + TQRect box( allbox ); // Bounding rectangle for caption, single-line, clip on the right - QRect captionBox( box.left() + padding(), box.top() + padding(), 0, 0 ); + TQRect captionBox( box.left() + padding(), box.top() + padding(), 0, 0 ); p.setFont( captionFont ); captionBox = p.boundingRect( captionBox, Qt::AlignLeft | Qt::AlignTop | Qt::SingleLine, caption ); p.setFont( oldFont ); @@ -440,7 +440,7 @@ int CalPrintPluginBase::drawBoxWithCaption( QPainter &p, const QRect &allbox, box.setBottom( captionBox.bottom() + padding() ); // Bounding rectangle for the contents (if any), word break, clip on the bottom - QRect textBox( captionBox ); + TQRect textBox( captionBox ); if ( !contents.isEmpty() ) { if ( sameLine ) { textBox.setLeft( captionBox.right() + padding() ); @@ -480,8 +480,8 @@ int CalPrintPluginBase::drawBoxWithCaption( QPainter &p, const QRect &allbox, /////////////////////////////////////////////////////////////////////////////// -int CalPrintPluginBase::drawHeader( QPainter &p, QString title, - const QDate &month1, const QDate &month2, const QRect &allbox, bool expand ) +int CalPrintPluginBase::drawHeader( TQPainter &p, TQString title, + const TQDate &month1, const TQDate &month2, const TQRect &allbox, bool expand ) { // print previous month for month view, print current for to-do, day and week int smallMonthWidth = (allbox.width()/4) - 10; @@ -490,17 +490,17 @@ int CalPrintPluginBase::drawHeader( QPainter &p, QString title, int right = allbox.right(); if ( month1.isValid() ) right -= (20+smallMonthWidth); if ( month2.isValid() ) right -= (20+smallMonthWidth); - QRect box( allbox ); - QRect textRect( allbox ); + TQRect box( allbox ); + TQRect textRect( allbox ); textRect.addCoords( 5, 0, 0, 0 ); textRect.setRight( right ); - QFont oldFont( p.font() ); - QFont newFont("sans-serif", (textRect.height()<60)?16:18, QFont::Bold); + TQFont oldFont( p.font() ); + TQFont newFont("sans-serif", (textRect.height()<60)?16:18, TQFont::Bold); if ( expand ) { p.setFont( newFont ); - QRect boundingR = p.boundingRect( textRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::WordBreak, title ); + TQRect boundingR = p.boundingRect( textRect, Qt::AlignLeft | Qt::AlignVCenter | Qt::WordBreak, title ); p.setFont( oldFont ); int h = boundingR.height(); if ( h > allbox.height() ) { @@ -509,15 +509,15 @@ int CalPrintPluginBase::drawHeader( QPainter &p, QString title, } } - drawShadedBox( p, BOX_BORDER_WIDTH, QColor( 232, 232, 232 ), box ); + drawShadedBox( p, BOX_BORDER_WIDTH, TQColor( 232, 232, 232 ), box ); - QRect monthbox( box.right()-10-smallMonthWidth, box.top(), smallMonthWidth, box.height() ); + TQRect monthbox( box.right()-10-smallMonthWidth, box.top(), smallMonthWidth, box.height() ); if (month2.isValid()) { - drawSmallMonth( p, QDate(month2.year(), month2.month(), 1), monthbox ); + drawSmallMonth( p, TQDate(month2.year(), month2.month(), 1), monthbox ); monthbox.moveBy( -20 - smallMonthWidth, 0 ); } if (month1.isValid()) { - drawSmallMonth( p, QDate(month1.year(), month1.month(), 1), monthbox ); + drawSmallMonth( p, TQDate(month1.year(), month1.month(), 1), monthbox ); monthbox.moveBy( -20 - smallMonthWidth, 0 ); } @@ -530,38 +530,38 @@ int CalPrintPluginBase::drawHeader( QPainter &p, QString title, } -void CalPrintPluginBase::drawSmallMonth(QPainter &p, const QDate &qd, - const QRect &box ) +void CalPrintPluginBase::drawSmallMonth(TQPainter &p, const TQDate &qd, + const TQRect &box ) { int weekdayCol = weekdayColumn( qd.dayOfWeek() ); int month = qd.month(); - QDate monthDate(QDate(qd.year(), qd.month(), 1)); + TQDate monthDate(TQDate(qd.year(), qd.month(), 1)); // correct begin of week - QDate monthDate2( monthDate.addDays( -weekdayCol ) ); + TQDate monthDate2( monthDate.addDays( -weekdayCol ) ); double cellWidth = double(box.width())/double(7); int rownr = 3 + ( qd.daysInMonth() + weekdayCol - 1 ) / 7; // 3 Pixel after month name, 2 after day names, 1 after the calendar double cellHeight = (box.height() - 5) / rownr; - QFont oldFont( p.font() ); - p.setFont(QFont("sans-serif", int(cellHeight-1), QFont::Normal)); + TQFont oldFont( p.font() ); + p.setFont(TQFont("sans-serif", int(cellHeight-1), TQFont::Normal)); // draw the title if ( mCalSys ) { - QRect titleBox( box ); + TQRect titleBox( box ); titleBox.setHeight( int(cellHeight+1) ); p.drawText( titleBox, Qt::AlignTop | Qt::AlignHCenter, mCalSys->monthName( qd ) ); } // draw days of week - QRect wdayBox( box ); + TQRect wdayBox( box ); wdayBox.setTop( int( box.top() + 3 + cellHeight ) ); wdayBox.setHeight( int(2*cellHeight)-int(cellHeight) ); if ( mCalSys ) { for (int col = 0; col < 7; ++col) { - QString tmpStr = mCalSys->weekDayName( monthDate2 )[0].upper(); + TQString tmpStr = mCalSys->weekDayName( monthDate2 )[0].upper(); wdayBox.setLeft( int(box.left() + col*cellWidth) ); wdayBox.setRight( int(box.left() + (col+1)*cellWidth) ); p.drawText( wdayBox, Qt::AlignCenter, tmpStr ); @@ -577,10 +577,10 @@ void CalPrintPluginBase::drawSmallMonth(QPainter &p, const QDate &qd, for ( int row = 0; row < (rownr-2); row++ ) { for ( int col = 0; col < 7; col++ ) { if ( monthDate.month() == month ) { - QRect dayRect( int( box.left() + col*cellWidth ), int( calStartY + row*cellHeight ), 0, 0 ); + TQRect dayRect( int( box.left() + col*cellWidth ), int( calStartY + row*cellHeight ), 0, 0 ); dayRect.setRight( int( box.left() + (col+1)*cellWidth ) ); dayRect.setBottom( int( calStartY + (row+1)*cellHeight ) ); - p.drawText( dayRect, Qt::AlignCenter, QString::number( monthDate.day() ) ); + p.drawText( dayRect, Qt::AlignCenter, TQString::number( monthDate.day() ) ); } monthDate = monthDate.addDays(1); } @@ -598,12 +598,12 @@ void CalPrintPluginBase::drawSmallMonth(QPainter &p, const QDate &qd, * This routine draws a header box over the main part of the calendar * containing the days of the week. */ -void CalPrintPluginBase::drawDaysOfWeek(QPainter &p, - const QDate &fromDate, const QDate &toDate, const QRect &box ) +void CalPrintPluginBase::drawDaysOfWeek(TQPainter &p, + const TQDate &fromDate, const TQDate &toDate, const TQRect &box ) { double cellWidth = double(box.width()) / double(fromDate.daysTo( toDate )+1); - QDate cellDate( fromDate ); - QRect dateBox( box ); + TQDate cellDate( fromDate ); + TQRect dateBox( box ); int i = 0; while ( cellDate <= toDate ) { @@ -616,16 +616,16 @@ void CalPrintPluginBase::drawDaysOfWeek(QPainter &p, } -void CalPrintPluginBase::drawDaysOfWeekBox(QPainter &p, const QDate &qd, - const QRect &box ) +void CalPrintPluginBase::drawDaysOfWeekBox(TQPainter &p, const TQDate &qd, + const TQRect &box ) { - drawSubHeaderBox( p, (mCalSys)?(mCalSys->weekDayName( qd )):(QString::null), box ); + drawSubHeaderBox( p, (mCalSys)?(mCalSys->weekDayName( qd )):(TQString::null), box ); } -void CalPrintPluginBase::drawTimeLine(QPainter &p, - const QTime &fromTime, const QTime &toTime, - const QRect &box) +void CalPrintPluginBase::drawTimeLine(TQPainter &p, + const TQTime &fromTime, const TQTime &toTime, + const TQRect &box) { drawBox( p, BOX_BORDER_WIDTH, box ); @@ -636,46 +636,46 @@ void CalPrintPluginBase::drawTimeLine(QPainter &p, // TODO: Don't use half of the width, but less, for the minutes! int xcenter = box.left()+box.width()/2; - QTime curTime( fromTime ); - QTime endTime( toTime ); + TQTime curTime( fromTime ); + TQTime endTime( toTime ); if ( fromTime.minute() > 30 ) - curTime = QTime( fromTime.hour()+1, 0, 0 ); + curTime = TQTime( fromTime.hour()+1, 0, 0 ); else if ( fromTime.minute() > 0 ) { - curTime = QTime( fromTime.hour(), 30, 0 ); + curTime = TQTime( fromTime.hour(), 30, 0 ); float yy = currY + minlen*(float)fromTime.secsTo( curTime )/60.; p.drawLine( xcenter, (int)yy, box.right(), (int)yy ); - curTime = QTime( fromTime.hour()+1, 0, 0 ); + curTime = TQTime( fromTime.hour()+1, 0, 0 ); } currY += ( float( fromTime.secsTo(curTime)*minlen ) / 60. ); while ( curTime < endTime ) { p.drawLine( box.left(), (int)currY, box.right(), (int)currY ); int newY=(int)(currY+cellHeight/2.); - QString numStr; + TQString numStr; if ( newY < box.bottom() ) { - QFont oldFont( p.font() ); + TQFont oldFont( p.font() ); // draw the time: if ( !KGlobal::locale()->use12Clock() ) { p.drawLine( xcenter, (int)newY, box.right(), (int)newY); numStr.setNum(curTime.hour()); if (cellHeight > 30) { - p.setFont(QFont("sans-serif", 16, QFont::Bold)); + p.setFont(TQFont("sans-serif", 16, TQFont::Bold)); } else { - p.setFont(QFont("sans-serif", 12, QFont::Bold)); + p.setFont(TQFont("sans-serif", 12, TQFont::Bold)); } p.drawText( box.left()+2, (int)currY+2, box.width()/2-2, (int)cellHeight, Qt::AlignTop | Qt::AlignRight, numStr); - p.setFont(QFont("sans-serif", 10, QFont::Normal)); + p.setFont(TQFont("sans-serif", 10, TQFont::Normal)); p.drawText( xcenter, (int)currY+2, box.width()/2+2, (int)(cellHeight/2)-3, Qt::AlignTop | Qt::AlignLeft, "00"); } else { p.drawLine( box.left(), (int)newY, box.right(), (int)newY); - QTime time( curTime.hour(), 0 ); + TQTime time( curTime.hour(), 0 ); numStr = KGlobal::locale()->formatTime( time ); if ( box.width() < 60 ) { - p.setFont(QFont("sans-serif", 8, QFont::Bold)); // for weekprint + p.setFont(TQFont("sans-serif", 8, TQFont::Bold)); // for weekprint } else { - p.setFont(QFont("sans-serif", 12, QFont::Bold)); // for dayprint + p.setFont(TQFont("sans-serif", 12, TQFont::Bold)); // for dayprint } p.drawText(box.left()+2, (int)currY+2, box.width()-4, (int)cellHeight/2-3, Qt::AlignTop|Qt::AlignLeft, numStr); @@ -697,14 +697,14 @@ void CalPrintPluginBase::drawTimeLine(QPainter &p, be the total height used for the all-day events. If !expandable, only one cell will be used, and multiple events are concatenated using ", ". */ -int CalPrintPluginBase::drawAllDayBox(QPainter &p, Event::List &eventList, - const QDate &qd, bool expandable, const QRect &box ) +int CalPrintPluginBase::drawAllDayBox(TQPainter &p, Event::List &eventList, + const TQDate &qd, bool expandable, const TQRect &box ) { Event::List::Iterator it, itold; int offset=box.top(); - QString multiDayStr; + TQString multiDayStr; Event*hd = holiday( qd ); if ( hd ) eventList.prepend( hd ); @@ -719,7 +719,7 @@ int CalPrintPluginBase::drawAllDayBox(QPainter &p, Event::List &eventList, if ( currEvent && currEvent->doesFloat() ) { // set the colors according to the categories if ( expandable ) { - QRect eventBox( box ); + TQRect eventBox( box ); eventBox.setTop( offset ); showEventBox( p, eventBox, currEvent, currEvent->summary() ); offset += box.height(); @@ -733,10 +733,10 @@ int CalPrintPluginBase::drawAllDayBox(QPainter &p, Event::List &eventList, if ( hd ) delete hd; int ret = box.height(); - QRect eventBox( box ); + TQRect eventBox( box ); if (!expandable) { if (!multiDayStr.isEmpty()) { - drawShadedBox( p, BOX_BORDER_WIDTH, QColor( 128, 128, 128 ), eventBox ); + drawShadedBox( p, BOX_BORDER_WIDTH, TQColor( 128, 128, 128 ), eventBox ); printEventString( p, eventBox, multiDayStr ); } else { drawBox( p, BOX_BORDER_WIDTH, eventBox ); @@ -750,17 +750,17 @@ int CalPrintPluginBase::drawAllDayBox(QPainter &p, Event::List &eventList, } -void CalPrintPluginBase::drawAgendaDayBox( QPainter &p, Event::List &events, - const QDate &qd, bool expandable, - QTime &fromTime, QTime &toTime, - const QRect &oldbox ) +void CalPrintPluginBase::drawAgendaDayBox( TQPainter &p, Event::List &events, + const TQDate &qd, bool expandable, + TQTime &fromTime, TQTime &toTime, + const TQRect &oldbox ) { if ( !isWorkingDay( qd ) ) { - drawShadedBox( p, BOX_BORDER_WIDTH, QColor( 232, 232, 232 ), oldbox ); + drawShadedBox( p, BOX_BORDER_WIDTH, TQColor( 232, 232, 232 ), oldbox ); } else { drawBox( p, BOX_BORDER_WIDTH, oldbox ); } - QRect box( oldbox ); + TQRect box( oldbox ); // Account for the border with and cut away that margin from the interior // box.setRight( box.right()-BOX_BORDER_WIDTH ); @@ -780,7 +780,7 @@ void CalPrintPluginBase::drawAgendaDayBox( QPainter &p, Event::List &events, // Show at least one hour // if ( fromTime.secsTo( toTime ) < 3600 ) { -// fromTime = QTime( fromTime.hour(), 0, 0 ); +// fromTime = TQTime( fromTime.hour(), 0, 0 ); // toTime = fromTime.addSecs( 3600 ); // } @@ -791,7 +791,7 @@ void CalPrintPluginBase::drawAgendaDayBox( QPainter &p, Event::List &events, float currY = box.top(); // print grid: - QTime curTime( QTime( fromTime.hour(), 0, 0 ) ); + TQTime curTime( TQTime( fromTime.hour(), 0, 0 ) ); currY += fromTime.secsTo( curTime ) * minlen / 60; while ( curTime < toTime && curTime.isValid() ) { @@ -800,8 +800,8 @@ void CalPrintPluginBase::drawAgendaDayBox( QPainter &p, Event::List &events, currY += cellHeight / 2; if ( ( currY > box.top() ) && ( currY < box.bottom() ) ) { // enough space for half-hour line - QPen oldPen( p.pen() ); - p.setPen( QColor( 192, 192, 192 ) ); + TQPen oldPen( p.pen() ); + p.setPen( TQColor( 192, 192, 192 ) ); p.drawLine( box.left(), int( currY ), box.right(), int( currY ) ); p.setPen( oldPen ); } @@ -811,31 +811,31 @@ void CalPrintPluginBase::drawAgendaDayBox( QPainter &p, Event::List &events, currY += cellHeight / 2; } - QDateTime startPrintDate = QDateTime( qd, fromTime ); - QDateTime endPrintDate = QDateTime( qd, toTime ); + TQDateTime startPrintDate = TQDateTime( qd, fromTime ); + TQDateTime endPrintDate = TQDateTime( qd, toTime ); // Calculate horizontal positions and widths of events taking into account // overlapping events - QPtrList<KOrg::CellItem> cells; + TQPtrList<KOrg::CellItem> cells; cells.setAutoDelete( true ); Event::List::ConstIterator itEvents; for( itEvents = events.begin(); itEvents != events.end(); ++itEvents ) { - QValueList<QDateTime> times = (*itEvents)->startDateTimesForDate( qd ); - for ( QValueList<QDateTime>::ConstIterator it = times.begin(); + TQValueList<TQDateTime> times = (*itEvents)->startDateTimesForDate( qd ); + for ( TQValueList<TQDateTime>::ConstIterator it = times.begin(); it != times.end(); ++it ) { cells.append( new PrintCellItem( *itEvents, (*it), (*itEvents)->endDateForStart( *it ) ) ); } } - QPtrListIterator<KOrg::CellItem> it1( cells ); + TQPtrListIterator<KOrg::CellItem> it1( cells ); for( it1.toFirst(); it1.current(); ++it1 ) { KOrg::CellItem *placeItem = it1.current(); KOrg::CellItem::placeItem( cells, placeItem ); } -// p.setFont( QFont( "sans-serif", 10 ) ); +// p.setFont( TQFont( "sans-serif", 10 ) ); for( it1.toFirst(); it1.current(); ++it1 ) { PrintCellItem *placeItem = static_cast<PrintCellItem *>( it1.current() ); @@ -846,16 +846,16 @@ void CalPrintPluginBase::drawAgendaDayBox( QPainter &p, Event::List &events, -void CalPrintPluginBase::drawAgendaItem( PrintCellItem *item, QPainter &p, - const QDateTime &startPrintDate, - const QDateTime &endPrintDate, - float minlen, const QRect &box ) +void CalPrintPluginBase::drawAgendaItem( PrintCellItem *item, TQPainter &p, + const TQDateTime &startPrintDate, + const TQDateTime &endPrintDate, + float minlen, const TQRect &box ) { Event *event = item->event(); // start/end of print area for event - QDateTime startTime = item->start(); - QDateTime endTime = item->end(); + TQDateTime startTime = item->start(); + TQDateTime endTime = item->end(); if ( ( startTime < endPrintDate && endTime > startPrintDate ) || ( endTime > startPrintDate && startTime < endPrintDate ) ) { if ( startTime < startPrintDate ) startTime = startPrintDate; @@ -866,18 +866,18 @@ void CalPrintPluginBase::drawAgendaItem( PrintCellItem *item, QPainter &p, minlen / 60. ); int currentHeight = int( box.top() + startPrintDate.secsTo( endTime ) * minlen / 60. ) - currentYPos; - QRect eventBox( currentX, currentYPos, currentWidth, currentHeight ); + TQRect eventBox( currentX, currentYPos, currentWidth, currentHeight ); showEventBox( p, eventBox, event, event->summary() ); } } //TODO TODO TODO -void CalPrintPluginBase::drawDayBox( QPainter &p, const QDate &qd, - const QRect &box, +void CalPrintPluginBase::drawDayBox( TQPainter &p, const TQDate &qd, + const TQRect &box, bool fullDate, bool printRecurDaily, bool printRecurWeekly ) { - QString dayNumStr; - QString ampm; + TQString dayNumStr; + TQString ampm; const KLocale*local = KGlobal::locale(); @@ -890,33 +890,33 @@ void CalPrintPluginBase::drawDayBox( QPainter &p, const QDate &qd, .arg( qd.day() ); // dayNumStr = local->formatDate(qd); } else { - dayNumStr = QString::number( qd.day() ); + dayNumStr = TQString::number( qd.day() ); } - QRect subHeaderBox( box ); + TQRect subHeaderBox( box ); subHeaderBox.setHeight( mSubHeaderHeight ); drawShadedBox( p, BOX_BORDER_WIDTH, p.backgroundColor(), box ); - drawShadedBox( p, 0, QColor( 232, 232, 232 ), subHeaderBox ); + drawShadedBox( p, 0, TQColor( 232, 232, 232 ), subHeaderBox ); drawBox( p, BOX_BORDER_WIDTH, box ); - QString hstring( holidayString( qd ) ); - QFont oldFont( p.font() ); + TQString hstring( holidayString( qd ) ); + TQFont oldFont( p.font() ); - QRect headerTextBox( subHeaderBox ); + TQRect headerTextBox( subHeaderBox ); headerTextBox.setLeft( subHeaderBox.left()+5 ); headerTextBox.setRight( subHeaderBox.right()-5 ); if (!hstring.isEmpty()) { - p.setFont( QFont( "sans-serif", 8, QFont::Bold, true ) ); + p.setFont( TQFont( "sans-serif", 8, TQFont::Bold, true ) ); p.drawText( headerTextBox, Qt::AlignLeft | Qt::AlignVCenter, hstring ); } - p.setFont(QFont("sans-serif", 10, QFont::Bold)); + p.setFont(TQFont("sans-serif", 10, TQFont::Bold)); p.drawText( headerTextBox, Qt::AlignRight | Qt::AlignVCenter, dayNumStr); Event::List eventList = mCalendar->events( qd, EventSortStartDate, SortDirectionAscending ); - QString text; - p.setFont( QFont( "sans-serif", 8 ) ); + TQString text; + p.setFont( TQFont( "sans-serif", 8 ) ); int textY=mSubHeaderHeight+3; // gives the relative y-coord of the next printed entry Event::List::ConstIterator it; @@ -954,19 +954,19 @@ void CalPrintPluginBase::drawDayBox( QPainter &p, const QDate &qd, } // TODO TODO TODO -void CalPrintPluginBase::drawIncidence( QPainter &p, const QRect &dayBox, const QString &time, const QString &summary, int &textY ) +void CalPrintPluginBase::drawIncidence( TQPainter &p, const TQRect &dayBox, const TQString &time, const TQString &summary, int &textY ) { kdDebug(5850) << "summary = " << summary << endl; int flags = Qt::AlignLeft; - QFontMetrics fm = p.fontMetrics(); - QRect timeBound = p.boundingRect( dayBox.x() + 5, dayBox.y() + textY, + TQFontMetrics fm = p.fontMetrics(); + TQRect timeBound = p.boundingRect( dayBox.x() + 5, dayBox.y() + textY, dayBox.width() - 10, fm.lineSpacing(), flags, time ); p.drawText( timeBound, flags, time ); int summaryWidth = time.isEmpty() ? 0 : timeBound.width() + 4; - QRect summaryBound = QRect( dayBox.x() + 5 + summaryWidth, dayBox.y() + textY, + TQRect summaryBound = TQRect( dayBox.x() + 5 + summaryWidth, dayBox.y() + textY, dayBox.width() - summaryWidth -5, dayBox.height() ); KWordWrap *ww = KWordWrap::formatText( fm, summaryBound, flags, summary ); @@ -980,9 +980,9 @@ void CalPrintPluginBase::drawIncidence( QPainter &p, const QRect &dayBox, const /////////////////////////////////////////////////////////////////////////////// -void CalPrintPluginBase::drawWeek(QPainter &p, const QDate &qd, const QRect &box ) +void CalPrintPluginBase::drawWeek(TQPainter &p, const TQDate &qd, const TQRect &box ) { - QDate weekDate = qd; + TQDate weekDate = qd; bool portrait = ( box.height() > box.width() ); int cellWidth, cellHeight; int vcells; @@ -1003,40 +1003,40 @@ void CalPrintPluginBase::drawWeek(QPainter &p, const QDate &qd, const QRect &box // Saturday and sunday share a cell, so we have to special-case sunday int hpos = ((i<6)?i:(i-1)) / vcells; int vpos = ((i<6)?i:(i-1)) % vcells; - QRect dayBox( box.left()+cellWidth*hpos, box.top()+cellHeight*vpos + ((i==6)?(cellHeight/2):0), + TQRect dayBox( box.left()+cellWidth*hpos, box.top()+cellHeight*vpos + ((i==6)?(cellHeight/2):0), cellWidth, (i<5)?(cellHeight):(cellHeight/2) ); drawDayBox(p, weekDate, dayBox, true); } // for i through all weekdays } -void CalPrintPluginBase::drawTimeTable(QPainter &p, - const QDate &fromDate, const QDate &toDate, - QTime &fromTime, QTime &toTime, - const QRect &box) +void CalPrintPluginBase::drawTimeTable(TQPainter &p, + const TQDate &fromDate, const TQDate &toDate, + TQTime &fromTime, TQTime &toTime, + const TQRect &box) { // timeline is 1 hour: int alldayHeight = (int)( 3600.*box.height()/(fromTime.secsTo(toTime)+3600.) ); int timelineWidth = TIMELINE_WIDTH; - QRect dowBox( box ); + TQRect dowBox( box ); dowBox.setLeft( box.left() + timelineWidth ); dowBox.setHeight( mSubHeaderHeight ); drawDaysOfWeek( p, fromDate, toDate, dowBox ); - QRect tlBox( box ); + TQRect tlBox( box ); tlBox.setWidth( timelineWidth ); tlBox.setTop( dowBox.bottom() + BOX_BORDER_WIDTH + alldayHeight ); drawTimeLine( p, fromTime, toTime, tlBox ); // draw each day - QDate curDate(fromDate); + TQDate curDate(fromDate); int i=0; double cellWidth = double(dowBox.width()) / double(fromDate.daysTo(toDate)+1); while (curDate<=toDate) { - QRect allDayBox( dowBox.left()+int(i*cellWidth), dowBox.bottom() + BOX_BORDER_WIDTH, + TQRect allDayBox( dowBox.left()+int(i*cellWidth), dowBox.bottom() + BOX_BORDER_WIDTH, int((i+1)*cellWidth)-int(i*cellWidth), alldayHeight ); - QRect dayBox( allDayBox ); + TQRect dayBox( allDayBox ); dayBox.setTop( tlBox.top() ); dayBox.setBottom( box.bottom() ); Event::List eventList = mCalendar->events(curDate, @@ -1057,33 +1057,33 @@ class MonthEventStruct { public: MonthEventStruct() : event(0) {} - MonthEventStruct( const QDateTime &s, const QDateTime &e, Event *ev) + MonthEventStruct( const TQDateTime &s, const TQDateTime &e, Event *ev) { event = ev; start = s; end = e; if ( event->doesFloat() ) { - start = QDateTime( start.date(), QTime(0,0,0) ); - end = QDateTime( end.date().addDays(1), QTime(0,0,0) ).addSecs(-1); + start = TQDateTime( start.date(), TQTime(0,0,0) ); + end = TQDateTime( end.date().addDays(1), TQTime(0,0,0) ).addSecs(-1); } } bool operator<(const MonthEventStruct &mes) { return start < mes.start; } - QDateTime start; - QDateTime end; + TQDateTime start; + TQDateTime end; Event *event; }; -void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &box, int maxdays, int subDailyFlags, int holidaysFlags ) +void CalPrintPluginBase::drawMonth( TQPainter &p, const TQDate &dt, const TQRect &box, int maxdays, int subDailyFlags, int holidaysFlags ) { const KCalendarSystem *calsys = calendarSystem(); - QRect subheaderBox( box ); + TQRect subheaderBox( box ); subheaderBox.setHeight( subHeaderHeight() ); - QRect borderBox( box ); + TQRect borderBox( box ); borderBox.setTop( subheaderBox.bottom()+1 ); drawSubHeaderBox( p, calsys->monthName(dt), subheaderBox ); // correct for half the border width int correction = (BOX_BORDER_WIDTH/*-1*/)/2; - QRect daysBox( borderBox ); + TQRect daysBox( borderBox ); daysBox.addCoords( correction, correction, -correction, -correction ); int daysinmonth = calsys->daysInMonth( dt ); @@ -1092,43 +1092,43 @@ void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &b int d; float dayheight = float(daysBox.height()) / float( maxdays ); - QColor holidayColor( 240, 240, 240 ); - QColor workdayColor( 255, 255, 255 ); + TQColor holidayColor( 240, 240, 240 ); + TQColor workdayColor( 255, 255, 255 ); int dayNrWidth = p.fontMetrics().width( "99" ); // Fill the remaining space (if a month has less days than others) with a crossed-out pattern if ( daysinmonth<maxdays ) { - QRect dayBox( box.left(), daysBox.top() + round(dayheight*daysinmonth), box.width(), 0 ); + TQRect dayBox( box.left(), daysBox.top() + round(dayheight*daysinmonth), box.width(), 0 ); dayBox.setBottom( daysBox.bottom() ); p.fillRect( dayBox, Qt::DiagCrossPattern ); } // Backgrounded boxes for each day, plus day numbers - QBrush oldbrush( p.brush() ); + TQBrush oldbrush( p.brush() ); for ( d = 0; d < daysinmonth; ++d ) { - QDate day; + TQDate day; calsys->setYMD( day, dt.year(), dt.month(), d+1 ); - QRect dayBox( daysBox.left()/*+rand()%50*/, daysBox.top() + round(dayheight*d), daysBox.width()/*-rand()%50*/, 0 ); + TQRect dayBox( daysBox.left()/*+rand()%50*/, daysBox.top() + round(dayheight*d), daysBox.width()/*-rand()%50*/, 0 ); // FIXME: When using a border width of 0 for event boxes, don't let the rectangles overlap, i.e. subtract 1 from the top or bottom! dayBox.setBottom( daysBox.top()+round(dayheight*(d+1)) - 1 ); p.setBrush( isWorkingDay( day )?workdayColor:holidayColor ); p.drawRect( dayBox ); - QRect dateBox( dayBox ); + TQRect dateBox( dayBox ); dateBox.setWidth( dayNrWidth+3 ); p.drawText( dateBox, Qt::AlignRight | Qt::AlignVCenter | Qt::SingleLine, - QString::number(d+1) ); + TQString::number(d+1) ); } p.setBrush( oldbrush ); int xstartcont = box.left() + dayNrWidth + 5; - QDate start, end; + TQDate start, end; calsys->setYMD( start, dt.year(), dt.month(), 1 ); end = calsys->addMonths( start, 1 ); end = calsys->addDays( end, -1 ); Event::List events = mCalendar->events( start, end ); - QMap<int, QStringList> textEvents; - QPtrList<KOrg::CellItem> timeboxItems; + TQMap<int, TQStringList> textEvents; + TQPtrList<KOrg::CellItem> timeboxItems; timeboxItems.setAutoDelete( true ); @@ -1141,13 +1141,13 @@ void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &b // Holidays Event::List holidays; holidays.setAutoDelete( true ); - for ( QDate d(start); d <= end; d = d.addDays(1) ) { + for ( TQDate d(start); d <= end; d = d.addDays(1) ) { Event *e = holiday( d ); if ( e ) { holidays.append( e ); if ( holidaysFlags & TimeBoxes ) { - timeboxItems.append( new PrintCellItem( e, QDateTime(d, QTime(0,0,0) ), - QDateTime( d.addDays(1), QTime(0,0,0) ) ) ); + timeboxItems.append( new PrintCellItem( e, TQDateTime(d, TQTime(0,0,0) ), + TQDateTime( d.addDays(1), TQTime(0,0,0) ) ) ); } if ( holidaysFlags & Text ) { textEvents[ d.day() ] << e->summary(); @@ -1155,7 +1155,7 @@ void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &b } } - QValueList<MonthEventStruct> monthentries; + TQValueList<MonthEventStruct> monthentries; for ( Event::List::ConstIterator evit = events.begin(); evit != events.end(); ++evit ) { @@ -1165,8 +1165,8 @@ void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &b if ( e->recursOn( start ) ) { // This occurrence has possibly started before the beginning of the // month, so obtain the start date before the beginning of the month - QValueList<QDateTime> starttimes = e->startDateTimesForDate( start ); - QValueList<QDateTime>::ConstIterator it = starttimes.begin(); + TQValueList<TQDateTime> starttimes = e->startDateTimesForDate( start ); + TQValueList<TQDateTime>::ConstIterator it = starttimes.begin(); for ( ; it != starttimes.end(); ++it ) { monthentries.append( MonthEventStruct( *it, e->endDateForStart( *it ), e ) ); } @@ -1176,13 +1176,13 @@ void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &b // also return events that have started earlier. These start dates // however, have already been treated! Recurrence *recur = e->recurrence(); - QDate d1( start.addDays(1) ); + TQDate d1( start.addDays(1) ); while ( d1 <= end ) { if ( recur->recursOn(d1) ) { TimeList times( recur->recurTimesOn( d1 ) ); for ( TimeList::ConstIterator it = times.begin(); it != times.end(); ++it ) { - QDateTime d1start( d1, *it ); + TQDateTime d1start( d1, *it ); monthentries.append( MonthEventStruct( d1start, e->endDateForStart( d1start ), e ) ); } } @@ -1194,8 +1194,8 @@ void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &b } qHeapSort( monthentries ); - QValueList<MonthEventStruct>::ConstIterator mit = monthentries.begin(); - QDateTime endofmonth( end, QTime(0,0,0) ); + TQValueList<MonthEventStruct>::ConstIterator mit = monthentries.begin(); + TQDateTime endofmonth( end, TQTime(0,0,0) ); endofmonth = endofmonth.addDays(1); for ( ; mit != monthentries.end(); ++mit ) { if ( (*mit).start.date() == (*mit).end.date() ) { @@ -1209,8 +1209,8 @@ void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &b } } else { // Multi-day events are always shown as time line boxes - QDateTime thisstart( (*mit).start ); - QDateTime thisend( (*mit).end ); + TQDateTime thisstart( (*mit).start ); + TQDateTime thisend( (*mit).end ); if ( thisstart.date()<start ) thisstart = start; if ( thisend>endofmonth ) thisend = endofmonth; timeboxItems.append( new PrintCellItem( (*mit).event, thisstart, thisend ) ); @@ -1218,22 +1218,22 @@ void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &b } // For Multi-day events, line them up nicely so that the boxes don't overlap - QPtrListIterator<KOrg::CellItem> it1( timeboxItems ); + TQPtrListIterator<KOrg::CellItem> it1( timeboxItems ); for( it1.toFirst(); it1.current(); ++it1 ) { KOrg::CellItem *placeItem = it1.current(); KOrg::CellItem::placeItem( timeboxItems, placeItem ); } - QDateTime starttime( start, QTime( 0, 0, 0 ) ); + TQDateTime starttime( start, TQTime( 0, 0, 0 ) ); int newxstartcont = xstartcont; - QFont oldfont( p.font() ); - p.setFont( QFont( "sans-serif", 7 ) ); + TQFont oldfont( p.font() ); + p.setFont( TQFont( "sans-serif", 7 ) ); for( it1.toFirst(); it1.current(); ++it1 ) { PrintCellItem *placeItem = static_cast<PrintCellItem *>( it1.current() ); int minsToStart = starttime.secsTo( placeItem->start() )/60; int minsToEnd = starttime.secsTo( placeItem->end() )/60; - QRect eventBox( xstartcont + placeItem->subCell()*17, + TQRect eventBox( xstartcont + placeItem->subCell()*17, daysBox.top() + round( double( minsToStart*daysBox.height()) / double(maxdays*24*60) ), 14, 0 ); eventBox.setBottom( daysBox.top() + round( double( minsToEnd*daysBox.height()) / double(maxdays*24*60) ) ); @@ -1245,9 +1245,9 @@ void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &b // For Single-day events, simply print their summaries into the remaining // space of the day's cell for ( int d=0; d<daysinmonth; ++d ) { - QStringList dayEvents( textEvents[d+1] ); - QString txt = dayEvents.join(", "); - QRect dayBox( xstartcont, daysBox.top()+round(dayheight*d), 0, 0 ); + TQStringList dayEvents( textEvents[d+1] ); + TQString txt = dayEvents.join(", "); + TQRect dayBox( xstartcont, daysBox.top()+round(dayheight*d), 0, 0 ); dayBox.setRight( box.right() ); dayBox.setBottom( daysBox.top()+round(dayheight*(d+1)) ); printEventString(p, dayBox, txt, Qt::AlignTop | Qt::AlignLeft | Qt::BreakAnywhere ); @@ -1260,15 +1260,15 @@ void CalPrintPluginBase::drawMonth( QPainter &p, const QDate &dt, const QRect &b /////////////////////////////////////////////////////////////////////////////// -void CalPrintPluginBase::drawMonthTable(QPainter &p, const QDate &qd, bool weeknumbers, +void CalPrintPluginBase::drawMonthTable(TQPainter &p, const TQDate &qd, bool weeknumbers, bool recurDaily, bool recurWeekly, - const QRect &box) + const TQRect &box) { int yoffset = mSubHeaderHeight; int xoffset = 0; - QDate monthDate(QDate(qd.year(), qd.month(), 1)); - QDate monthFirst(monthDate); - QDate monthLast(monthDate.addMonths(1).addDays(-1)); + TQDate monthDate(TQDate(qd.year(), qd.month(), 1)); + TQDate monthFirst(monthDate); + TQDate monthLast(monthDate.addMonths(1).addDays(-1)); int weekdayCol = weekdayColumn( monthDate.dayOfWeek() ); @@ -1291,26 +1291,26 @@ void CalPrintPluginBase::drawMonthTable(QPainter &p, const QDate &qd, bool weekn } if (weeknumbers) { - QFont oldFont(p.font()); - QFont newFont(p.font()); + TQFont oldFont(p.font()); + TQFont newFont(p.font()); newFont.setPointSize(6); p.setFont(newFont); - QDate weekDate(monthDate); + TQDate weekDate(monthDate); for (int row = 0; row<rows; ++row ) { int calWeek = weekDate.weekNumber(); - QRect rc( box.left(), rowedges[row], coledges[0] - 3 - box.left(), rowedges[row+1]-rowedges[row] ); - p.drawText( rc, Qt::AlignRight | Qt::AlignVCenter, QString::number( calWeek ) ); + TQRect rc( box.left(), rowedges[row], coledges[0] - 3 - box.left(), rowedges[row+1]-rowedges[row] ); + p.drawText( rc, Qt::AlignRight | Qt::AlignVCenter, TQString::number( calWeek ) ); weekDate = weekDate.addDays( 7 ); } p.setFont( oldFont ); } - QRect daysOfWeekBox( box ); + TQRect daysOfWeekBox( box ); daysOfWeekBox.setHeight( mSubHeaderHeight ); daysOfWeekBox.setLeft( box.left()+xoffset ); drawDaysOfWeek( p, monthDate, monthDate.addDays( 6 ), daysOfWeekBox ); - QColor back = p.backgroundColor(); + TQColor back = p.backgroundColor(); bool darkbg = false; for ( int row = 0; row < rows; ++row ) { for ( int col = 0; col < 7; ++col ) { @@ -1319,7 +1319,7 @@ void CalPrintPluginBase::drawMonthTable(QPainter &p, const QDate &qd, bool weekn p.setBackgroundColor( back.dark( 120 ) ); darkbg = true; } - QRect dayBox( coledges[col], rowedges[row], coledges[col+1]-coledges[col], rowedges[row+1]-rowedges[row] ); + TQRect dayBox( coledges[col], rowedges[row], coledges[col+1]-coledges[col], rowedges[row+1]-rowedges[row] ); drawDayBox(p, monthDate, dayBox, false, recurDaily, recurWeekly ); if ( darkbg ) { p.setBackgroundColor( back ); @@ -1333,7 +1333,7 @@ void CalPrintPluginBase::drawMonthTable(QPainter &p, const QDate &qd, bool weekn /////////////////////////////////////////////////////////////////////////////// -void CalPrintPluginBase::drawTodo( int &count, Todo *todo, QPainter &p, +void CalPrintPluginBase::drawTodo( int &count, Todo *todo, TQPainter &p, TodoSortField sortField, SortDirection sortDir, bool connectSubTodos, bool strikeoutCompleted, bool desc, int posPriority, int posSummary, @@ -1342,14 +1342,14 @@ void CalPrintPluginBase::drawTodo( int &count, Todo *todo, QPainter &p, int pageHeight, const Todo::List &todoList, TodoParentStart *r ) { - QString outStr; + TQString outStr; const KLocale *local = KGlobal::locale(); - QRect rect; + TQRect rect; TodoParentStart startpt; // This list keeps all starting points of the parent to-dos so the connection // lines of the tree can easily be drawn (needed if a new page is started) - static QPtrList<TodoParentStart> startPoints; + static TQPtrList<TodoParentStart> startPoints; if ( level < 1 ) { startPoints.clear(); } @@ -1407,7 +1407,7 @@ void CalPrintPluginBase::drawTodo( int &count, Todo *todo, QPainter &p, rect.setHeight(18); // Draw a checkbox - p.setBrush( QBrush( Qt::NoBrush ) ); + p.setBrush( TQBrush( Qt::NoBrush ) ); p.drawRect( rect ); if ( todo->isCompleted() ) { // cross out the rectangle for completed to-dos @@ -1442,10 +1442,10 @@ void CalPrintPluginBase::drawTodo( int &count, Todo *todo, QPainter &p, rect = p.boundingRect( lhs, rect.top(), (rhs-(left + rect.width() + 5)), -1, Qt::WordBreak, outStr ); - QRect newrect; + TQRect newrect; //FIXME: the following code prints underline rather than strikeout text #if 0 - QFont f( p.font() ); + TQFont f( p.font() ); if ( todo->isCompleted() && strikeoutCompleted ) { f.setStrikeOut( true ); p.setFont( f ); @@ -1484,10 +1484,10 @@ void CalPrintPluginBase::drawTodo( int &count, Todo *todo, QPainter &p, //first, draw the progress bar int progress = (int)(( lwidth*todo->percentComplete())/100.0 + 0.5); - p.setBrush( QBrush( Qt::NoBrush ) ); + p.setBrush( TQBrush( Qt::NoBrush ) ); p.drawRect( posPercentComplete, y+3, lwidth, lheight ); if ( progress > 0 ) { - p.setBrush( QColor( 128, 128, 128 ) ); + p.setBrush( TQColor( 128, 128, 128 ) ); p.drawRect( posPercentComplete, y+3, progress, lheight ); } @@ -1563,14 +1563,14 @@ int CalPrintPluginBase::weekdayColumn( int weekday ) return ( weekday + 7 - KGlobal::locale()->weekStartDay() ) % 7; } -void CalPrintPluginBase::drawJournalField( QPainter &p, QString field, QString text, +void CalPrintPluginBase::drawJournalField( TQPainter &p, TQString field, TQString text, int x, int &y, int width, int pageHeight ) { if ( text.isEmpty() ) return; - QString entry( field.arg( text ) ); + TQString entry( field.arg( text ) ); - QRect rect( p.boundingRect( x, y, width, -1, Qt::WordBreak, entry) ); + TQRect rect( p.boundingRect( x, y, width, -1, Qt::WordBreak, entry) ); if ( rect.bottom() > pageHeight) { // Start new page... // FIXME: If it's a multi-line text, draw a few lines on this page, and the @@ -1579,18 +1579,18 @@ void CalPrintPluginBase::drawJournalField( QPainter &p, QString field, QString t mPrinter->newPage(); rect = p.boundingRect( x, y, width, -1, Qt::WordBreak, entry); } - QRect newrect; + TQRect newrect; p.drawText( rect, Qt::WordBreak, entry, -1, &newrect ); y = newrect.bottom() + 7; } -void CalPrintPluginBase::drawJournal( Journal * journal, QPainter &p, int x, int &y, +void CalPrintPluginBase::drawJournal( Journal * journal, TQPainter &p, int x, int &y, int width, int pageHeight ) { - QFont oldFont( p.font() ); - p.setFont( QFont( "sans-serif", 15 ) ); - QString headerText; - QString dateText( KGlobal::locale()-> + TQFont oldFont( p.font() ); + p.setFont( TQFont( "sans-serif", 15 ) ); + TQString headerText; + TQString dateText( KGlobal::locale()-> formatDate( journal->dtStart().date(), false ) ); if ( journal->summary().isEmpty() ) { @@ -1601,14 +1601,14 @@ void CalPrintPluginBase::drawJournal( Journal * journal, QPainter &p, int x, int .arg( dateText ); } - QRect rect( p.boundingRect( x, y, width, -1, Qt::WordBreak, headerText) ); + TQRect rect( p.boundingRect( x, y, width, -1, Qt::WordBreak, headerText) ); if ( rect.bottom() > pageHeight) { // Start new page... y=0; mPrinter->newPage(); rect = p.boundingRect( x, y, width, -1, Qt::WordBreak, headerText ); } - QRect newrect; + TQRect newrect; p.drawText( rect, Qt::WordBreak, headerText, -1, &newrect ); p.setFont( oldFont ); @@ -1623,17 +1623,17 @@ void CalPrintPluginBase::drawJournal( Journal * journal, QPainter &p, int x, int } -void CalPrintPluginBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, - const QDate &td, - const QDate &, +void CalPrintPluginBase::drawSplitHeaderRight( TQPainter &p, const TQDate &fd, + const TQDate &td, + const TQDate &, int width, int ) { - QFont oldFont( p.font() ); + TQFont oldFont( p.font() ); - QPen oldPen( p.pen() ); - QPen pen( Qt::black, 4 ); + TQPen oldPen( p.pen() ); + TQPen pen( Qt::black, 4 ); - QString title; + TQString title; if ( mCalSys ) { if ( fd.month() == td.month() ) { title = i18n("Date range: Month dayStart - dayEnd", "%1 %2 - %3") @@ -1649,7 +1649,7 @@ void CalPrintPluginBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, } } - QFont serifFont("Times", 30); + TQFont serifFont("Times", 30); p.setFont(serifFont); int lineSpacing = p.fontMetrics().lineSpacing(); @@ -1662,9 +1662,9 @@ void CalPrintPluginBase::drawSplitHeaderRight( QPainter &p, const QDate &fd, p.drawLine(300, lineSpacing * 1, width, lineSpacing * 1); p.setPen( oldPen ); - p.setFont(QFont("Times", 20, QFont::Bold, TRUE)); + p.setFont(TQFont("Times", 20, TQFont::Bold, TRUE)); int newlineSpacing = p.fontMetrics().lineSpacing(); - title += QString::number(fd.year()); + title += TQString::number(fd.year()); p.drawText( 0, lineSpacing * 1 + 4, width, newlineSpacing, Qt::AlignRight | Qt::AlignTop, title ); |