[QGIS Commit] r12788 - in trunk/qgis/src: core/symbology-ng gui gui/symbology-ng ui/symbollayer

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Jan 18 10:49:03 EST 2010


Author: mhugent
Date: 2010-01-18 10:49:01 -0500 (Mon, 18 Jan 2010)
New Revision: 12788

Added:
   trunk/qgis/src/gui/symbology-ng/qgsdashspacedialog.cpp
   trunk/qgis/src/gui/symbology-ng/qgsdashspacedialog.h
   trunk/qgis/src/ui/symbollayer/qgsdashspacedialogbase.ui
Modified:
   trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.cpp
   trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.h
   trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp
   trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.h
   trunk/qgis/src/gui/CMakeLists.txt
   trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp
   trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.h
   trunk/qgis/src/ui/symbollayer/widget_simpleline.ui
Log:
Added option for custom dash-space pattern in simple line symbollayer

Modified: trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.cpp	2010-01-17 00:59:46 UTC (rev 12787)
+++ trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.cpp	2010-01-18 15:49:01 UTC (rev 12788)
@@ -9,10 +9,11 @@
 #include <cmath>
 
 QgsSimpleLineSymbolLayerV2::QgsSimpleLineSymbolLayerV2( QColor color, double width, Qt::PenStyle penStyle )
-    : mPenStyle( penStyle ), mPenJoinStyle( DEFAULT_SIMPLELINE_JOINSTYLE ), mPenCapStyle( DEFAULT_SIMPLELINE_CAPSTYLE ), mOffset( 0 )
+    : mPenStyle( penStyle ), mPenJoinStyle( DEFAULT_SIMPLELINE_JOINSTYLE ), mPenCapStyle( DEFAULT_SIMPLELINE_CAPSTYLE ), mOffset( 0 ), mUseCustomDashPattern( false )
 {
   mColor = color;
   mWidth = width;
+  mCustomDashVector << 5 << 2;
 }
 
 
@@ -37,6 +38,15 @@
     l->setPenJoinStyle( QgsSymbolLayerV2Utils::decodePenJoinStyle( props["joinstyle"] ) );
   if ( props.contains( "capstyle" ) )
     l->setPenCapStyle( QgsSymbolLayerV2Utils::decodePenCapStyle( props["capstyle"] ) );
+
+  if ( props.contains( "use_custom_dash" ) )
+  {
+    l->setUseCustomDashPattern( props["use_custom_dash"].toInt() );
+  }
+  if ( props.contains( "customdash" ) )
+  {
+    l->setCustomDashVector( QgsSymbolLayerV2Utils::decodeRealVector( props["customdash"] ) );
+  }
   return l;
 }
 
@@ -50,8 +60,26 @@
 void QgsSimpleLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context )
 {
   mPen.setColor( mColor );
-  mPen.setWidthF( context.outputLineWidth( mWidth ) );
-  mPen.setStyle( mPenStyle );
+  double scaledWidth = context.outputLineWidth( mWidth );
+  mPen.setWidthF( scaledWidth );
+  if ( mUseCustomDashPattern )
+  {
+    mPen.setStyle( Qt::CustomDashLine );
+
+    //scale pattern vector
+    QVector<qreal> scaledVector;
+    QVector<qreal>::const_iterator it = mCustomDashVector.constBegin();
+    for ( ; it != mCustomDashVector.constEnd(); ++it )
+    {
+      //the dash is specified in terms of pen widths, therefore the division
+      scaledVector << context.outputLineWidth(( *it ) / scaledWidth );
+    }
+    mPen.setDashPattern( scaledVector );
+  }
+  else
+  {
+    mPen.setStyle( mPenStyle );
+  }
   mPen.setJoinStyle( mPenJoinStyle );
   mPen.setCapStyle( mPenCapStyle );
 }
@@ -88,6 +116,15 @@
   map["joinstyle"] = QgsSymbolLayerV2Utils::encodePenJoinStyle( mPenJoinStyle );
   map["capstyle"] = QgsSymbolLayerV2Utils::encodePenCapStyle( mPenCapStyle );
   map["offset"] = QString::number( mOffset );
