Skip to content

Commit bde0672

Browse files
author
mhugent
committedJan 18, 2010
Added option for custom dash-space pattern in simple line symbollayer
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12788 c8812cc2-4d05-0410-92ff-de0c093fc19c

11 files changed

+438
-40
lines changed
 

‎src/core/symbology-ng/qgslinesymbollayerv2.cpp

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
#include <cmath>
1010

1111
QgsSimpleLineSymbolLayerV2::QgsSimpleLineSymbolLayerV2( QColor color, double width, Qt::PenStyle penStyle )
12-
: mPenStyle( penStyle ), mPenJoinStyle( DEFAULT_SIMPLELINE_JOINSTYLE ), mPenCapStyle( DEFAULT_SIMPLELINE_CAPSTYLE ), mOffset( 0 )
12+
: mPenStyle( penStyle ), mPenJoinStyle( DEFAULT_SIMPLELINE_JOINSTYLE ), mPenCapStyle( DEFAULT_SIMPLELINE_CAPSTYLE ), mOffset( 0 ), mUseCustomDashPattern( false )
1313
{
1414
mColor = color;
1515
mWidth = width;
16+
mCustomDashVector << 5 << 2;
1617
}
1718

1819

@@ -37,6 +38,15 @@ QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::create( const QgsStringMap& props
3738
l->setPenJoinStyle( QgsSymbolLayerV2Utils::decodePenJoinStyle( props["joinstyle"] ) );
3839
if ( props.contains( "capstyle" ) )
3940
l->setPenCapStyle( QgsSymbolLayerV2Utils::decodePenCapStyle( props["capstyle"] ) );
41+
42+
if ( props.contains( "use_custom_dash" ) )
43+
{
44+
l->setUseCustomDashPattern( props["use_custom_dash"].toInt() );
45+
}
46+
if ( props.contains( "customdash" ) )
47+
{
48+
l->setCustomDashVector( QgsSymbolLayerV2Utils::decodeRealVector( props["customdash"] ) );
49+
}
4050
return l;
4151
}
4252

@@ -50,8 +60,26 @@ QString QgsSimpleLineSymbolLayerV2::layerType() const
5060
void QgsSimpleLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context )
5161
{
5262
mPen.setColor( mColor );
53-
mPen.setWidthF( context.outputLineWidth( mWidth ) );
54-
mPen.setStyle( mPenStyle );
63+
double scaledWidth = context.outputLineWidth( mWidth );
64+
mPen.setWidthF( scaledWidth );
65+
if ( mUseCustomDashPattern )
66+
{
67+
mPen.setStyle( Qt::CustomDashLine );
68+
69+
//scale pattern vector
70+
QVector<qreal> scaledVector;
71+
QVector<qreal>::const_iterator it = mCustomDashVector.constBegin();
72+
for ( ; it != mCustomDashVector.constEnd(); ++it )
73+
{
74+
//the dash is specified in terms of pen widths, therefore the division
75+
scaledVector << context.outputLineWidth(( *it ) / scaledWidth );
76+
}
77+
mPen.setDashPattern( scaledVector );
78+
}
79+
else
80+
{
81+
mPen.setStyle( mPenStyle );
82+
}
5583
mPen.setJoinStyle( mPenJoinStyle );
5684
mPen.setCapStyle( mPenCapStyle );
5785
}
@@ -88,6 +116,15 @@ QgsStringMap QgsSimpleLineSymbolLayerV2::properties() const
88116
map["joinstyle"] = QgsSymbolLayerV2Utils::encodePenJoinStyle( mPenJoinStyle );
89117
map["capstyle"] = QgsSymbolLayerV2Utils::encodePenCapStyle( mPenCapStyle );
90118
map["offset"] = QString::number( mOffset );
119+
if ( mUseCustomDashPattern )
120+
{
121+
map["use_custom_dash"] = "1";
122+
}
123+
else
124+
{
125+
map["use_custom_dash"] = "0";
126+
}
127+
map["customdash"] = QgsSymbolLayerV2Utils::encodeRealVector( mCustomDashVector );
91128
return map;
92129
}
93130

@@ -97,6 +134,8 @@ QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2::clone() const
97134
l->setOffset( mOffset );
98135
l->setPenJoinStyle( mPenJoinStyle );
99136
l->setPenCapStyle( mPenCapStyle );
137+
l->setUseCustomDashPattern( mUseCustomDashPattern );
138+
l->setCustomDashVector( mCustomDashVector );
100139
return l;
101140
}
102141

