mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
add Qgs(Double)SpinBox to SIP
This commit is contained in:
parent
4c39896e85
commit
48cdd749eb
21
python/gui/editorwidgets/qgsdoublespinbox.sip
Normal file
21
python/gui/editorwidgets/qgsdoublespinbox.sip
Normal file
@ -0,0 +1,21 @@
|
||||
class QgsDoubleSpinBox : QDoubleSpinBox
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgsdoublespinbox.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
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;
|
||||
|
||||
//! Set the current value to the minimum
|
||||
virtual void clear();
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent( QResizeEvent* event );
|
||||
virtual void changeEvent( QEvent* event );
|
||||
};
|
21
python/gui/editorwidgets/qgsspinbox.sip
Normal file
21
python/gui/editorwidgets/qgsspinbox.sip
Normal file
@ -0,0 +1,21 @@
|
||||
class QgsSpinBox : QSpinBox
|
||||
{
|
||||
%TypeHeaderCode
|
||||
#include <qgsspinbox.h>
|
||||
%End
|
||||
|
||||
public:
|
||||
explicit QgsSpinBox( 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;
|
||||
|
||||
//! Set the current value to the minimum
|
||||
virtual void clear();
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent( QResizeEvent* event );
|
||||
virtual void changeEvent( QEvent* event );
|
||||
};
|
@ -175,7 +175,9 @@
|
||||
%Include editorwidgets/core/qgseditorwidgetfactory.sip
|
||||
%Include editorwidgets/core/qgseditorwidgetregistry.sip
|
||||
%Include editorwidgets/core/qgseditorwidgetwrapper.sip
|
||||
%Include editorwidgets/qgsdoublespinbox.sip
|
||||
%Include editorwidgets/qgsrelationreferencewidget.sip
|
||||
%Include editorwidgets/qgsrelationreferencewidgetwrapper.sip
|
||||
%Include editorwidgets/qgsspinbox.sip
|
||||
|
||||
%Include layertree/qgslayertreeview.sip
|
||||
|
@ -43,7 +43,7 @@ QgsDoubleSpinBox::QgsDoubleSpinBox( QWidget *parent )
|
||||
connect( this, SIGNAL( valueChanged( double ) ), this, SLOT( changed( double ) ) );
|
||||
}
|
||||
|
||||
void QgsDoubleSpinBox::setShowClearButton( bool showClearButton )
|
||||
void QgsDoubleSpinBox::setShowClearButton( const bool showClearButton )
|
||||
{
|
||||
mShowClearButton = showClearButton;
|
||||
mClearButton->setVisible( mShowClearButton && isEnabled() && value() != minimum() );
|
||||
|
@ -32,7 +32,7 @@ class GUI_EXPORT QgsDoubleSpinBox : public QDoubleSpinBox
|
||||
|
||||
//! determines if the widget will show a clear button
|
||||
//! @note the clear button will set the widget to its minimum value
|
||||
void setShowClearButton( bool showClearButton );
|
||||
void setShowClearButton( const bool showClearButton );
|
||||
bool showClearButton() const {return mShowClearButton;}
|
||||
|
||||
//! Set the current value to the minimum
|
||||
@ -46,7 +46,6 @@ class GUI_EXPORT QgsDoubleSpinBox : public QDoubleSpinBox
|
||||
void changed( const double &value );
|
||||
|
||||
private:
|
||||
int spinButtonWidth() const;
|
||||
int frameWidth() const;
|
||||
|
||||
bool mShowClearButton;
|
||||
|
@ -43,7 +43,7 @@ QgsSpinBox::QgsSpinBox( QWidget *parent )
|
||||
connect( this, SIGNAL( valueChanged( int ) ), this, SLOT( changed( int ) ) );
|
||||
}
|
||||
|
||||
void QgsSpinBox::setShowClearButton( bool showClearButton )
|
||||
void QgsSpinBox::setShowClearButton( const bool showClearButton )
|
||||
{
|
||||
mShowClearButton = showClearButton;
|
||||
mClearButton->setVisible( mShowClearButton && isEnabled() && value() != minimum() );
|
||||
|
@ -32,7 +32,7 @@ class GUI_EXPORT QgsSpinBox : public QSpinBox
|
||||
|
||||
//! determines if the widget will show a clear button
|
||||
//! @note the clear button will set the widget to its minimum value
|
||||
void setShowClearButton( bool showClearButton );
|
||||
void setShowClearButton( const bool showClearButton );
|
||||
bool showClearButton() const {return mShowClearButton;}
|
||||
|
||||
//! Set the current value to the minimum
|
||||
@ -46,7 +46,6 @@ class GUI_EXPORT QgsSpinBox : public QSpinBox
|
||||
void changed( const int& value );
|
||||
|
||||
private:
|
||||
int spinButtonWidth() const;
|
||||
int frameWidth() const;
|
||||
|
||||
bool mShowClearButton;
|
||||
|
Loading…
x
Reference in New Issue
Block a user