+  if ( mUseCustomDashPattern )
+  {
+    map["use_custom_dash"] = "1";
+  }
+  else
+  {
+    map["use_custom_dash"] = "0";
+  }
+  map["customdash"] = QgsSymbolLayerV2Utils::encodeRealVector( mCustomDashVector );
   return map;
 }
 
@@ -97,6 +134,8 @@
   l->setOffset( mOffset );
   l->setPenJoinStyle( mPenJoinStyle );
   l->setPenCapStyle( mPenCapStyle );
+  l->setUseCustomDashPattern( mUseCustomDashPattern );
+  l->setCustomDashVector( mCustomDashVector );
   return l;
 }
 

Modified: trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.h
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.h	2010-01-17 00:59:46 UTC (rev 12787)
+++ trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.h	2010-01-18 15:49:01 UTC (rev 12788)
@@ -52,12 +52,22 @@
     double offset() const { return mOffset; }
     void setOffset( double offset ) { mOffset = offset; }
 
+    bool useCustomDashPattern() const { return mUseCustomDashPattern; }
+    void setUseCustomDashPattern( bool b ) { mUseCustomDashPattern = b; }
+
+    QVector<qreal> customDashVector() const { return mCustomDashVector; }
+    void setCustomDashVector( const QVector<qreal>& vector ) { mCustomDashVector = vector; }
+
   protected:
     Qt::PenStyle mPenStyle;
     Qt::PenJoinStyle mPenJoinStyle;
     Qt::PenCapStyle mPenCapStyle;
     QPen mPen;
     double mOffset;
+    //use a custom dash dot pattern instead of the predefined ones
+    bool mUseCustomDashPattern;
+    /**Vector with an even number of entries for the */
+    QVector<qreal> mCustomDashVector;
 };
 
 /////////

Modified: trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp	2010-01-17 00:59:46 UTC (rev 12787)
+++ trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.cpp	2010-01-18 15:49:01 UTC (rev 12788)
@@ -176,6 +176,35 @@
   return QgsSymbolV2::MM;
 }
 
+QString QgsSymbolLayerV2Utils::encodeRealVector( const QVector<qreal>& v )
+{
+  QString vectorString;
+  QVector<qreal>::const_iterator it = v.constBegin();
+  for ( ; it != v.constEnd(); ++it )
+  {
+    if ( it != v.constBegin() )
+    {
+      vectorString.append( ";" );
+    }
+    vectorString.append( QString::number( *it ) );
+  }
+  return vectorString;
+}
+
+QVector<qreal> QgsSymbolLayerV2Utils::decodeRealVector( const QString& s )
+{
+  QVector<qreal> resultVector;
+
+  QStringList realList = s.split( ";" );
+  QStringList::const_iterator it = realList.constBegin();
+  for ( ; it != realList.constEnd(); ++it )
+  {
+    resultVector.append( it->toDouble() );
+  }
+
+  return resultVector;
+}
+
 QIcon QgsSymbolLayerV2Utils::symbolPreviewIcon( QgsSymbolV2* symbol, QSize size )
 {
   return QIcon( symbolPreviewPixmap( symbol, size ) );
@@ -201,8 +230,7 @@
   painter.begin( &pixmap );
   painter.setRenderHint( QPainter::Antialiasing );
   painter.eraseRect( QRect( QPoint( 0, 0 ), size ) );
-  QgsRenderContext renderContext;
-  renderContext.setPainter( &painter );
+  QgsRenderContext renderContext = createRenderContext( &painter );
   QgsSymbolV2RenderContext symbolContext( renderContext, u );
   layer->drawPreviewIcon( symbolContext, size );
   painter.end();

Modified: trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.h
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.h	2010-01-17 00:59:46 UTC (rev 12787)
+++ trunk/qgis/src/core/symbology-ng/qgssymbollayerv2utils.h	2010-01-18 15:49:01 UTC (rev 12788)
@@ -44,6 +44,9 @@
     static QString encodePoint( QPointF point );
     static QPointF decodePoint( QString str );
 
+    static QString encodeRealVector( const QVector<qreal>& v );
+    static QVector<qreal> decodeRealVector( const QString& s );
+
     static QString encodeOutputUnit( QgsSymbolV2::OutputUnit unit );
     static QgsSymbolV2::OutputUnit decodeOutputUnit( QString str );
 
@@ -75,6 +78,8 @@
     static double pixelSizeScaleFactor( QgsRenderContext& c, QgsSymbolV2::OutputUnit u );
     /**Creates a render context for a pixel based device*/
     static QgsRenderContext createRenderContext( QPainter* p );
+
+    static QString iconPath( QString iconFile );
 };
 
 class QPolygonF;