‎src/core/symbology-ng/qgslinesymbollayerv2.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,22 @@ class CORE_EXPORT QgsSimpleLineSymbolLayerV2 : public QgsLineSymbolLayerV2
5252
double offset() const { return mOffset; }
5353
void setOffset( double offset ) { mOffset = offset; }
5454

55+
bool useCustomDashPattern() const { return mUseCustomDashPattern; }
56+
void setUseCustomDashPattern( bool b ) { mUseCustomDashPattern = b; }
57+
58+
QVector<qreal> customDashVector() const { return mCustomDashVector; }
59+
void setCustomDashVector( const QVector<qreal>& vector ) { mCustomDashVector = vector; }
60+
5561
protected:
5662
Qt::PenStyle mPenStyle;
5763
Qt::PenJoinStyle mPenJoinStyle;
5864
Qt::PenCapStyle mPenCapStyle;
5965
QPen mPen;
6066
double mOffset;
67+
//use a custom dash dot pattern instead of the predefined ones
68+
bool mUseCustomDashPattern;
69+
/**Vector with an even number of entries for the */
70+
QVector<qreal> mCustomDashVector;
6171
};
6272

6373
/////////

‎src/core/symbology-ng/qgssymbollayerv2utils.cpp

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,35 @@ QgsSymbolV2::OutputUnit QgsSymbolLayerV2Utils::decodeOutputUnit( QString str )
176176
return QgsSymbolV2::MM;
177177
}
178178

