summaryrefslogtreecommitdiffstats
path: root/kaddressbook/printing/kabentrypainter.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-13 00:46:47 +0000
commit67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch)
tree5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /kaddressbook/printing/kabentrypainter.cpp
parent2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff)
downloadtdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz
tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kaddressbook/printing/kabentrypainter.cpp')
-rw-r--r--kaddressbook/printing/kabentrypainter.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/kaddressbook/printing/kabentrypainter.cpp b/kaddressbook/printing/kabentrypainter.cpp
index c74e4e410..356b53dfb 100644
--- a/kaddressbook/printing/kabentrypainter.cpp
+++ b/kaddressbook/printing/kabentrypainter.cpp
@@ -17,8 +17,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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.
+ with any edition of TQt, and distribute the resulting executable,
+ without including the source code for TQt in the source distribution.
*/
@@ -133,9 +133,9 @@ int KABEntryPainter::hitsTalk( const TQPoint &p )
return hits( mTalkRects, p );
}
-int KABEntryPainter::hits( const QRectList& list, const TQPoint &p )
+int KABEntryPainter::hits( const TQRectList& list, const TQPoint &p )
{
- QRectList::const_iterator pos;
+ TQRectList::const_iterator pos;
int count = 0;
for ( pos = list.begin(); pos != list.end(); ++pos ) {
@@ -174,7 +174,7 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
// this is used to prepare some fields for printing and decide about
// the tqlayout later:
TQValueList<TQStringList> parts;
- TQValueList<QRectList*> contents;
+ TQValueList<TQRectList*> contents;
mEmailRects.clear();
mPhoneRects.clear();
@@ -189,9 +189,9 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
painter->setPen( mBackgroundColor );
text = addr.realName();
- // tqreplacement for: api->addressbook()->literalName(entry, text);
+ // replacement for: api->addressbook()->literalName(entry, text);
rect = painter->boundingRect( Ruler1, y, Width, Height,
- Qt::AlignVCenter | Qt::AlignLeft, text );
+ TQt::AlignVCenter | TQt::AlignLeft, text );
rect.setHeight( (int)( 1.25 * rect.height() ) );
if ( !fake && mUseHeaderColor )
@@ -202,7 +202,7 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
// create a little (1/8) space on top of the letters:
float ypos = y + ( (float)rect.height() ) * 0.125;
painter->drawText( Ruler1, (int)ypos, Width, rect.height(),
- Qt::AlignVCenter | Qt::AlignLeft, text );
+ TQt::AlignVCenter | TQt::AlignLeft, text );
}
// paint the birthday to the right:
@@ -213,7 +213,7 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
// create a little (1/8) space on top of the letters:
float ypos = y + ( (float)rect.height() ) * 0.125;
painter->drawText( 0, (int)ypos, Width-Ruler1, rect.height(),
- Qt::AlignVCenter | Qt::AlignRight, line1 );
+ TQt::AlignVCenter | TQt::AlignRight, line1 );
}
}
@@ -229,9 +229,9 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
if ( fake ) {
rect = painter->boundingRect( Ruler1, y, Width-Ruler1, Height,
- Qt::AlignTop | Qt::AlignLeft, line1 );
+ TQt::AlignTop | TQt::AlignLeft, line1 );
} else {
- painter->drawText( Ruler1, y, Width-Ruler1, Height, Qt::AlignTop | Qt::AlignLeft,
+ painter->drawText( Ruler1, y, Width-Ruler1, Height, TQt::AlignTop | TQt::AlignLeft,
line1, -1, &rect );
}
@@ -304,10 +304,10 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
int heights[ 4 ]= { 0, 0, 0, 0 };
TQValueList<TQStringList>::iterator pos = parts.begin();
- TQValueList<QRectList*>::iterator rpos = contents.begin();
+ TQValueList<TQRectList*>::iterator rpos = contents.begin();
for ( uint counter = 0; counter < parts.count(); ++counter ) {
- const int Offset = counter > 1 ? QMAX( heights[ 0 ], heights[ 1 ] ) : 0;
+ const int Offset = counter > 1 ? TQMAX( heights[ 0 ], heights[ 1 ] ) : 0;
TQStringList list = *pos;
painter->setFont( mHeadLineFont );
@@ -316,11 +316,11 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
limits[ counter ].top() + heights[counter]
+ Offset, limits[ counter ].width(),
limits[ counter ].height(),
- Qt::AlignTop | Qt::AlignLeft, *list.at( 0 ) );
+ TQt::AlignTop | TQt::AlignLeft, *list.at( 0 ) );
} else {
painter->drawText( limits[ counter ].left(), limits[ counter ].top() +
heights[ counter ] + Offset, limits[ counter ].width(),
- limits[ counter ].height(), Qt::AlignTop | Qt::AlignLeft,
+ limits[ counter ].height(), TQt::AlignTop | TQt::AlignLeft,
*list.at( 0 ), -1, &rect );
}
@@ -334,12 +334,12 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
rect = painter->boundingRect ( limits[ counter ].left() + Ruler1,
limits[ counter ].top() + heights[ counter ]
+ Offset, limits[ counter ].width() - Ruler1,
- limits[ counter ].height(), Qt::AlignTop | Qt::AlignLeft,
+ limits[ counter ].height(), TQt::AlignTop | TQt::AlignLeft,
*list.at( c2 ) );
} else {
painter->drawText( limits[ counter ].left() + Ruler1, limits[ counter ].top()
+ heights[ counter ] + Offset, limits[ counter ].width()
- - Ruler1, limits[ counter ].height(), Qt::AlignTop | Qt::AlignLeft,
+ - Ruler1, limits[ counter ].height(), TQt::AlignTop | TQt::AlignLeft,
*list.at( c2 ), -1, &rect );
}
(*rpos)->push_back( rect );
@@ -350,7 +350,7 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
++rpos;
}
- y = y + QMAX( heights[ 0 ], heights[ 1 ] ) + QMAX( heights[ 2 ], heights[ 3 ] );
+ y = y + TQMAX( heights[ 0 ], heights[ 1 ] ) + TQMAX( heights[ 2 ], heights[ 3 ] );
// ^^^^^ done with emails, telephone, URLs and talk addresses
// now print the addresses:
@@ -359,11 +359,11 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
y += fmBody.lineSpacing() / 2;
painter->setFont( mHeadLineFont );
if ( fake ) {
- rect = painter->boundingRect( 0, y, Width, Height, Qt::AlignTop | Qt::AlignLeft,
+ rect = painter->boundingRect( 0, y, Width, Height, TQt::AlignTop | TQt::AlignLeft,
addresses.count() == 1 ? i18n( "Address:" )
: i18n( "Addresses:" ) );
} else {
- painter->drawText( 0, y, Width, Height, Qt::AlignTop | Qt::AlignLeft,
+ painter->drawText( 0, y, Width, Height, TQt::AlignTop | TQt::AlignLeft,
addresses.count() == 1 ? i18n( "Address:" )
: i18n( "Addresses:" ), -1, &rect );
}
@@ -400,7 +400,7 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
}
line1 += TQString::tqfromLatin1( ":" );
- text = TQString::null;
+ text = TQString();
if ( !address.extended().isEmpty() )
text = address.extended().stripWhiteSpace();
@@ -425,20 +425,20 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
if ( fake ) {
rect = painter->boundingRect( Ruler1, y, Width - Ruler1, Height,
- Qt::AlignTop | Qt::AlignLeft, line1 );
+ TQt::AlignTop | TQt::AlignLeft, line1 );
} else {
painter->drawText( Ruler1, y, Width - Ruler1, Height,
- Qt::AlignTop | Qt::AlignLeft, line1, -1, &rect );
+ TQt::AlignTop | TQt::AlignLeft, line1, -1, &rect );
}
y += rect.height();
if ( !line2.isEmpty() ) {
if ( fake ) {
rect = painter->boundingRect( Ruler2, y, Width - Ruler2, Height,
- Qt::AlignTop | Qt::AlignLeft, line2 );
+ TQt::AlignTop | TQt::AlignLeft, line2 );
} else {
painter->drawText( Ruler2, y, Width - Ruler2, Height,
- Qt::AlignTop | Qt::AlignLeft, line2, -1, &rect );
+ TQt::AlignTop | TQt::AlignLeft, line2, -1, &rect );
}
y += rect.height();
}
@@ -446,10 +446,10 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
if ( !line3.isEmpty() ) {
if ( fake ) {
rect = painter->boundingRect( Ruler2, y, Width - Ruler2, Height,
- Qt::AlignTop | Qt::AlignLeft, line3 );
+ TQt::AlignTop | TQt::AlignLeft, line3 );
} else {
painter->drawText( Ruler2, y, Width - Ruler2, Height,
- Qt::AlignTop | Qt::AlignLeft, line3, -1, &rect );
+ TQt::AlignTop | TQt::AlignLeft, line3, -1, &rect );
}
y += rect.height();
}
@@ -457,10 +457,10 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
if ( !line4.isEmpty() ) {
if ( fake ) {
rect = painter->boundingRect( Ruler2, y, Width - Ruler2, Height,
- Qt::AlignTop | Qt::AlignLeft, line4 );
+ TQt::AlignTop | TQt::AlignLeft, line4 );
} else {
painter->drawText( Ruler2, y, Width - Ruler2, Height,
- Qt::AlignTop | Qt::AlignLeft, line4, -1, &rect );
+ TQt::AlignTop | TQt::AlignLeft, line4, -1, &rect );
}
y += rect.height();
}
@@ -469,11 +469,11 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
if ( !address.label().isEmpty() ) {
if ( fake ) {
rect = painter->boundingRect( Ruler2, y, Width - Ruler2, Height,
- Qt::AlignTop | Qt::AlignLeft,
+ TQt::AlignTop | TQt::AlignLeft,
i18n( "(Deliver to:)" ) );
} else {
painter->drawText( Ruler2, y, Width - Ruler2, Height,
- Qt::AlignTop | Qt::AlignLeft,
+ TQt::AlignTop | TQt::AlignLeft,
i18n( "(Deliver to:)" ), -1, &rect );
}
@@ -481,10 +481,10 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
y += fmBody.lineSpacing() / 4;
if ( fake ) {
rect = painter->boundingRect( Ruler3, y, Width - Ruler3, Height,
- Qt::AlignTop | Qt::AlignLeft, address.label() );
+ TQt::AlignTop | TQt::AlignLeft, address.label() );
} else {
painter->drawText( Ruler3, y, Width - Ruler3, Height,
- Qt::AlignTop | Qt::AlignLeft, address.label(), -1, &rect );
+ TQt::AlignTop | TQt::AlignLeft, address.label(), -1, &rect );
}
y += rect.height();
@@ -498,11 +498,11 @@ bool KABEntryPainter::printAddressee( const KABC::Addressee &addr,
y += fmBody.lineSpacing() / 2;
if ( fake ) {
rect = painter->boundingRect( 0, y, Width, Height,
- Qt::AlignTop | Qt::AlignLeft | Qt::WordBreak,
+ TQt::AlignTop | TQt::AlignLeft | TQt::WordBreak,
addr.note() );
} else {
painter->drawText( 0, y, Width, Height,
- Qt::AlignTop | Qt::AlignLeft | Qt::WordBreak,
+ TQt::AlignTop | TQt::AlignLeft | TQt::WordBreak,
addr.note(), -1, &rect );
}