Modified: trunk/qgis/src/gui/CMakeLists.txt
===================================================================
--- trunk/qgis/src/gui/CMakeLists.txt	2010-01-17 00:59:46 UTC (rev 12787)
+++ trunk/qgis/src/gui/CMakeLists.txt	2010-01-18 15:49:01 UTC (rev 12788)
@@ -2,6 +2,7 @@
 SET(QGIS_GUI_SRCS
 
 symbology-ng/qgsbrushstylecombobox.cpp
+symbology-ng/qgsdashspacedialog.cpp
 symbology-ng/qgspenstylecombobox.cpp
 symbology-ng/qgssymbollayerv2widget.cpp
 symbology-ng/qgssymbolv2propertiesdialog.cpp
@@ -50,6 +51,7 @@
 
 SET(QGIS_GUI_MOC_HDRS
 
+symbology-ng/qgsdashspacedialog.h
 symbology-ng/qgssymbollayerv2widget.h
 symbology-ng/qgssymbolv2propertiesdialog.h
 symbology-ng/qgssinglesymbolrendererv2widget.h

Added: trunk/qgis/src/gui/symbology-ng/qgsdashspacedialog.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgsdashspacedialog.cpp	                        (rev 0)
+++ trunk/qgis/src/gui/symbology-ng/qgsdashspacedialog.cpp	2010-01-18 15:49:01 UTC (rev 12788)
@@ -0,0 +1,92 @@
+/***************************************************************************
+    qgsdashspacedialog.cpp
+    ----------------------
+    begin                : January 2010
+    copyright            : (C) 2010 by Marco Hugentobler
+    email                : marco at hugis dot net
+ ***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "qgsdashspacedialog.h"
+#include "qgsapplication.h"
+#include <QFile>
+
+QString iconPath( QString iconFile )
+{
+  // try active theme
+  QString path = QgsApplication::activeThemePath();
+  if ( QFile::exists( path + iconFile ) )
+    return path + iconFile;
+
+  // use default theme
+  return QgsApplication::defaultThemePath() + iconFile;
+}
+
+QgsDashSpaceDialog::QgsDashSpaceDialog( const QVector<qreal>& v, QWidget* parent, Qt::WindowFlags f ): QDialog( parent, f )
+{
+  setupUi( this );
+
+  mAddButton->setIcon( QIcon( iconPath( "symbologyAdd.png" ) ) );
+  mRemoveButton->setIcon( QIcon( iconPath( "symbologyRemove.png" ) ) );
+
+  double dash = 0;
+  double space = 0;
+  for ( int i = 0; i < ( v.size() - 1 ); ++i )
+  {
+    dash = v.at( i );
+    ++i;
+    space = v.at( i );
+    QTreeWidgetItem* entry = new QTreeWidgetItem();
+    entry->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
+    entry->setText( 0, QString::number( dash ) );
+    entry->setText( 1, QString::number( space ) );
+    mDashSpaceTreeWidget->addTopLevelItem( entry );
+  }
+}
+
+QgsDashSpaceDialog::~QgsDashSpaceDialog()
+{
+
+}
+
+void QgsDashSpaceDialog::on_mAddButton_clicked()
+{
+  //add new (default) item
+  QTreeWidgetItem* entry = new QTreeWidgetItem();
+  entry->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled );
+  entry->setText( 0, "5" );
+  entry->setText( 1, "2" );
+  mDashSpaceTreeWidget->addTopLevelItem( entry );
+}
+
+void QgsDashSpaceDialog::on_mRemoveButton_clicked()
+{
+  //get active item
+  QTreeWidgetItem* currentItem = mDashSpaceTreeWidget->currentItem();
+  if ( currentItem )
+  {
+    mDashSpaceTreeWidget->takeTopLevelItem( mDashSpaceTreeWidget->indexOfTopLevelItem( currentItem ) );
+  }
+}
+
+QVector<qreal> QgsDashSpaceDialog::dashDotVector() const
+{
+  QVector<qreal> dashVector;
+  int nTopLevelItems = mDashSpaceTreeWidget->topLevelItemCount();
+  for ( int i = 0; i < nTopLevelItems; ++i )
+  {
+    QTreeWidgetItem* currentItem = mDashSpaceTreeWidget->topLevelItem( i );
+    if ( currentItem )
+    {
+      dashVector << currentItem->text( 0 ).toDouble() << currentItem->text( 1 ).toDouble();
+    }
+  }
+  return dashVector;
+}
+

Added: trunk/qgis/src/gui/symbology-ng/qgsdashspacedialog.h
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgsdashspacedialog.h	                        (rev 0)
+++ trunk/qgis/src/gui/symbology-ng/qgsdashspacedialog.h	2010-01-18 15:49:01 UTC (rev 12788)
@@ -0,0 +1,36 @@
+/***************************************************************************
+    qgsdashspacedialog.h
+    ---------------------
+    begin                : January 2010
+    copyright            : (C) 2010 by Marco Hugentobler
+    email                : marco at hugis dot net
+ ***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef QGSDASHSPACEDIALOG_H
+#define QGSDASHSPACEDIALOG_H
+
+#include "ui_qgsdashspacedialogbase.h"
+
+/**A dialog to enter a custom dash space pattern for lines*/
+class QgsDashSpaceDialog: public QDialog, private Ui::QgsDashSpaceDialogBase
+{
+    Q_OBJECT
+  public:
+    QgsDashSpaceDialog( const QVector<qreal>& v, QWidget * parent = 0, Qt::WindowFlags f = 0 );
+    ~QgsDashSpaceDialog();
+
+    QVector<qreal> dashDotVector() const;
+
+  private slots:
+    void on_mAddButton_clicked();
+    void on_mRemoveButton_clicked();
+};
+
+#endif // QGSDASHSPACEDIALOG_H

Modified: trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp	2010-01-17 00:59:46 UTC (rev 12787)
+++ trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp	2010-01-18 15:49:01 UTC (rev 12788)
@@ -5,6 +5,7 @@
 #include "qgsmarkersymbollayerv2.h"
 #include "qgsfillsymbollayerv2.h"
 
+#include "qgsdashspacedialog.h"
 #include "qgssymbolv2propertiesdialog.h"
 
 #include "qgsapplication.h"
@@ -31,6 +32,7 @@
   connect( spinOffset, SIGNAL( valueChanged( double ) ), this, SLOT( offsetChanged() ) );
   connect( cboCapStyle, SIGNAL( currentIndexChanged( int ) ), this, SLOT( penStyleChanged() ) );
   connect( cboJoinStyle, SIGNAL( currentIndexChanged( int ) ), this, SLOT( penStyleChanged() ) );
+  updatePatternIcon();
 
 }
 
@@ -49,6 +51,23 @@
   spinOffset->setValue( mLayer->offset() );
   cboJoinStyle->setPenJoinStyle( mLayer->penJoinStyle() );
   cboCapStyle->setPenCapStyle( mLayer->penCapStyle() );
+
+  //use a custom dash pattern?
+  bool useCustomDashPattern = mLayer->useCustomDashPattern();
+  mChangePatternButton->setEnabled( useCustomDashPattern );
+  label_3->setEnabled( !useCustomDashPattern );
+  cboPenStyle->setEnabled( !useCustomDashPattern );
+  mCustomCheckBox->blockSignals( true );
+  if ( useCustomDashPattern )
+  {
+    mCustomCheckBox->setCheckState( Qt::Checked );
+  }
+  else
+  {
+    mCustomCheckBox->setCheckState( Qt::Unchecked );
+  }
+  mCustomCheckBox->blockSignals( false );
+  updatePatternIcon();
 }
 
 QgsSymbolLayerV2* QgsSimpleLineSymbolLayerV2Widget::symbolLayer()