179+
QString QgsSymbolLayerV2Utils::encodeRealVector( const QVector<qreal>& v )
180+
{
181+
QString vectorString;
182+
QVector<qreal>::const_iterator it = v.constBegin();
183+
for ( ; it != v.constEnd(); ++it )
184+
{
185+
if ( it != v.constBegin() )
186+
{
187+
vectorString.append( ";" );
188+
}
189+
vectorString.append( QString::number( *it ) );
190+
}
191+
return vectorString;
192+
}
193+
194+
QVector<qreal> QgsSymbolLayerV2Utils::decodeRealVector( const QString& s )
195+
{
196+
QVector<qreal> resultVector;
197+
198+
QStringList realList = s.split( ";" );
199+
QStringList::const_iterator it = realList.constBegin();
200+
for ( ; it != realList.constEnd(); ++it )
201+
{
202+
resultVector.append( it->toDouble() );
203+
}
204+
205+
return resultVector;
206+
}
207+
179208
QIcon QgsSymbolLayerV2Utils::symbolPreviewIcon( QgsSymbolV2* symbol, QSize size )
180209
{
181210
return QIcon( symbolPreviewPixmap( symbol, size ) );
@@ -201,8 +230,7 @@ QIcon QgsSymbolLayerV2Utils::symbolLayerPreviewIcon( QgsSymbolLayerV2* layer, Qg
201230
painter.begin( &pixmap );
202231
painter.setRenderHint( QPainter::Antialiasing );
203232
painter.eraseRect( QRect( QPoint( 0, 0 ), size ) );
204-
QgsRenderContext renderContext;
205-
renderContext.setPainter( &painter );
233+
QgsRenderContext renderContext = createRenderContext( &painter );
206234
QgsSymbolV2RenderContext symbolContext( renderContext, u );
207235
layer->drawPreviewIcon( symbolContext, size );
208236
painter.end();

‎src/core/symbology-ng/qgssymbollayerv2utils.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ class CORE_EXPORT QgsSymbolLayerV2Utils
4444
static QString encodePoint( QPointF point );
4545
static QPointF decodePoint( QString str );
4646

47+
static QString encodeRealVector( const QVector<qreal>& v );
48+
static QVector<qreal> decodeRealVector( const QString& s );
49+
4750
static QString encodeOutputUnit( QgsSymbolV2::OutputUnit unit );
4851
static QgsSymbolV2::OutputUnit decodeOutputUnit( QString str );
4952

@@ -75,6 +78,8 @@ class CORE_EXPORT QgsSymbolLayerV2Utils
7578
static double pixelSizeScaleFactor( QgsRenderContext& c, QgsSymbolV2::OutputUnit u );
7679
/**Creates a render context for a pixel based device*/
7780
static QgsRenderContext createRenderContext( QPainter* p );
81+
82+
static QString iconPath( QString iconFile );
7883
};
7984

8085
class QPolygonF;

‎src/gui/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
SET(QGIS_GUI_SRCS
33

44
symbology-ng/qgsbrushstylecombobox.cpp
5+
symbology-ng/qgsdashspacedialog.cpp
56
symbology-ng/qgspenstylecombobox.cpp
67
symbology-ng/qgssymbollayerv2widget.cpp
78
symbology-ng/qgssymbolv2propertiesdialog.cpp
@@ -50,6 +51,7 @@ qgsludialog.cpp
5051

5152
SET(QGIS_GUI_MOC_HDRS
5253

54+
symbology-ng/qgsdashspacedialog.h
5355
symbology-ng/qgssymbollayerv2widget.h
5456
symbology-ng/qgssymbolv2propertiesdialog.h
5557
symbology-ng/qgssinglesymbolrendererv2widget.h
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/***************************************************************************
2+
qgsdashspacedialog.cpp
3+
----------------------
4+
begin : January 2010
5+
copyright : (C) 2010 by Marco Hugentobler
6+
email : marco at hugis dot net
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
16+
#include "qgsdashspacedialog.h"
17+
#include "qgsapplication.h"
18+
#include <QFile>
19+
20+
QString iconPath( QString iconFile )
21+
{
22+
// try active theme
23+
QString path = QgsApplication::activeThemePath();
24+
if ( QFile::exists( path + iconFile ) )
25+
return path + iconFile;
26+
27+
// use default theme
28+
return QgsApplication::defaultThemePath() + iconFile;
29+
}
30+
31+
QgsDashSpaceDialog::QgsDashSpaceDialog( const QVector<qreal>& v, QWidget* parent, Qt::WindowFlags f ): QDialog( parent, f )
32+
{
33+
setupUi( this );
34+
35+
mAddButton->setIcon( QIcon( iconPath( "symbologyAdd.png" ) ) );
36+
mRemoveButton->setIcon( QIcon( iconPath( "symbologyRemove.png" ) ) );
37+
38+
double dash = 0;
39+
double space = 0;
40+
for ( int i = 0; i < ( v.size() - 1 ); ++i )
41+
{
42+
dash = v.at( i );
43+
++i;
44+
space = v.at( i );
45+
QTreeWidgetItem* entry = new QTreeWidgetItem();
46+
entry->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
47+
entry->setText( 0, QString::number( dash ) );
48+
entry->setText( 1, QString::number( space ) );
49+
mDashSpaceTreeWidget->addTopLevelItem( entry );
50+
}
51+
}
52+
53+
QgsDashSpaceDialog::~QgsDashSpaceDialog()
54+
{
55+
56+
}
57+
58+
void QgsDashSpaceDialog::on_mAddButton_clicked()
59+
{
60+
//add new (default) item
61+
QTreeWidgetItem* entry = new QTreeWidgetItem();
62+
entry->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
63+
entry->setText( 0, "5" );
64+
entry->setText( 1, "2" );
65+
mDashSpaceTreeWidget->addTopLevelItem( entry );
66+
}
67+
68+
void QgsDashSpaceDialog::on_mRemoveButton_clicked()
69+
{
70+
//get active item
71+
QTreeWidgetItem* currentItem = mDashSpaceTreeWidget->currentItem();
72+
if ( currentItem )
73+
{
74+
mDashSpaceTreeWidget->takeTopLevelItem( mDashSpaceTreeWidget->indexOfTopLevelItem( currentItem ) );
75+
}
76+
}
77+
78+
QVector<qreal> QgsDashSpaceDialog::dashDotVector() const
79+
{
80+
QVector<qreal> dashVector;
81+
int nTopLevelItems = mDashSpaceTreeWidget->topLevelItemCount();
82+
for ( int i = 0; i < nTopLevelItems; ++i )
83+
{
84+
QTreeWidgetItem* currentItem = mDashSpaceTreeWidget->topLevelItem( i );
85+
if ( currentItem )
86+
{
87+
dashVector << currentItem->text( 0 ).toDouble() << currentItem->text( 1 ).toDouble();
88+
}
89+
}
90+
return dashVector;
91+
}
92+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/***************************************************************************
2+
qgsdashspacedialog.h
3+
---------------------
4+
begin : January 2010
5+
copyright : (C) 2010 by Marco Hugentobler
6+
email : marco at hugis dot net
7+
***************************************************************************
8+
* *
9+
* This program is free software; you can redistribute it and/or modify *
10+
* it under the terms of the GNU General Public License as published by *
11+
* the Free Software Foundation; either version 2 of the License, or *
12+
* (at your option) any later version. *
13+
* *
14+
***************************************************************************/
15+
16+
#ifndef QGSDASHSPACEDIALOG_H
17+
#define QGSDASHSPACEDIALOG_H
18+
19+
#include "ui_qgsdashspacedialogbase.h"
20+
21+
/**A dialog to enter a custom dash space pattern for lines*/
22+
class QgsDashSpaceDialog: public QDialog, private Ui::QgsDashSpaceDialogBase
23+
{
24+
Q_OBJECT
25+
public:
26+
QgsDashSpaceDialog( const QVector<qreal>& v, QWidget * parent = 0, Qt::WindowFlags f = 0 );
27+
~QgsDashSpaceDialog();
28+
29+
QVector<qreal> dashDotVector() const;
30+
31+
private slots:
32+
void on_mAddButton_clicked();
33+
void on_mRemoveButton_clicked();
34+
};
35+
36+
#endif // QGSDASHSPACEDIALOG_H

‎src/gui/symbology-ng/qgssymbollayerv2widget.cpp

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "qgsmarkersymbollayerv2.h"
66
#include "qgsfillsymbollayerv2.h"
77

8+
#include "qgsdashspacedialog.h"
89
#include "qgssymbolv2propertiesdialog.h"
910

1011
#include "qgsapplication.h"
@@ -31,6 +32,7 @@ QgsSimpleLineSymbolLayerV2Widget::QgsSimpleLineSymbolLayerV2Widget( QWidget* par
3132
connect( spinOffset, SIGNAL( valueChanged( double ) ), this, SLOT( offsetChanged() ) );
3233
connect( cboCapStyle, SIGNAL( currentIndexChanged( int ) ), this, SLOT( penStyleChanged() ) );
3334
connect( cboJoinStyle, SIGNAL( currentIndexChanged( int ) ), this, SLOT( penStyleChanged() ) );
35+
updatePatternIcon();
3436

3537
}
3638

@@ -49,6 +51,23 @@ void QgsSimpleLineSymbolLayerV2Widget::setSymbolLayer( QgsSymbolLayerV2* layer )
4951
spinOffset->setValue( mLayer->offset() );
5052
cboJoinStyle->setPenJoinStyle( mLayer->penJoinStyle() );
5153
cboCapStyle->setPenCapStyle( mLayer->penCapStyle() );
54+
55+
//use a custom dash pattern?
56+
bool useCustomDashPattern = mLayer->useCustomDashPattern();
57+
mChangePatternButton->setEnabled( useCustomDashPattern );
58+
label_3->setEnabled( !useCustomDashPattern );
59+
cboPenStyle->setEnabled( !useCustomDashPattern );
60+
mCustomCheckBox->blockSignals( true );
61+
if ( useCustomDashPattern )
62+
{
63+
mCustomCheckBox->setCheckState( Qt::Checked );
64+
}
65+
else
66+
{
67+
mCustomCheckBox->setCheckState( Qt::Unchecked );
68+
}
69+
mCustomCheckBox->blockSignals( false );
70+
updatePatternIcon();
5271
}
5372

5473
QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2Widget::symbolLayer()
@@ -86,6 +105,45 @@ void QgsSimpleLineSymbolLayerV2Widget::offsetChanged()
86105
emit changed();
87106
}
88107

108+
void QgsSimpleLineSymbolLayerV2Widget::on_mCustomCheckBox_stateChanged( int state )
109+
{
110+
bool checked = ( state == Qt::Checked );
111+
mChangePatternButton->setEnabled( checked );
112+
label_3->setEnabled( !checked );
113+
cboPenStyle->setEnabled( !checked );
114+
115+
mLayer->setUseCustomDashPattern( checked );
116+
emit changed();
117+
}
118+
119+
void QgsSimpleLineSymbolLayerV2Widget::on_mChangePatternButton_clicked()
120+
{
121+
QgsDashSpaceDialog d( mLayer->customDashVector() );
122+
if ( d.exec() == QDialog::Accepted )
123+
{
124+
mLayer->setCustomDashVector( d.dashDotVector() );
125+
updatePatternIcon();
126+
emit changed();
127+
}
128+
}
129+
130+
void QgsSimpleLineSymbolLayerV2Widget::updatePatternIcon()
131+
{
132+
if ( !mLayer )
133+
{
134+
return;
135+
}
136+
QgsSimpleLineSymbolLayerV2* layerCopy = dynamic_cast<QgsSimpleLineSymbolLayerV2*>( mLayer->clone() );
137+
if ( !layerCopy )
138+
{
139+
return;
140+
}
141+
layerCopy->setUseCustomDashPattern( true );
142+
QIcon buttonIcon = QgsSymbolLayerV2Utils::symbolLayerPreviewIcon( layerCopy, QgsSymbolV2::MM, mChangePatternButton->iconSize() );
143+
mChangePatternButton->setIcon( buttonIcon );
144+
delete layerCopy;
145+
}
146+
89147

90148
///////////
91149

‎src/gui/symbology-ng/qgssymbollayerv2widget.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@ class GUI_EXPORT QgsSimpleLineSymbolLayerV2Widget : public QgsSymbolLayerV2Widge
4646
void colorChanged();
4747
void penStyleChanged();
4848
void offsetChanged();
49+
void on_mCustomCheckBox_stateChanged( int state );
50+
void on_mChangePatternButton_clicked();
51+
4952

5053
protected:
5154
QgsSimpleLineSymbolLayerV2* mLayer;
55+
56+
//creates a new icon for the 'change pattern' button
57+
void updatePatternIcon();
5258
};
5359

