-rw-r--r-- | libopie/colordialog.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/libopie/colordialog.cpp b/libopie/colordialog.cpp index 684d6ea..35f15d6 100644 --- a/libopie/colordialog.cpp +++ b/libopie/colordialog.cpp @@ -56,8 +56,13 @@ static inline void rgb2hsv( QRgb rgb, int&h, int&s, int&v ) c.setRgb( rgb ); c.getHsv(h,s,v); } +/* + * avoid clashes with the original Qt + */ +namespace { + class QColorPicker : public QFrame { Q_OBJECT public: @@ -606,15 +611,17 @@ void QColorShower::setHsv( int h, int s, int v ) showCurrentColor(); } +} + class OColorDialogPrivate : public QObject { Q_OBJECT public: OColorDialogPrivate( OColorDialog *p ); QRgb currentColor() const { return cs->currentColor(); } - void setCurrentColor( QRgb rgb ); + void setCurrentColor( const QRgb& rgb ); int currentAlpha() const { return cs->currentAlpha(); } void setCurrentAlpha( int a ) { cs->setCurrentAlpha( a ); } void showAlpha( bool b ) { cs->showAlpha( b ); } @@ -636,9 +643,9 @@ void OColorDialogPrivate::newHsv( int h, int s, int v ) lp->setCol( h, s, v ); } //sets all widgets to display rgb -void OColorDialogPrivate::setCurrentColor( QRgb rgb ) +void OColorDialogPrivate::setCurrentColor( const QRgb& rgb ) { cs->setRgb( rgb ); newColorTypedIn( rgb ); } @@ -725,9 +732,9 @@ OColorDialog::OColorDialog(QWidget* parent, const char* name, bool modal) : the dialog. All colors allocated by the dialog will be deallocated before this function returns. */ -QColor OColorDialog::getColor( QColor initial, QWidget *parent, +QColor OColorDialog::getColor( const QColor& initial, QWidget *parent, const char *name ) { int allocContext = QColor::enterAllocContext(); OColorDialog *dlg = new OColorDialog( parent, name, TRUE ); //modal @@ -762,9 +769,9 @@ QColor OColorDialog::getColor( QColor initial, QWidget *parent, If the user clicks Cancel the \a initial value is returned. */ -QRgb OColorDialog::getRgba( QRgb initial, bool *ok, +QRgb OColorDialog::getRgba( const QRgb& initial, bool *ok, QWidget *parent, const char* name ) { int allocContext = QColor::enterAllocContext(); OColorDialog *dlg = new OColorDialog( parent, name, TRUE ); //modal @@ -818,9 +825,9 @@ OColorDialog::~OColorDialog() \sa color() */ -void OColorDialog::setColor( QColor c ) +void OColorDialog::setColor( const QColor& c ) { d->setCurrentColor( c.rgb() ); } |