@@ -86,7 +105,46 @@
   emit changed();
 }
 
+void QgsSimpleLineSymbolLayerV2Widget::on_mCustomCheckBox_stateChanged( int state )
+{
+  bool checked = ( state == Qt::Checked );
+  mChangePatternButton->setEnabled( checked );
+  label_3->setEnabled( !checked );
+  cboPenStyle->setEnabled( !checked );
 
+  mLayer->setUseCustomDashPattern( checked );
+  emit changed();
+}
+
+void QgsSimpleLineSymbolLayerV2Widget::on_mChangePatternButton_clicked()
+{
+  QgsDashSpaceDialog d( mLayer->customDashVector() );
+  if ( d.exec() == QDialog::Accepted )
+  {
+    mLayer->setCustomDashVector( d.dashDotVector() );
+    updatePatternIcon();
+    emit changed();
+  }
+}
+
+void QgsSimpleLineSymbolLayerV2Widget::updatePatternIcon()
+{
+  if ( !mLayer )
+  {
+    return;
+  }
+  QgsSimpleLineSymbolLayerV2* layerCopy = dynamic_cast<QgsSimpleLineSymbolLayerV2*>( mLayer->clone() );
+  if ( !layerCopy )
+  {
+    return;
+  }
+  layerCopy->setUseCustomDashPattern( true );
+  QIcon buttonIcon = QgsSymbolLayerV2Utils::symbolLayerPreviewIcon( layerCopy, QgsSymbolV2::MM, mChangePatternButton->iconSize() );
+  mChangePatternButton->setIcon( buttonIcon );
+  delete layerCopy;
+}
+
+
 ///////////
 
 

