Skip to content
Permalink
Browse files

add Qgs(Double)SpinBox to SIP

  • Loading branch information
3nids committed Sep 25, 2014
1 parent 4c39896 commit 48cdd749eb6d200390e73e0f7c0d187586b19790
@@ -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 );
};
@@ -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;

0 comments on commit 48cdd74

Please sign in to comment.
You can’t perform that action at this time.