2014-09-25 15:08:51 +02:00
|
|
|
class QgsDoubleSpinBox : QDoubleSpinBox
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsdoublespinbox.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
2014-12-03 11:24:32 +01:00
|
|
|
enum ClearValue
|
|
|
|
{
|
|
|
|
MinimumValue,
|
|
|
|
MaximumValue,
|
|
|
|
CustomValue
|
|
|
|
};
|
|
|
|
|
2014-09-25 15:08:51 +02:00
|
|
|
explicit QgsDoubleSpinBox( QWidget *parent /TransferThis/ = 0 );
|
|
|
|
|
|
|
|
//! determines if the widget will show a clear button
|
|
|
|
//! @note the clear button will set the widget to its minimum value
|
|
|
|
void setShowClearButton( const bool showClearButton );
|
|
|
|
bool showClearButton() const;
|
|
|
|
|
2014-12-03 11:24:32 +01:00
|
|
|
//! Set the current value to the value defined by the clear value.
|
2014-09-25 15:08:51 +02:00
|
|
|
virtual void clear();
|
|
|
|
|
2014-12-03 11:24:32 +01:00
|
|
|
/**
|
|
|
|
* @brief setClearValue defines if the clear value should be the minimum or maximum values of the widget or a custom value
|
|
|
|
* @param customValue if type is CustomValue, defines the numerical value used as the clear value
|
|
|
|
*/
|
|
|
|
void setClearValue( ClearValue type, double customValue = 0 );
|
|
|
|
//! returns the value used when clear() is called.
|
|
|
|
double clearValue();
|
|
|
|
|
2014-09-25 15:08:51 +02:00
|
|
|
protected:
|
|
|
|
virtual void resizeEvent( QResizeEvent* event );
|
2014-11-13 23:13:13 +01:00
|
|
|
virtual void changeEvent( QEvent* event );
|
2014-09-25 15:08:51 +02:00
|
|
|
};
|