Modified: trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.h
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.h	2010-01-17 00:59:46 UTC (rev 12787)
+++ trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.h	2010-01-18 15:49:01 UTC (rev 12788)
@@ -46,9 +46,15 @@
     void colorChanged();
     void penStyleChanged();
     void offsetChanged();
+    void on_mCustomCheckBox_stateChanged( int state );
+    void on_mChangePatternButton_clicked();
 
+
   protected:
     QgsSimpleLineSymbolLayerV2* mLayer;
+
+    //creates a new icon for the 'change pattern' button
+    void updatePatternIcon();
 };
 
 ///////////

Added: trunk/qgis/src/ui/symbollayer/qgsdashspacedialogbase.ui
===================================================================
--- trunk/qgis/src/ui/symbollayer/qgsdashspacedialogbase.ui	                        (rev 0)
+++ trunk/qgis/src/ui/symbollayer/qgsdashspacedialogbase.ui	2010-01-18 15:49:01 UTC (rev 12788)
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>QgsDashSpaceDialogBase</class>
+ <widget class="QDialog" name="QgsDashSpaceDialogBase">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>400</width>
+    <height>277</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Dash space pattern</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="0" column="0">
+    <spacer name="horizontalSpacer">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>245</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="0" column="1">
+    <widget class="QPushButton" name="mRemoveButton">
+     <property name="text">
+      <string/>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2">
+    <widget class="QPushButton" name="mAddButton">
+     <property name="text">
+      <string/>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0" colspan="3">
+    <widget class="QTreeWidget" name="mDashSpaceTreeWidget">
+     <property name="columnCount">
+      <number>2</number>
+     </property>
+     <column>
+      <property name="text">
+       <string>Dash</string>
+      </property>
+     </column>
+     <column>
+      <property name="text">
+       <string>Space</string>
+      </property>
+     </column>
+    </widget>
+   </item>
+   <item row="2" column="0" colspan="3">
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>QgsDashSpaceDialogBase</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>QgsDashSpaceDialogBase</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>

