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 /certmanager/lib/ui/kdhorizontalline.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 'certmanager/lib/ui/kdhorizontalline.cpp')
-rw-r--r-- | certmanager/lib/ui/kdhorizontalline.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/certmanager/lib/ui/kdhorizontalline.cpp b/certmanager/lib/ui/kdhorizontalline.cpp index 83b92a19b..7ccddb5d0 100644 --- a/certmanager/lib/ui/kdhorizontalline.cpp +++ b/certmanager/lib/ui/kdhorizontalline.cpp @@ -40,38 +40,38 @@ #include "kdhorizontalline.h" -#include <qstyle.h> -#include <qpainter.h> +#include <tqstyle.h> +#include <tqpainter.h> #ifdef QT_ACCESSIBILITY_SUPPORT -#include <qaccessible.h> +#include <tqaccessible.h> #endif -#include <qfontmetrics.h> -#include <qapplication.h> +#include <tqfontmetrics.h> +#include <tqapplication.h> -KDHorizontalLine::KDHorizontalLine( QWidget * parent, const char * name, WFlags f ) - : QFrame( parent, name, f ), +KDHorizontalLine::KDHorizontalLine( TQWidget * parent, const char * name, WFlags f ) + : TQFrame( parent, name, f ), mAlign( Qt::AlignAuto ), mLenVisible( 0 ) { - QFrame::setFrameStyle( HLine | Sunken ); + TQFrame::setFrameStyle( HLine | Sunken ); } -KDHorizontalLine::KDHorizontalLine( const QString & title, QWidget * parent, const char * name, WFlags f ) - : QFrame( parent, name, f ), +KDHorizontalLine::KDHorizontalLine( const TQString & title, TQWidget * parent, const char * name, WFlags f ) + : TQFrame( parent, name, f ), mAlign( Qt::AlignAuto ), mLenVisible( 0 ) { - QFrame::setFrameStyle( HLine | Sunken ); + TQFrame::setFrameStyle( HLine | Sunken ); setTitle( title ); } KDHorizontalLine::~KDHorizontalLine() {} void KDHorizontalLine::setFrameStyle( int style ) { - QFrame::setFrameStyle( ( style & ~MShape ) | HLine ); // force HLine + TQFrame::setFrameStyle( ( style & ~MShape ) | HLine ); // force HLine } -void KDHorizontalLine::setTitle( const QString & title ) { +void KDHorizontalLine::setTitle( const TQString & title ) { if ( mTitle == title ) return; mTitle = title; @@ -79,7 +79,7 @@ void KDHorizontalLine::setTitle( const QString & title ) { update(); updateGeometry(); #ifdef QT_ACCESSIBILITY_SUPPORT - QAccessible::updateAccessibility( this, 0, QAccessible::NameChanged ); + TQAccessible::updateAccessibility( this, 0, TQAccessible::NameChanged ); #endif } @@ -87,17 +87,17 @@ void KDHorizontalLine::calculateFrame() { mLenVisible = mTitle.length(); #if 0 if ( mLenVisible ) { - const QFontMetrics fm = fontMetrics(); + const TQFontMetrics fm = fontMetrics(); while ( mLenVisible ) { - const int tw = fm.width( mTitle, mLenVisible ) + 4*fm.width(QChar(' ')); + const int tw = fm.width( mTitle, mLenVisible ) + 4*fm.width(TQChar(' ')); if ( tw < width() ) break; mLenVisible--; } qDebug( "mLenVisible = %d (of %d)", mLenVisible, mTitle.length() ); if ( mLenVisible ) { // but do we also have a visible label? - QRect r = rect(); - const int va = style().styleHint( QStyle::SH_GroupBox_TextLabelVerticalAlignment, this ); + TQRect r = rect(); + const int va = style().styleHint( TQStyle::SH_GroupBox_TextLabelVerticalAlignment, this ); if( va & AlignVCenter ) r.setTop( fm.height() / 2 ); // frame rect should be else if( va & AlignTop ) @@ -107,32 +107,32 @@ void KDHorizontalLine::calculateFrame() { } } // no visible label - setFrameRect( QRect(0,0,0,0) ); // then use client rect + setFrameRect( TQRect(0,0,0,0) ); // then use client rect #endif } -QSizePolicy KDHorizontalLine::sizePolicy() const { - return QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Fixed ); +TQSizePolicy KDHorizontalLine::sizePolicy() const { + return TQSizePolicy( TQSizePolicy::Minimum, TQSizePolicy::Fixed ); } -QSize KDHorizontalLine::sizeHint() const { +TQSize KDHorizontalLine::sizeHint() const { return minimumSizeHint(); } -QSize KDHorizontalLine::minimumSizeHint() const { +TQSize KDHorizontalLine::minimumSizeHint() const { const int w = fontMetrics().width( mTitle, mLenVisible ) + - fontMetrics().width( QChar( ' ' ) ); + fontMetrics().width( TQChar( ' ' ) ); const int h = fontMetrics().height(); - return QSize( QMAX( w, indentHint() ), h ).expandedTo( qApp->globalStrut() ); + return TQSize( QMAX( w, indentHint() ), h ).expandedTo( qApp->globalStrut() ); } -void KDHorizontalLine::paintEvent( QPaintEvent * e ) { - QPainter paint( this ); +void KDHorizontalLine::paintEvent( TQPaintEvent * e ) { + TQPainter paint( this ); if ( mLenVisible ) { // draw title - const QFontMetrics & fm = paint.fontMetrics(); + const TQFontMetrics & fm = paint.fontMetrics(); const int h = fm.height(); - const int tw = fm.width( mTitle, mLenVisible ) + fm.width(QChar(' ')); + const int tw = fm.width( mTitle, mLenVisible ) + fm.width(TQChar(' ')); int x; if ( mAlign & AlignHCenter ) // center alignment x = frameRect().width()/2 - tw/2; @@ -141,18 +141,18 @@ void KDHorizontalLine::paintEvent( QPaintEvent * e ) { else if ( mAlign & AlignLeft ) // left alignment x = 0; else { // auto align - if( QApplication::reverseLayout() ) + if( TQApplication::reverseLayout() ) x = frameRect().width() - tw; else x = 0; } - QRect r( x, 0, tw, h ); - int va = style().styleHint( QStyle::SH_GroupBox_TextLabelVerticalAlignment, this ); + TQRect r( x, 0, tw, h ); + int va = style().styleHint( TQStyle::SH_GroupBox_TextLabelVerticalAlignment, this ); if ( va & AlignTop ) r.moveBy( 0, fm.descent() ); - const QColor pen( (QRgb) style().styleHint( QStyle::SH_GroupBox_TextLabelColor, this ) ); + const TQColor pen( (QRgb) style().styleHint( TQStyle::SH_GroupBox_TextLabelColor, this ) ); #if QT_VERSION >= 0x030300 - if ( !style().styleHint( QStyle::SH_UnderlineAccelerator, this ) ) + if ( !style().styleHint( TQStyle::SH_UnderlineAccelerator, this ) ) va |= NoAccel; #endif style().drawItem( &paint, r, ShowPrefix | AlignHCenter | va, colorGroup(), |