Skip to content

Commit 70ef5a7

Browse files
committedMar 22, 2013
Fix live color updating slot parameter by using SLOT macro
1 parent 1cecf8e commit 70ef5a7

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed
 

‎python/gui/qgscolordialog.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class QgsColorDialog : QObject
1616
/** Return a color selection from a QColorDialog, with live updating of interim selections.
1717
* @param initialColor The initial color of the selection dialog.
1818
* @param updateObject The receiver object of the live updating.
19-
* @param updateSlot The receiver object's slot for live updating (e.g. "setColor( const QColor& )" ).
19+
* @param updateSlot The receiver object's slot for live updating (e.g. SLOT( setValidColor( const QColor& ) ) ).
2020
* @param parent Parent widget. Usually 0 is best for native system color dialogs.
2121
* @param title The title of the QColorDialog.
2222
* @param options ColorDialogOptions passed to QColorDialog.

‎src/gui/qgscolorbutton.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void QgsColorButton::onButtonClicked()
7373
if ( mAcceptLiveUpdates && settings.value( "/qgis/live_color_dialogs", false ).toBool() )
7474
{
7575
newColor = QgsColorDialog::getLiveColor(
76-
color(), this, "setValidColor( const QColor& )",
76+
color(), this, SLOT( setValidColor( const QColor& ) ),
7777
this->parentWidget(), mColorDialogTitle, mColorDialogOptions );
7878
}
7979
else

‎src/gui/qgscolordialog.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "qgscolordialog.h"
1818

19-
#include <QMetaObject>
2019

2120
QgsColorDialog::QgsColorDialog()
2221
{
@@ -35,12 +34,9 @@ QColor QgsColorDialog::getLiveColor( const QColor& initialColor, QObject* update
3534
QColorDialog* liveDialog = new QColorDialog( initialColor, parent );
3635
liveDialog->setWindowTitle( title.isEmpty() ? tr( "Select Color" ) : title );
3736
liveDialog->setOptions( options );
38-
#ifdef Q_WS_MAC
39-
// always use native color dialog on Mac
40-
liveDialog->setOption( QColorDialog::DontUseNativeDialog, false );
41-
#endif
37+
4238
connect( liveDialog, SIGNAL( currentColorChanged( const QColor& ) ),
43-
updateObject, QString( "1%1" ).arg( QString( QMetaObject::normalizedSignature( updateSlot ) ) ).toAscii() );
39+
updateObject, updateSlot );
4440

4541
if ( liveDialog->exec() )
4642
{

‎src/gui/qgscolordialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class GUI_EXPORT QgsColorDialog : public QObject
3838
/** Return a color selection from a QColorDialog, with live updating of interim selections.
3939
* @param initialColor The initial color of the selection dialog.
4040
* @param updateObject The receiver object of the live updating.
41-
* @param updateSlot The receiver object's slot for live updating (e.g. "setColor( const QColor& )" ).
41+
* @param updateSlot The receiver object's slot for live updating (e.g. SLOT( setValidColor( const QColor& ) ) ).
4242
* @param parent Parent widget. Usually 0 is best for native system color dialogs.
4343
* @param title The title of the QColorDialog.
4444
* @param options ColorDialogOptions passed to QColorDialog.

‎src/gui/symbology-ng/qgsvectorgradientcolorrampv2dialog.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ void QgsVectorGradientColorRampV2Dialog::stopDoubleClicked( QTreeWidgetItem* ite
264264
if ( settings.value( "/qgis/live_color_dialogs", false ).toBool() )
265265
{
266266
mCurrentItem = item;
267-
color = QgsColorDialog::getLiveColor( item->data( 0, StopColorRole ).value<QColor>(), this, "setItemStopColor( const QColor& )", this );
267+
color = QgsColorDialog::getLiveColor(
268+
item->data( 0, StopColorRole ).value<QColor>(),
269+
this, SLOT( setItemStopColor( const QColor& ) ), this );
268270
mCurrentItem = 0;
269271
}
270272
else

0 commit comments

Comments
 (0)
Please sign in to comment.