Skip to content
Permalink
Browse files

PyQGIS: added QgsColorButton and QgsColorButtonV2

git-svn-id: http://svn.osgeo.org/qgis/trunk@12771 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Jan 15, 2010
1 parent c7dcfed commit eefb4baa8119b493efc27d8bb78d60f895180ad4
@@ -7,6 +7,7 @@

%Import core/core.sip

%Include qgscolorbutton.sip
%Include qgslegendinterface.sip
%Include qgisinterface.sip
%Include qgscomposerview.sip
@@ -0,0 +1,34 @@


class QgsColorButton : QToolButton
{
%TypeHeaderCode
#include <qgscolorbutton.h>
%End

public:
QgsColorButton( QWidget *parent = 0 );
~QgsColorButton();

void setColor( const QColor &color );
QColor color() const;

protected:
void paintEvent( QPaintEvent *e );

};


class QgsColorButtonV2 : QPushButton
{
%TypeHeaderCode
#include <qgscolorbutton.h>
%End

public:
QgsColorButtonV2( QWidget* parent = 0 );
QgsColorButtonV2( QString text, QWidget* parent = 0 );

void setColor( const QColor &color );
QColor color() const;
};
@@ -75,6 +75,11 @@ QgsColorButtonV2::QgsColorButtonV2( QWidget* parent )
{
}

QgsColorButtonV2::QgsColorButtonV2( QString text, QWidget* parent )
: QPushButton( text, parent )
{
}

void QgsColorButtonV2::setColor( const QColor &color )
{
mColor = color;
@@ -39,10 +39,11 @@ class GUI_EXPORT QgsColorButton: public QToolButton
};


class QgsColorButtonV2 : public QPushButton
class GUI_EXPORT QgsColorButtonV2 : public QPushButton
{
public:
QgsColorButtonV2( QWidget* parent = 0 );
QgsColorButtonV2( QString text, QWidget* parent = 0 );

void setColor( const QColor &color );
QColor color() const { return mColor; }
@@ -330,6 +330,8 @@ void QgsSymbolV2PropertiesDialog::layerTypeChanged()

// change layer to a new (with different type)
QgsSymbolLayerV2* newLayer = am->createSymbolLayer( QgsStringMap() );
if ( newLayer == NULL )
return;
mSymbol->changeSymbolLayer( currentLayerIndex(), newLayer );

updateSymbolLayerWidget( newLayer );

0 comments on commit eefb4ba

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