mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Ensure that clear button is shown for QgsSpinBox/DoubleSpinBox
Previously the clear button might not show if the value of the widget was set while its signals were blocked.
This commit is contained in:
parent
1310b87081
commit
0cde4f103b
@ -57,4 +57,5 @@ class QgsDoubleSpinBox : QDoubleSpinBox
|
||||
protected:
|
||||
virtual void resizeEvent( QResizeEvent* event );
|
||||
virtual void changeEvent( QEvent* event );
|
||||
virtual void paintEvent( QPaintEvent* event );
|
||||
};
|
||||
|
@ -57,4 +57,5 @@ class QgsSpinBox : QSpinBox
|
||||
protected:
|
||||
virtual void resizeEvent( QResizeEvent* event );
|
||||
virtual void changeEvent( QEvent* event );
|
||||
virtual void paintEvent( QPaintEvent* event );
|
||||
};
|
||||
|
@ -63,6 +63,12 @@ void QgsDoubleSpinBox::changeEvent( QEvent *event )
|
||||
mClearButton->setVisible( shouldShowClearForValue( value() ) );
|
||||
}
|
||||
|
||||
void QgsDoubleSpinBox::paintEvent( QPaintEvent *event )
|
||||
{
|
||||
mClearButton->setVisible( shouldShowClearForValue( value() ) );
|
||||
QDoubleSpinBox::paintEvent( event );
|
||||
}
|
||||
|
||||
void QgsDoubleSpinBox::changed( const double& value )
|
||||
{
|
||||
mClearButton->setVisible( shouldShowClearForValue( value ) );
|
||||
|
@ -82,6 +82,7 @@ class GUI_EXPORT QgsDoubleSpinBox : public QDoubleSpinBox
|
||||
protected:
|
||||
virtual void resizeEvent( QResizeEvent* event ) override;
|
||||
virtual void changeEvent( QEvent* event ) override;
|
||||
virtual void paintEvent( QPaintEvent* event ) override;
|
||||
|
||||
private slots:
|
||||
void changed( const double &value );
|
||||
|
@ -63,6 +63,12 @@ void QgsSpinBox::changeEvent( QEvent *event )
|
||||
mClearButton->setVisible( shouldShowClearForValue( value() ) );
|
||||
}
|
||||
|
||||
void QgsSpinBox::paintEvent( QPaintEvent *event )
|
||||
{
|
||||
mClearButton->setVisible( shouldShowClearForValue( value() ) );
|
||||
QSpinBox::paintEvent( event );
|
||||
}
|
||||
|
||||
void QgsSpinBox::changed( const int& value )
|
||||
{
|
||||
mClearButton->setVisible( shouldShowClearForValue( value ) );
|
||||
|
@ -81,6 +81,7 @@ class GUI_EXPORT QgsSpinBox : public QSpinBox
|
||||
protected:
|
||||
virtual void resizeEvent( QResizeEvent* event ) override;
|
||||
virtual void changeEvent( QEvent* event ) override;
|
||||
virtual void paintEvent( QPaintEvent* event ) override;
|
||||
|
||||
private slots:
|
||||
void changed( const int& value );
|
||||
|
Loading…
x
Reference in New Issue
Block a user