Diffstat (limited to 'kaddressbook/views/colorlistbox.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/colorlistbox.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/kaddressbook/views/colorlistbox.cpp b/kaddressbook/views/colorlistbox.cpp index 2bddca6..46a59a1 100644 --- a/kaddressbook/views/colorlistbox.cpp +++ b/kaddressbook/views/colorlistbox.cpp @@ -18,8 +18,13 @@ * */ #include <qpainter.h> +//Added by qt3to4: +#include <QDragEnterEvent> +#include <QDropEvent> +#include <QDragMoveEvent> +#include <QDragLeaveEvent> #include <kcolordialog.h> #ifndef KAB_EMBEDDED @@ -30,13 +35,13 @@ #ifdef DESKTOP_VERSION #include <qcolordialog.h> #endif -ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f ) +ColorListBox::ColorListBox( QWidget *parent, const char *name, Qt::WFlags f ) :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) { connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) ); - connect( this, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotNewColor(QListBoxItem *)) ); + connect( this, SIGNAL(clicked(Q3ListBoxItem *)), this, SLOT(slotNewColor(Q3ListBoxItem *)) ); setAcceptDrops( true); } @@ -46,9 +51,9 @@ void ColorListBox::setEnabled( bool state ) { return; } - QListBox::setEnabled( state ); + Q3ListBox::setEnabled( state ); for( uint i=0; i<count(); i++ ) { updateItem( i ); } @@ -74,12 +79,12 @@ QColor ColorListBox::color( uint index ) const return( colorItem->color() ); } else { - return( black ); + return( Qt::black ); } } -void ColorListBox::slotNewColor(QListBoxItem * i) +void ColorListBox::slotNewColor(Q3ListBoxItem * i) { if ( i ) newColor( index( i ) ); } @@ -197,9 +202,9 @@ qDebug("ColorListBox::dropEvent drag&drop currently not supported"); ColorListItem::ColorListItem( const QString &text, const QColor &color ) - : QListBoxItem(), mColor( color ), mBoxWidth( 30 ) + : Q3ListBoxItem(), mColor( color ), mBoxWidth( 30 ) { setText( text ); } @@ -228,18 +233,18 @@ void ColorListItem::paint( QPainter *p ) p->fillRect( 4, 2, mBoxWidth-2, h-3, mColor ); } -int ColorListItem::height(const QListBox *lb ) const +int ColorListItem::height(const Q3ListBox *lb ) const { return( lb->fontMetrics().lineSpacing()+1 ); } -int ColorListItem::width(const QListBox *lb ) const +int ColorListItem::width(const Q3ListBox *lb ) const { return( mBoxWidth + lb->fontMetrics().width( text() ) + 6 ); } -#ifndef KAB_EMBEDDED -#include "colorlistbox.moc" +#ifndef KAB_EMBEDDED_ +#include "moc_colorlistbox.cpp" #endif //KAB_EMBEDDED |