Modified: trunk/qgis/src/ui/symbollayer/widget_simpleline.ui
===================================================================
--- trunk/qgis/src/ui/symbollayer/widget_simpleline.ui	2010-01-17 00:59:46 UTC (rev 12787)
+++ trunk/qgis/src/ui/symbollayer/widget_simpleline.ui	2010-01-18 15:49:01 UTC (rev 12788)
@@ -6,16 +6,16 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>368</width>
-    <height>244</height>
+    <width>358</width>
+    <height>296</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string>Form</string>
   </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <layout class="QGridLayout">
+  <layout class="QGridLayout" name="gridLayout_2">
+   <item row="0" column="0">
+    <layout class="QGridLayout" name="gridLayout">
      <item row="0" column="0">
       <widget class="QLabel" name="label">
        <property name="text">
@@ -23,7 +23,7 @@
        </property>
       </widget>
      </item>
-     <item row="0" column="1">
+     <item row="0" column="1" colspan="2">
       <widget class="QgsColorButtonV2" name="btnChangeColor">
        <property name="sizePolicy">
         <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -36,7 +36,7 @@
        </property>
       </widget>
      </item>
-     <item row="0" column="2" rowspan="4">
+     <item row="0" column="3" rowspan="3">
       <spacer>
        <property name="orientation">
         <enum>Qt::Horizontal</enum>
@@ -59,24 +59,36 @@
        </property>
       </widget>
      </item>
-     <item row="2" column="0">
-      <widget class="QLabel" name="label_3">
-       <property name="text">
-        <string>Pen style:</string>
+     <item row="1" column="1" colspan="2">
+      <widget class="QDoubleSpinBox" name="spinWidth">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
        </property>
+       <property name="alignment">
+        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+       </property>
+       <property name="decimals">
+        <number>2</number>
+       </property>
+       <property name="maximum">
+        <double>100000.000000000000000</double>
+       </property>
+       <property name="value">
+        <double>1.000000000000000</double>
+       </property>
       </widget>
      </item>
-     <item row="2" column="1">
-      <widget class="QgsPenStyleComboBox" name="cboPenStyle"/>
-     </item>
-     <item row="3" column="0">
+     <item row="2" column="0">
       <widget class="QLabel" name="label_4">
        <property name="text">
         <string>Offset:</string>
        </property>
       </widget>
      </item>
-     <item row="3" column="1">
+     <item row="2" column="1" colspan="2">
       <widget class="QDoubleSpinBox" name="spinOffset">
        <property name="alignment">
         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -92,31 +104,33 @@
        </property>
       </widget>
      </item>
-     <item row="1" column="1">
-      <widget class="QDoubleSpinBox" name="spinWidth">
-       <property name="sizePolicy">
-        <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
+     <item row="3" column="0">
+      <widget class="QLabel" name="label_3">
+       <property name="text">
+        <string>Pen style:</string>
        </property>
-       <property name="alignment">
-        <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+      </widget>
+     </item>
+     <item row="3" column="2">
+      <widget class="QgsPenStyleComboBox" name="cboPenStyle"/>
+     </item>
+     <item row="4" column="0" colspan="4">
+      <widget class="QCheckBox" name="mCustomCheckBox">
+       <property name="text">
+        <string>Use custom dash pattern</string>
        </property>
-       <property name="decimals">
-        <number>2</number>
+      </widget>
+     </item>
+     <item row="5" column="0" colspan="2">
+      <widget class="QPushButton" name="mChangePatternButton">
+       <property name="text">
+        <string>Change</string>
        </property>
-       <property name="maximum">
-        <double>100000.000000000000000</double>
-       </property>
-       <property name="value">
-        <double>1.000000000000000</double>
-       </property>
       </widget>
      </item>
     </layout>
    </item>
-   <item>
+   <item row="1" column="0">
     <spacer>
      <property name="orientation">
       <enum>Qt::Vertical</enum>
@@ -129,7 +143,7 @@
      </property>
     </spacer>
    </item>
-   <item>
+   <item row="2" column="0">
     <layout class="QGridLayout" name="gridLayout_1">
      <item row="0" column="0">
       <widget class="QLabel" name="label_5">



More information about the QGIS-commit mailing list