File tree 5 files changed +44
-1
lines changed
5 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 7
7
8
8
%Import core/core.sip
9
9
10
+ %Include qgscolorbutton.sip
10
11
%Include qgslegendinterface.sip
11
12
%Include qgisinterface.sip
12
13
%Include qgscomposerview.sip
Original file line number Diff line number Diff line change
1
+
2
+
3
+ class QgsColorButton : QToolButton
4
+ {
5
+ %TypeHeaderCode
6
+ #include <qgscolorbutton.h>
7
+ %End
8
+
9
+ public:
10
+ QgsColorButton( QWidget *parent = 0 );
11
+ ~QgsColorButton();
12
+
13
+ void setColor( const QColor &color );
14
+ QColor color() const;
15
+
16
+ protected:
17
+ void paintEvent( QPaintEvent *e );
18
+
19
+ };
20
+
21
+
22
+ class QgsColorButtonV2 : QPushButton
23
+ {
24
+ %TypeHeaderCode
25
+ #include <qgscolorbutton.h>
26
+ %End
27
+
28
+ public:
29
+ QgsColorButtonV2( QWidget* parent = 0 );
30
+ QgsColorButtonV2( QString text, QWidget* parent = 0 );
31
+
32
+ void setColor( const QColor &color );
33
+ QColor color() const;
34
+ };
Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ QgsColorButtonV2::QgsColorButtonV2( QWidget* parent )
75
75
{
76
76
}
77
77
78
+ QgsColorButtonV2::QgsColorButtonV2 ( QString text, QWidget* parent )
79
+ : QPushButton( text, parent )
80
+ {
81
+ }
82
+
78
83
void QgsColorButtonV2::setColor ( const QColor &color )
79
84
{
80
85
mColor = color;
Original file line number Diff line number Diff line change @@ -39,10 +39,11 @@ class GUI_EXPORT QgsColorButton: public QToolButton
39
39
};
40
40
41
41
42
- class QgsColorButtonV2 : public QPushButton
42
+ class GUI_EXPORT QgsColorButtonV2 : public QPushButton
43
43
{
44
44
public:
45
45
QgsColorButtonV2 ( QWidget* parent = 0 );
46
+ QgsColorButtonV2 ( QString text, QWidget* parent = 0 );
46
47
47
48
void setColor ( const QColor &color );
48
49
QColor color () const { return mColor ; }
Original file line number Diff line number Diff line change @@ -330,6 +330,8 @@ void QgsSymbolV2PropertiesDialog::layerTypeChanged()
330
330
331
331
// change layer to a new (with different type)
332
332
QgsSymbolLayerV2* newLayer = am->createSymbolLayer ( QgsStringMap () );
333
+ if ( newLayer == NULL )
334
+ return ;
333
335
mSymbol ->changeSymbolLayer ( currentLayerIndex (), newLayer );
334
336
335
337
updateSymbolLayerWidget ( newLayer );
You can’t perform that action at this time.
0 commit comments