-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 ) | |||
56 | c.setRgb( rgb ); | 56 | c.setRgb( rgb ); |
57 | c.getHsv(h,s,v); | 57 | c.getHsv(h,s,v); |
58 | } | 58 | } |
59 | 59 | ||
60 | /* | ||
61 | * avoid clashes with the original Qt | ||
62 | */ | ||
63 | namespace { | ||
64 | |||
60 | class QColorPicker : public QFrame | 65 | class QColorPicker : public QFrame |
61 | { | 66 | { |
62 | Q_OBJECT | 67 | Q_OBJECT |
63 | public: | 68 | public: |
@@ -606,15 +611,17 @@ void QColorShower::setHsv( int h, int s, int v ) | |||
606 | 611 | ||
607 | showCurrentColor(); | 612 | showCurrentColor(); |
608 | } | 613 | } |
609 | 614 | ||
615 | } | ||
616 | |||
610 | class OColorDialogPrivate : public QObject | 617 | class OColorDialogPrivate : public QObject |
611 | { | 618 | { |
612 | Q_OBJECT | 619 | Q_OBJECT |
613 | public: | 620 | public: |
614 | OColorDialogPrivate( OColorDialog *p ); | 621 | OColorDialogPrivate( OColorDialog *p ); |
615 | QRgb currentColor() const { return cs->currentColor(); } | 622 | QRgb currentColor() const { return cs->currentColor(); } |
616 | void setCurrentColor( QRgb rgb ); | 623 | void setCurrentColor( const QRgb& rgb ); |
617 | 624 | ||
618 | int currentAlpha() const { return cs->currentAlpha(); } | 625 | int currentAlpha() const { return cs->currentAlpha(); } |
619 | void setCurrentAlpha( int a ) { cs->setCurrentAlpha( a ); } | 626 | void setCurrentAlpha( int a ) { cs->setCurrentAlpha( a ); } |
620 | void showAlpha( bool b ) { cs->showAlpha( b ); } | 627 | void showAlpha( bool b ) { cs->showAlpha( b ); } |
@@ -636,9 +643,9 @@ void OColorDialogPrivate::newHsv( int h, int s, int v ) | |||
636 | lp->setCol( h, s, v ); | 643 | lp->setCol( h, s, v ); |
637 | } | 644 | } |
638 | 645 | ||
639 | //sets all widgets to display rgb | 646 | //sets all widgets to display rgb |
640 | void OColorDialogPrivate::setCurrentColor( QRgb rgb ) | 647 | void OColorDialogPrivate::setCurrentColor( const QRgb& rgb ) |
641 | { | 648 | { |
642 | cs->setRgb( rgb ); | 649 | cs->setRgb( rgb ); |
643 | newColorTypedIn( rgb ); | 650 | newColorTypedIn( rgb ); |
644 | } | 651 | } |
@@ -725,9 +732,9 @@ OColorDialog::OColorDialog(QWidget* parent, const char* name, bool modal) : | |||
725 | the dialog. All colors allocated by the dialog will be deallocated | 732 | the dialog. All colors allocated by the dialog will be deallocated |
726 | before this function returns. | 733 | before this function returns. |
727 | */ | 734 | */ |
728 | 735 | ||
729 | QColor OColorDialog::getColor( QColor initial, QWidget *parent, | 736 | QColor OColorDialog::getColor( const QColor& initial, QWidget *parent, |
730 | const char *name ) | 737 | const char *name ) |
731 | { | 738 | { |
732 | int allocContext = QColor::enterAllocContext(); | 739 | int allocContext = QColor::enterAllocContext(); |
733 | OColorDialog *dlg = new OColorDialog( parent, name, TRUE ); //modal | 740 | OColorDialog *dlg = new OColorDialog( parent, name, TRUE ); //modal |
@@ -762,9 +769,9 @@ QColor OColorDialog::getColor( QColor initial, QWidget *parent, | |||
762 | 769 | ||
763 | If the user clicks Cancel the \a initial value is returned. | 770 | If the user clicks Cancel the \a initial value is returned. |
764 | */ | 771 | */ |
765 | 772 | ||
766 | QRgb OColorDialog::getRgba( QRgb initial, bool *ok, | 773 | QRgb OColorDialog::getRgba( const QRgb& initial, bool *ok, |
767 | QWidget *parent, const char* name ) | 774 | QWidget *parent, const char* name ) |
768 | { | 775 | { |
769 | int allocContext = QColor::enterAllocContext(); | 776 | int allocContext = QColor::enterAllocContext(); |
770 | OColorDialog *dlg = new OColorDialog( parent, name, TRUE ); //modal | 777 | OColorDialog *dlg = new OColorDialog( parent, name, TRUE ); //modal |
@@ -818,9 +825,9 @@ OColorDialog::~OColorDialog() | |||
818 | 825 | ||
819 | \sa color() | 826 | \sa color() |
820 | */ | 827 | */ |
821 | 828 | ||
822 | void OColorDialog::setColor( QColor c ) | 829 | void OColorDialog::setColor( const QColor& c ) |
823 | { | 830 | { |
824 | d->setCurrentColor( c.rgb() ); | 831 | d->setCurrentColor( c.rgb() ); |
825 | } | 832 | } |
826 | 833 | ||