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 /kaddressbook/views/colorlistbox.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 'kaddressbook/views/colorlistbox.cpp')
-rw-r--r-- | kaddressbook/views/colorlistbox.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/kaddressbook/views/colorlistbox.cpp b/kaddressbook/views/colorlistbox.cpp index 37a2ac1f..8043eacd 100644 --- a/kaddressbook/views/colorlistbox.cpp +++ b/kaddressbook/views/colorlistbox.cpp @@ -18,17 +18,17 @@ * */ -#include <qpainter.h> +#include <tqpainter.h> #include <kcolordialog.h> #include <kcolordrag.h> #include "colorlistbox.h" -ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f ) +ColorListBox::ColorListBox( TQWidget *parent, const char *name, WFlags f ) :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) { - connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) ); + connect( this, TQT_SIGNAL(selected(int)), this, TQT_SLOT(newColor(int)) ); setAcceptDrops( true); } @@ -40,7 +40,7 @@ void ColorListBox::setEnabled( bool state ) return; } - QListBox::setEnabled( state ); + TQListBox::setEnabled( state ); for( uint i=0; i<count(); i++ ) { updateItem( i ); @@ -48,7 +48,7 @@ void ColorListBox::setEnabled( bool state ) } -void ColorListBox::setColor( uint index, const QColor &color ) +void ColorListBox::setColor( uint index, const TQColor &color ) { if( index < count() ) { @@ -59,7 +59,7 @@ void ColorListBox::setColor( uint index, const QColor &color ) } -QColor ColorListBox::color( uint index ) const +TQColor ColorListBox::color( uint index ) const { if( index < count() ) { @@ -82,8 +82,8 @@ void ColorListBox::newColor( int index ) if( (uint)index < count() ) { - QColor c = color( index ); - if( KColorDialog::getColor( c, this ) != QDialog::Rejected ) + TQColor c = color( index ); + if( KColorDialog::getColor( c, this ) != TQDialog::Rejected ) { setColor( index, c ); } @@ -91,7 +91,7 @@ void ColorListBox::newColor( int index ) } -void ColorListBox::dragEnterEvent( QDragEnterEvent *e ) +void ColorListBox::dragEnterEvent( TQDragEnterEvent *e ) { if( KColorDrag::canDecode(e) && isEnabled() ) { @@ -106,7 +106,7 @@ void ColorListBox::dragEnterEvent( QDragEnterEvent *e ) } -void ColorListBox::dragLeaveEvent( QDragLeaveEvent * ) +void ColorListBox::dragLeaveEvent( TQDragLeaveEvent * ) { if( mCurrentOnDragEnter != -1 ) { @@ -116,7 +116,7 @@ void ColorListBox::dragLeaveEvent( QDragLeaveEvent * ) } -void ColorListBox::dragMoveEvent( QDragMoveEvent *e ) +void ColorListBox::dragMoveEvent( TQDragMoveEvent *e ) { if( KColorDrag::canDecode(e) && isEnabled() ) { @@ -129,9 +129,9 @@ void ColorListBox::dragMoveEvent( QDragMoveEvent *e ) } -void ColorListBox::dropEvent( QDropEvent *e ) +void ColorListBox::dropEvent( TQDropEvent *e ) { - QColor color; + TQColor color; if( KColorDrag::decode( e, color ) ) { int index = currentItem(); @@ -147,28 +147,28 @@ void ColorListBox::dropEvent( QDropEvent *e ) -ColorListItem::ColorListItem( const QString &text, const QColor &color ) - : QListBoxItem(), mColor( color ), mBoxWidth( 30 ) +ColorListItem::ColorListItem( const TQString &text, const TQColor &color ) + : TQListBoxItem(), mColor( color ), mBoxWidth( 30 ) { setText( text ); } -const QColor &ColorListItem::color( void ) +const TQColor &ColorListItem::color( void ) { return( mColor ); } -void ColorListItem::setColor( const QColor &color ) +void ColorListItem::setColor( const TQColor &color ) { mColor = color; } -void ColorListItem::paint( QPainter *p ) +void ColorListItem::paint( TQPainter *p ) { - QFontMetrics fm = p->fontMetrics(); + TQFontMetrics fm = p->fontMetrics(); int h = fm.height(); p->drawText( mBoxWidth+3*2, fm.ascent() + fm.leading()/2, text() ); @@ -179,13 +179,13 @@ void ColorListItem::paint( QPainter *p ) } -int ColorListItem::height(const QListBox *lb ) const +int ColorListItem::height(const TQListBox *lb ) const { return( lb->fontMetrics().lineSpacing()+1 ); } -int ColorListItem::width(const QListBox *lb ) const +int ColorListItem::width(const TQListBox *lb ) const { return( mBoxWidth + lb->fontMetrics().width( text() ) + 6 ); } |