Skip to content
Permalink
Browse files

fixed a button issues in widgets

  • Loading branch information
tecoholic committed Jul 9, 2012
1 parent aeec55e commit b1c4a83db5d1e9a21d0b1e8feceb302b9131d397
@@ -1167,7 +1167,6 @@ QgsPointPatternFillSymbolLayerWidget::QgsPointPatternFillSymbolLayerWidget( cons
QgsSymbolLayerV2Widget( parent, vl ), mLayer( 0 )
{
setupUi( this );
updateMarkerIcon();
}


@@ -1183,23 +1182,13 @@ void QgsPointPatternFillSymbolLayerWidget::setSymbolLayer( QgsSymbolLayerV2* lay
mVerticalDistanceSpinBox->setValue( mLayer->distanceY() );
mHorizontalDisplacementSpinBox->setValue( mLayer->displacementX() );
mVerticalDisplacementSpinBox->setValue( mLayer->displacementY() );
updateMarkerIcon();
}

QgsSymbolLayerV2* QgsPointPatternFillSymbolLayerWidget::symbolLayer()
{
return mLayer;
}

void QgsPointPatternFillSymbolLayerWidget::updateMarkerIcon()
{
if ( mLayer )
{
QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon( mLayer->subSymbol(), mChangeMarkerButton->iconSize() );
mChangeMarkerButton->setIcon( icon );
}
}

void QgsPointPatternFillSymbolLayerWidget::on_mHorizontalDistanceSpinBox_valueChanged( double d )
{
if ( mLayer )
@@ -1236,23 +1225,6 @@ void QgsPointPatternFillSymbolLayerWidget::on_mVerticalDisplacementSpinBox_value
}
}

void QgsPointPatternFillSymbolLayerWidget::on_mChangeMarkerButton_clicked()
{
if ( !mLayer )
{
return;
}

QgsSymbolV2PropertiesDialog dlg( mLayer->subSymbol(), mVectorLayer, this );
if ( dlg.exec() == QDialog::Rejected )
{
return;
}

updateMarkerIcon();
emit changed();
}

/////////////

QgsFontMarkerSymbolLayerV2Widget::QgsFontMarkerSymbolLayerV2Widget( const QgsVectorLayer* vl, QWidget* parent )
@@ -1362,8 +1334,6 @@ QgsCentroidFillSymbolLayerV2Widget::QgsCentroidFillSymbolLayerV2Widget( const Qg
mLayer = NULL;

setupUi( this );

connect( btnChangeMarker, SIGNAL( clicked() ), this, SLOT( setMarker() ) );
}

void QgsCentroidFillSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
@@ -1373,28 +1343,10 @@ void QgsCentroidFillSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer

// layer type is correct, we can do the cast
mLayer = static_cast<QgsCentroidFillSymbolLayerV2*>( layer );

// set values
updateMarker();
}

QgsSymbolLayerV2* QgsCentroidFillSymbolLayerV2Widget::symbolLayer()
{
return mLayer;
}

void QgsCentroidFillSymbolLayerV2Widget::setMarker()
{
QgsSymbolV2PropertiesDialog dlg( mLayer->subSymbol(), mVectorLayer, this );
if ( dlg.exec() == 0 )
return;
updateMarker();

emit changed();
}

void QgsCentroidFillSymbolLayerV2Widget::updateMarker()
{
QIcon icon = QgsSymbolLayerV2Utils::symbolPreviewIcon( mLayer->subSymbol(), btnChangeMarker->iconSize() );
btnChangeMarker->setIcon( icon );
}
@@ -328,14 +328,12 @@ class GUI_EXPORT QgsPointPatternFillSymbolLayerWidget: public QgsSymbolLayerV2Wi

protected:
QgsPointPatternFillSymbolLayer* mLayer;
void updateMarkerIcon();

private slots:
void on_mHorizontalDistanceSpinBox_valueChanged( double d );
void on_mVerticalDistanceSpinBox_valueChanged( double d );
void on_mHorizontalDisplacementSpinBox_valueChanged( double d );
void on_mVerticalDisplacementSpinBox_valueChanged( double d );
void on_mChangeMarkerButton_clicked();
};

/////////
@@ -391,12 +389,7 @@ class GUI_EXPORT QgsCentroidFillSymbolLayerV2Widget : public QgsSymbolLayerV2Wid
virtual void setSymbolLayer( QgsSymbolLayerV2* layer );
virtual QgsSymbolLayerV2* symbolLayer();

public slots:
void setMarker();

protected:
void updateMarker();

QgsCentroidFillSymbolLayerV2* mLayer;
};

@@ -82,6 +82,9 @@ QgsSymbolsListWidget::QgsSymbolsListWidget( QgsSymbolV2* symbol, QgsStyleV2* sty
connect( btnAddToStyle, SIGNAL( clicked() ), this, SLOT( addSymbolToStyle() ) );
btnAddToStyle->setIcon( QIcon( QgsApplication::defaultThemePath() + "symbologyAdd.png" ) );

// Set symbol color in btnColor
updateSymbolColor();

}


@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>366</width>
<width>368</width>
<height>242</height>
</rect>
</property>
@@ -16,26 +16,6 @@
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Marker</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnChangeMarker">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
@@ -69,9 +49,6 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>btnChangeMarker</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
@@ -6,39 +6,15 @@
<rect>
<x>0</x>
<y>0</y>
<width>243</width>
<width>283</width>
<height>152</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="mMarkerLabel">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>Marker</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="mChangeMarkerButton">
<property name="text">
<string>Change</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mHorizontalDistanceLabel">
<property name="text">
<string>Horizontal distance</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="mHorizontalDistanceSpinBox">
<property name="decimals">
<number>5</number>
@@ -48,14 +24,17 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="mVerticalDistanceLabel">
<property name="text">
<string>Vertical distance</string>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="mVerticalDisplacementSpinBox">
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>999999999.990000009536743</double>
</property>
</widget>
</item>
<item row="2" column="1">
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="mVerticalDistanceSpinBox">
<property name="decimals">
<number>5</number>
@@ -65,14 +44,28 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="2" column="0">
<widget class="QLabel" name="mHorizontalDisplacementLabel">
<property name="text">
<string>Horizontal displacement</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="0" column="0">
<widget class="QLabel" name="mHorizontalDistanceLabel">
<property name="text">
<string>Horizontal distance</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="mVerticalDistanceLabel">
<property name="text">
<string>Vertical distance</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="mHorizontalDisplacementSpinBox">
<property name="decimals">
<number>5</number>
@@ -82,23 +75,13 @@
</property>
</widget>
</item>
<item row="4" column="0">
<item row="3" column="0">
<widget class="QLabel" name="mVerticalDisplacementLabel">
<property name="text">
<string>Vertical displacement</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QDoubleSpinBox" name="mVerticalDisplacementSpinBox">
<property name="decimals">
<number>5</number>
</property>
<property name="maximum">
<double>999999999.990000009536743</double>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

0 comments on commit b1c4a83

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