5460
///////////
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>QgsDashSpaceDialogBase</class>
4+
<widget class="QDialog" name="QgsDashSpaceDialogBase">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>400</width>
10+
<height>277</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>Dash space pattern</string>
15+
</property>
16+
<layout class="QGridLayout" name="gridLayout">
17+
<item row="0" column="0">
18+
<spacer name="horizontalSpacer">
19+
<property name="orientation">
20+
<enum>Qt::Horizontal</enum>
21+
</property>
22+
<property name="sizeHint" stdset="0">
23+
<size>
24+
<width>245</width>
25+
<height>20</height>
26+
</size>
27+
</property>
28+
</spacer>
29+
</item>
30+
<item row="0" column="1">
31+
<widget class="QPushButton" name="mRemoveButton">
32+
<property name="text">
33+
<string/>
34+
</property>
35+
</widget>
36+
</item>
37+
<item row="0" column="2">
38+
<widget class="QPushButton" name="mAddButton">
39+
<property name="text">
40+
<string/>
41+
</property>
42+
</widget>
43+
</item>
44+
<item row="1" column="0" colspan="3">
45+
<widget class="QTreeWidget" name="mDashSpaceTreeWidget">
46+
<property name="columnCount">
47+
<number>2</number>
48+
</property>
49+
<column>
50+
<property name="text">
51+
<string>Dash</string>
52+
</property>
53+
</column>
54+
<column>
55+
<property name="text">
56+
<string>Space</string>
57+
</property>
58+
</column>
59+
</widget>
60+
</item>
61+
<item row="2" column="0" colspan="3">
62+
<widget class="QDialogButtonBox" name="buttonBox">
63+
<property name="orientation">
64+
<enum>Qt::Horizontal</enum>
65+
</property>
66+
<property name="standardButtons">
67+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
68+
</property>
69+
</widget>
70+
</item>
71+
</layout>
72+
</widget>
73+
<resources/>
74+
<connections>
75+
<connection>
76+
<sender>buttonBox</sender>
77+
<signal>accepted()</signal>
78+
<receiver>QgsDashSpaceDialogBase</receiver>
79+
<slot>accept()</slot>
80+
<hints>
81+
<hint type="sourcelabel">
82+
<x>248</x>
83+
<y>254</y>
84+
</hint>
85+
<hint type="destinationlabel">
86+
<x>157</x>
87+
<y>274</y>
88+
</hint>
89+
</hints>
90+
</connection>
91+
<connection>
92+
<sender>buttonBox</sender>
93+
<signal>rejected()</signal>
94+
<receiver>QgsDashSpaceDialogBase</receiver>
95+
<slot>reject()</slot>
96+
<hints>
97+
<hint type="sourcelabel">
98+
<x>316</x>
99+
<y>260</y>
100+
</hint>
101+
<hint type="destinationlabel">
102+
<x>286</x>
103+
<y>274</y>
104+
</hint>
105+
</hints>
106+
</connection>
107+
</connections>
108+
</ui>

