Block qt signals when manually setting value to avoid emitting an event in wxQT, thanks @seandpagnier

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Mariano Reingart
2014-09-29 04:01:13 +00:00
parent fdc2433ede
commit 740bcdc81a
3 changed files with 16 additions and 0 deletions

View File

@@ -135,7 +135,9 @@ bool wxCalendarCtrl::SetDate(const wxDateTime& date)
if ( !m_qtCalendar )
return false;
m_qtCalendar->blockSignals(true);
m_qtCalendar->setSelectedDate(wxQtConvertDate(date));
m_qtCalendar->blockSignals(false);
return true;
}
@@ -154,8 +156,10 @@ bool wxCalendarCtrl::SetDateRange(const wxDateTime& lowerdate,
if ( !m_qtCalendar )
return false;
m_qtCalendar->blockSignals(true);
m_qtCalendar->setMinimumDate(wxQtConvertDate(lowerdate));
m_qtCalendar->setMaximumDate(wxQtConvertDate(upperdate));
m_qtCalendar->blockSignals(false);
return true;
}

View File

@@ -67,7 +67,11 @@ bool wxSlider::Create(wxWindow *parent,
{
m_qtSlider = new wxQtSlider( parent, this );
m_qtSlider->setOrientation( wxQtConvertOrientation( style, wxSL_HORIZONTAL ) );
m_qtSlider->blockSignals(true);
SetRange( minValue, maxValue );
m_qtSlider->blockSignals(false);
// draw ticks marks (default bellow if horizontal, right if vertical):
if ( style & wxSL_VERTICAL )
{
@@ -89,12 +93,16 @@ int wxSlider::GetValue() const
void wxSlider::SetValue(int value)
{
m_qtSlider->blockSignals(true);
m_qtSlider->setValue( value );
m_qtSlider->blockSignals(false);
}
void wxSlider::SetRange(int minValue, int maxValue)
{
m_qtSlider->blockSignals(true);
m_qtSlider->setRange( minValue, maxValue );
m_qtSlider->blockSignals(false);
}
int wxSlider::GetMin() const

View File

@@ -53,13 +53,17 @@ bool wxSpinCtrlQt< T, Widget >::Create( wxWindow *parent, wxWindowID id,
template< typename T, typename Widget >
void wxSpinCtrlQt< T, Widget >::SetValue( T val )
{
m_qtSpinBox->blockSignals(true);
m_qtSpinBox->setValue( val );
m_qtSpinBox->blockSignals(false);
}
template< typename T, typename Widget >
void wxSpinCtrlQt< T, Widget >::SetRange( T min, T max )
{
m_qtSpinBox->blockSignals(true);
m_qtSpinBox->setRange( min, max );
m_qtSpinBox->blockSignals(false);
}
template< typename T, typename Widget >