Skip to content

Commit 86daeac

Browse files
Button group signal fix
1 parent a065e9e commit 86daeac

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Gui/ColorSelectorWidget.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,13 @@ ColorSelectorWidget::ColorSelectorWidget(bool withAlpha, QWidget *parent)
646646
this, SLOT( handleSliderAMoved(double) ) );
647647
}
648648

649+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
650+
QObject::connect( _buttonColorGroup, SIGNAL( buttonClicked(QAbstractButton*) ),
651+
this, SLOT( handleButtonColorClicked(QAbstractButton*) ) );
652+
#else
649653
QObject::connect( _buttonColorGroup, SIGNAL( buttonClicked(int) ),
650654
this, SLOT( handleButtonColorClicked(int) ) );
655+
#endif
651656

652657
QObject::connect( paletteAddColorButton, SIGNAL( clicked(bool) ),
653658
this, SLOT( setPaletteButtonColor(bool) ) );
@@ -1226,6 +1231,16 @@ ColorSelectorWidget::setSliderVColor()
12261231
_slideV->setUseLineColor(true, color);
12271232
}
12281233

1234+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
1235+
void
1236+
ColorSelectorWidget::handleButtonColorClicked(QAbstractButton *button)
1237+
{
1238+
QVariant var = button->property(COLOR_SELECTOR_BUTTON_PROPERTY);
1239+
if ( var.isValid() ) {
1240+
_stack->setCurrentIndex( var.toInt() );
1241+
}
1242+
}
1243+
#else
12291244
void
12301245
ColorSelectorWidget::handleButtonColorClicked(int /*id*/)
12311246
{
@@ -1234,6 +1249,7 @@ ColorSelectorWidget::handleButtonColorClicked(int /*id*/)
12341249
_stack->setCurrentIndex( var.toInt() );
12351250
}
12361251
}
1252+
#endif
12371253

12381254
void
12391255
ColorSelectorWidget::setPaletteButtonColor(bool /*clicked*/)

Gui/ColorSelectorWidget.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,11 @@ private Q_SLOTS:
192192
void setSliderSColor();
193193
void setSliderVColor();
194194

195+
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
196+
void handleButtonColorClicked(QAbstractButton *button);
197+
#else
195198
void handleButtonColorClicked(int id);
199+
#endif
196200

197201
void setPaletteButtonColor(bool clicked = true);
198202
void clearPaletteButtons(bool clicked = true);

0 commit comments

Comments
 (0)