‎src/ui/symbollayer/widget_simpleline.ui

Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>368</width>
10-
<height>244</height>
9+
<width>358</width>
10+
<height>296</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Form</string>
1515
</property>
16-
<layout class="QVBoxLayout" name="verticalLayout">
17-
<item>
18-
<layout class="QGridLayout">
16+
<layout class="QGridLayout" name="gridLayout_2">
17+
<item row="0" column="0">
18+
<layout class="QGridLayout" name="gridLayout">
1919
<item row="0" column="0">
2020
<widget class="QLabel" name="label">
2121
<property name="text">
2222
<string>Color:</string>
2323
</property>
2424
</widget>
2525
</item>
26-
<item row="0" column="1">
26+
<item row="0" column="1" colspan="2">
2727
<widget class="QgsColorButtonV2" name="btnChangeColor">
2828
<property name="sizePolicy">
2929
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -36,7 +36,7 @@
3636
</property>
3737
</widget>
3838
</item>
39-
<item row="0" column="2" rowspan="4">
39+
<item row="0" column="3" rowspan="3">
4040
<spacer>
4141
<property name="orientation">
4242
<enum>Qt::Horizontal</enum>
@@ -59,24 +59,36 @@
5959
</property>
6060
</widget>
6161
</item>
62-
<item row="2" column="0">
63-
<widget class="QLabel" name="label_3">
64-
<property name="text">
65-
<string>Pen style:</string>
62+
<item row="1" column="1" colspan="2">
63+
<widget class="QDoubleSpinBox" name="spinWidth">
64+
<property name="sizePolicy">
65+
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
66+
<horstretch>0</horstretch>
67+
<verstretch>0</verstretch>
68+
</sizepolicy>
69+
</property>
70+
<property name="alignment">
71+
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
72+
</property>
73+
<property name="decimals">
74+
<number>2</number>
75+
</property>
76+
<property name="maximum">
77+
<double>100000.000000000000000</double>
78+
</property>
79+
<property name="value">
80+
<double>1.000000000000000</double>
6681
</property>
6782
</widget>
6883
</item>
69-
<item row="2" column="1">
70-
<widget class="QgsPenStyleComboBox" name="cboPenStyle"/>
71-
</item>
72-
<item row="3" column="0">
84+
<item row="2" column="0">
7385
<widget class="QLabel" name="label_4">
7486
<property name="text">
7587
<string>Offset:</string>
7688
</property>
7789
</widget>
7890
</item>
79-
<item row="3" column="1">
91+
<item row="2" column="1" colspan="2">
8092
<widget class="QDoubleSpinBox" name="spinOffset">
8193
<property name="alignment">
8294
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -92,31 +104,33 @@
92104
</property>
93105
</widget>
94106
</item>
95-
<item row="1" column="1">
96-
<widget class="QDoubleSpinBox" name="spinWidth">
97-
<property name="sizePolicy">
98-
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
99-
<horstretch>0</horstretch>
100-
<verstretch>0</verstretch>
101-
</sizepolicy>
102-
</property>
103-
<property name="alignment">
104-
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
105-
</property>
106-
<property name="decimals">
107-
<number>2</number>
107+
<item row="3" column="0">
108+
<widget class="QLabel" name="label_3">
109+
<property name="text">
110+
<string>Pen style:</string>
108111
</property>
109-
<property name="maximum">
110-
<double>100000.000000000000000</double>
112+
</widget>
113+
</item>
114+
<item row="3" column="2">
115+
<widget class="QgsPenStyleComboBox" name="cboPenStyle"/>
116+
</item>
117+
<item row="4" column="0" colspan="4">
118+
<widget class="QCheckBox" name="mCustomCheckBox">
119+
<property name="text">
120+
<string>Use custom dash pattern</string>
111121
</property>
112-
<property name="value">
113-
<double>1.000000000000000</double>
122+
</widget>
123+
</item>
124+
<item row="5" column="0" colspan="2">
125+
<widget class="QPushButton" name="mChangePatternButton">
126+
<property name="text">
127+
<string>Change</string>
114128
</property>
115129
</widget>
116130
</item>
117131
</layout>
118132
</item>
119-
<item>
133+
<item row="1" column="0">
120134
<spacer>
121135
<property name="orientation">
122136
<enum>Qt::Vertical</enum>
@@ -129,7 +143,7 @@
129143
</property>
130144
</spacer>
131145
</item>
132-
<item>
146+
<item row="2" column="0">
133147
<layout class="QGridLayout" name="gridLayout_1">
134148
<item row="0" column="0">
135149
<widget class="QLabel" name="label_5">

0 commit comments

Comments
 (0)
Please sign in to comment.