[QGIS Commit] r12709 - in trunk/qgis/src: app app/composer core/composer ui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Jan 8 11:30:11 EST 2010


Author: mhugent
Date: 2010-01-08 11:30:10 -0500 (Fri, 08 Jan 2010)
New Revision: 12709

Added:
   trunk/qgis/src/app/composer/qgsattributeselectiondialog.cpp
   trunk/qgis/src/app/composer/qgsattributeselectiondialog.h
Modified:
   trunk/qgis/src/app/CMakeLists.txt
   trunk/qgis/src/app/composer/qgscomposertablewidget.cpp
   trunk/qgis/src/app/composer/qgscomposertablewidget.h
   trunk/qgis/src/core/composer/qgscomposertable.cpp
   trunk/qgis/src/core/composer/qgscomposertable.h
   trunk/qgis/src/ui/qgscomposertablewidgetbase.ui
Log:
Added selection of display attributes and aliases to composer table item

Modified: trunk/qgis/src/app/CMakeLists.txt
===================================================================
--- trunk/qgis/src/app/CMakeLists.txt	2010-01-08 15:51:44 UTC (rev 12708)
+++ trunk/qgis/src/app/CMakeLists.txt	2010-01-08 16:30:10 UTC (rev 12709)
@@ -73,6 +73,7 @@
   qgsvectorlayerproperties.cpp
   qgsquerybuilder.cpp
 
+  composer/qgsattributeselectiondialog.cpp
   composer/qgscomposer.cpp
   composer/qgscomposerarrowwidget.cpp
   composer/qgscomposeritemwidget.cpp

Added: trunk/qgis/src/app/composer/qgsattributeselectiondialog.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgsattributeselectiondialog.cpp	                        (rev 0)
+++ trunk/qgis/src/app/composer/qgsattributeselectiondialog.cpp	2010-01-08 16:30:10 UTC (rev 12709)
@@ -0,0 +1,144 @@
+/***************************************************************************
+                         qgsattributeselectiondialog.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 "qgsattributeselectiondialog.h"
+#include "qgsvectorlayer.h"
+#include <QCheckBox>
+#include <QDialogButtonBox>
+#include <QGridLayout>
+#include <QLabel>
+#include <QLineEdit>
+
+QgsAttributeSelectionDialog::QgsAttributeSelectionDialog(const QgsVectorLayer* vLayer, const QSet<int>& enabledAttributes, const QMap<int, QString>& aliasMap, \
+                                                         QWidget * parent, Qt::WindowFlags f): QDialog(parent, f), mVectorLayer(vLayer)
+{
+    if( vLayer )
+    {
+        mGridLayout = new QGridLayout(this);
+        QLabel* attributeLabel = new QLabel(QString("<b>") + tr("Attribute") + QString("</b>"), this );
+        attributeLabel->setTextFormat(Qt::RichText);
+        mGridLayout->addWidget(attributeLabel, 0, 0);
+        QLabel* aliasLabel = new QLabel(QString("<b>") + tr("Alias") + QString("</b>"), this );
+        aliasLabel->setTextFormat(Qt::RichText);
+        mGridLayout->addWidget(aliasLabel, 0, 1);
+
+        QgsFieldMap fieldMap = vLayer->pendingFields();
+        QgsFieldMap::const_iterator fieldIt = fieldMap.constBegin();
+        int layoutRowCounter = 1;
+        for(; fieldIt != fieldMap.constEnd(); ++fieldIt)
+        {
+            QCheckBox* attributeCheckBox = new QCheckBox(fieldIt.value().name(), this);
+            if( enabledAttributes.size() < 1 || enabledAttributes.contains(fieldIt.key()) )
+            {
+                attributeCheckBox->setCheckState(Qt::Checked);
+            }
+            else
+            {
+                attributeCheckBox->setCheckState(Qt::Unchecked);
+            }
+            mGridLayout->addWidget(attributeCheckBox, layoutRowCounter, 0);
+
+            QLineEdit* attributeLineEdit = new QLineEdit(this);
+            QMap<int, QString>::const_iterator aliasIt = aliasMap.find( fieldIt.key() );
+            if(aliasIt != aliasMap.constEnd())
+            {
+                attributeLineEdit->setText(aliasIt.value());
+            }
+            mGridLayout->addWidget(attributeLineEdit, layoutRowCounter, 1);
+            ++layoutRowCounter;
+        }
+
+        QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
+        QObject::connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
+        QObject::connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
+        mGridLayout->addWidget( buttonBox, layoutRowCounter, 0, 3, 1);
+    }
+}
+
+QgsAttributeSelectionDialog::~QgsAttributeSelectionDialog()
+{
+
+}
+
+QSet<int> QgsAttributeSelectionDialog::enabledAttributes() const
+{
+    QSet<int> result;
+    if(!mGridLayout || !mVectorLayer)
+    {
+        return result;
+    }
+
+    for( int i = 1; i < mGridLayout->rowCount(); ++i)
+    {
+        bool boxChecked = false;
+        QLayoutItem* checkBoxItem = mGridLayout->itemAtPosition(i, 0);
+        if(checkBoxItem)
+        {
+            QWidget* checkBoxWidget = checkBoxItem->widget();
+            if(checkBoxWidget)
+            {
+                QCheckBox* checkBox = dynamic_cast<QCheckBox*>(checkBoxWidget);
+                if(checkBox)
+                {
+                    if(checkBox->checkState() == Qt::Checked)
+                    {
+                        result.insert(mVectorLayer->fieldNameIndex(checkBox->text()));
+                    }
+                }
+            }
+        }
+    }
+
+    return result;
+}
+
+QMap<int, QString> QgsAttributeSelectionDialog::aliasMap() const
+{
+    QMap<int, QString> result;
+    if(!mGridLayout || !mVectorLayer)
+    {
+        return result;
+    }
+
+    for( int i = 1; i < mGridLayout->rowCount(); ++i)
+    {
+        QLayoutItem* lineEditItem = mGridLayout->itemAtPosition(i, 1);
+        QLayoutItem* checkBoxItem = mGridLayout->itemAtPosition(i, 0);
+        if(lineEditItem && checkBoxItem)
+        {
+            QWidget* lineEditWidget = lineEditItem->widget();
+            QWidget* checkBoxWidget = checkBoxItem->widget();
+            if(lineEditWidget)
+            {
+                QLineEdit* lineEdit = dynamic_cast<QLineEdit*>(lineEditWidget);
+                QCheckBox* checkBox = dynamic_cast<QCheckBox*>(checkBoxWidget);
+                if(lineEdit)
+                {
+                    QString aliasText = lineEdit->text();
+                    if(!aliasText.isEmpty())
+                    {
+                        //insert into map
+                        int fieldIndex = mVectorLayer->fieldNameIndex( checkBox->text() );
+                        result.insert(fieldIndex, aliasText);
+                    }
+                }
+            }
+        }
+    }
+    return result;
+}
+

Added: trunk/qgis/src/app/composer/qgsattributeselectiondialog.h
===================================================================
--- trunk/qgis/src/app/composer/qgsattributeselectiondialog.h	                        (rev 0)
+++ trunk/qgis/src/app/composer/qgsattributeselectiondialog.h	2010-01-08 16:30:10 UTC (rev 12709)
@@ -0,0 +1,45 @@
+/***************************************************************************
+                         qgsattributeselectiondialog.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 QGSATTRIBUTESELECTIONDIALOG_H
+#define QGSATTRIBUTESELECTIONDIALOG_H
+
+#include <QDialog>
+#include <QMap>
+#include <QSet>
+
+class QGridLayout;
+class QgsVectorLayer;
+
+/**A dialog to select what attributes to display (in the table item) and with the possibility to set different aliases*/
+class QgsAttributeSelectionDialog: public QDialog
+{
+    public:
+        QgsAttributeSelectionDialog(const QgsVectorLayer* vLayer, const QSet<int>& enabledAttributes, const QMap<int, QString>& aliasMap, QWidget * parent = 0, Qt::WindowFlags f = 0);
+        ~QgsAttributeSelectionDialog();
+
+        /**Returns indices of selected attributes*/
+        QSet<int> enabledAttributes() const;
+        /**Returns alias map (alias might be different than for vector layer)*/
+        QMap<int, QString> aliasMap() const;
+
+    private:
+        const QgsVectorLayer* mVectorLayer;
+        QGridLayout* mGridLayout;
+};
+
+#endif // QGSATTRIBUTESELECTIONDIALOG_H

Modified: trunk/qgis/src/app/composer/qgscomposertablewidget.cpp
===================================================================
--- trunk/qgis/src/app/composer/qgscomposertablewidget.cpp	2010-01-08 15:51:44 UTC (rev 12708)
+++ trunk/qgis/src/app/composer/qgscomposertablewidget.cpp	2010-01-08 16:30:10 UTC (rev 12709)
@@ -16,6 +16,7 @@
  ***************************************************************************/
 
 #include "qgscomposertablewidget.h"
+#include "qgsattributeselectiondialog.h"
 #include "qgscomposeritemwidget.h"
 #include "qgscomposertable.h"
 #include "qgscomposermap.h"
@@ -95,6 +96,23 @@
   }
 }
 
+void QgsComposerTableWidget::on_mAttributesPushButton_clicked()
+{
+  if ( !mComposerTable )
+  {
+    return;
+  }
+
+  QgsAttributeSelectionDialog d( mComposerTable->vectorLayer(), mComposerTable->displayAttributes(), mComposerTable->fieldAliasMap(), 0 );
+  if ( d.exec() == QDialog::Accepted )
+  {
+    //change displayAttributes and aliases
+    mComposerTable->setDisplayAttributes( d.enabledAttributes() );
+    mComposerTable->setFieldAliasMap( d.aliasMap() );
+    mComposerTable->update();
+  }
+}
+
 void QgsComposerTableWidget::on_mComposerMapComboBox_currentIndexChanged( int index )
 {
   if ( !mComposerTable )

Modified: trunk/qgis/src/app/composer/qgscomposertablewidget.h
===================================================================
--- trunk/qgis/src/app/composer/qgscomposertablewidget.h	2010-01-08 15:51:44 UTC (rev 12708)
+++ trunk/qgis/src/app/composer/qgscomposertablewidget.h	2010-01-08 16:30:10 UTC (rev 12709)
@@ -39,6 +39,7 @@
 
   private slots:
     void on_mLayerComboBox_currentIndexChanged( int index );
+    void on_mAttributesPushButton_clicked();
     void on_mComposerMapComboBox_currentIndexChanged( int index );
     void on_mMaximumColumnsSpinBox_valueChanged( int i );
     void on_mMarginSpinBox_valueChanged( double d );

Modified: trunk/qgis/src/core/composer/qgscomposertable.cpp
===================================================================
--- trunk/qgis/src/core/composer/qgscomposertable.cpp	2010-01-08 15:51:44 UTC (rev 12708)
+++ trunk/qgis/src/core/composer/qgscomposertable.cpp	2010-01-08 16:30:10 UTC (rev 12709)
@@ -33,6 +33,24 @@
 
 }
 
+void QgsComposerTable::initializeAliasMap()
+{
+  mFieldAliasMap.clear();
+  if ( mVectorLayer )
+  {
+    QgsFieldMap fieldMap = mVectorLayer->pendingFields();
+    QgsFieldMap::const_iterator it = fieldMap.constBegin();
+    for ( ; it != fieldMap.constEnd(); ++it )
+    {
+      QString currentAlias = mVectorLayer->attributeAlias( it.key() );
+      if ( !currentAlias.isEmpty() )
+      {
+        mFieldAliasMap.insert( it.key(), currentAlias );
+      }
+    }
+  }
+}
+
 void QgsComposerTable::setComposerMap( const QgsComposerMap* map )
 {
   if ( mComposerMap )
@@ -46,6 +64,16 @@
   }
 }
 
+void QgsComposerTable::setVectorLayer( QgsVectorLayer* vl )
+{
+  if ( vl != mVectorLayer )
+  {
+    mDisplayAttributes.clear();
+    mVectorLayer = vl;
+    initializeAliasMap();
+  }
+}
+
 void QgsComposerTable::paint( QPainter* painter, const QStyleOptionGraphicsItem* itemStyle, QWidget* pWidget )
 {
   if ( !painter )
@@ -81,11 +109,15 @@
   QgsFieldMap::const_iterator fieldIt = vectorFields.constBegin();
   for ( ; fieldIt != vectorFields.constEnd(); ++fieldIt )
   {
+    if ( mDisplayAttributes.size() > 0 && !mDisplayAttributes.contains( fieldIt.key() ) )
+    {
+      continue;
+    }
     currentY = mGridStrokeWidth;
     currentY += mLineTextDistance;
     currentY += fontAscentMillimeters( mHeaderFont );
     currentX += mLineTextDistance;
-    drawText( painter, currentX, currentY, fieldIt.value().name(), mHeaderFont );
+    drawText( painter, currentX, currentY, attributeDisplayName( fieldIt.key(), fieldIt.value().name() ), mHeaderFont );
 
     currentY += mLineTextDistance;
     currentY += mGridStrokeWidth;
@@ -156,8 +188,32 @@
   {
     composerTableElem.setAttribute( "vectorLayer", mVectorLayer->getLayerID() );
   }
+
+  //display attributes
+  QDomElement displayAttributesElem = doc.createElement( "displayAttributes" );
+  QSet<int>::const_iterator attIt = mDisplayAttributes.constBegin();
+  for ( ; attIt != mDisplayAttributes.constEnd(); ++attIt )
+  {
+    QDomElement attributeIndexElem = doc.createElement( "attributeEntry" );
+    attributeIndexElem.setAttribute( "index", *attIt );
+    displayAttributesElem.appendChild( attributeIndexElem );
+  }
+  composerTableElem.appendChild( displayAttributesElem );
+
+  //alias map
+  QDomElement aliasMapElem = doc.createElement( "attributeAliasMap" );
+  QMap<int, QString>::const_iterator aliasIt = mFieldAliasMap.constBegin();
+  for ( ; aliasIt != mFieldAliasMap.constEnd(); ++aliasIt )
+  {
+    QDomElement mapEntryElem = doc.createElement( "aliasEntry" );
+    mapEntryElem.setAttribute( "key", aliasIt.key() );
+    mapEntryElem.setAttribute( "value", aliasIt.value() );
+    aliasMapElem.appendChild( mapEntryElem );
+  }
+  composerTableElem.appendChild( aliasMapElem );
+
   elem.appendChild( composerTableElem );
-  return _writeXML( composerTableElem, doc );;
+  return _writeXML( composerTableElem, doc );
 }
 
 bool QgsComposerTable::readXML( const QDomElement& itemElem, const QDomDocument& doc )
@@ -211,6 +267,40 @@
     }
   }
 
+  //restore display attribute map
+  mDisplayAttributes.clear();
+  QDomNodeList displayAttributeList = itemElem.elementsByTagName( "displayAttributes" );
+  if ( displayAttributeList.size() > 0 )
+  {
+    QDomElement displayAttributesElem =  displayAttributeList.at( 0 ).toElement();
+    QDomNodeList attributeEntryList = displayAttributesElem.elementsByTagName( "attributeEntry" );
+    for ( int i = 0; i < attributeEntryList.size(); ++i )
+    {
+      QDomElement attributeEntryElem = attributeEntryList.at( i ).toElement();
+      int index = attributeEntryElem.attribute( "index", "-1" ).toInt();
+      if ( index != -1 )
+      {
+        mDisplayAttributes.insert( index );
+      }
+    }
+  }
+
+  //restore alias map
+  mFieldAliasMap.clear();
+  QDomNodeList aliasMapNodeList = itemElem.elementsByTagName( "attributeAliasMap" );
+  if ( aliasMapNodeList.size() > 0 )
+  {
+    QDomElement attributeAliasMapElem = aliasMapNodeList.at( 0 ).toElement();
+    QDomNodeList aliasMepEntryList = attributeAliasMapElem.elementsByTagName( "aliasEntry" );
+    for ( int i = 0; i < aliasMepEntryList.size(); ++i )
+    {
+      QDomElement aliasEntryElem = aliasMepEntryList.at( i ).toElement();
+      int key = aliasEntryElem.attribute( "key", "-1" ).toInt();
+      QString value = aliasEntryElem.attribute( "value", "" );
+      mFieldAliasMap.insert( key, value );
+    }
+  }
+
   //restore general composer item properties
   QDomNodeList composerItemList = itemElem.elementsByTagName( "ComposerItem" );
   if ( composerItemList.size() > 0 )
@@ -235,7 +325,14 @@
     selectionRect = mComposerMap->extent();
   }
 
-  mVectorLayer->select( mVectorLayer->pendingAllAttributesList(), selectionRect, false, true );
+  if ( mDisplayAttributes.size() < 1 )
+  {
+    mVectorLayer->select( mVectorLayer->pendingAllAttributesList(), selectionRect, false, true );
+  }
+  else
+  {
+    mVectorLayer->select( mDisplayAttributes.toList(), selectionRect, false, true );
+  }
   QgsFeature f;
   int counter = 0;
   while ( mVectorLayer->nextFeature( f ) && counter < mMaximumNumberOfFeatures )
@@ -260,7 +357,10 @@
   QgsFieldMap::const_iterator fieldIt = vectorFields.constBegin();
   for ( ; fieldIt != vectorFields.constEnd(); ++fieldIt )
   {
-    maxWidthMap.insert( fieldIt.key(), textWidthMillimeters( mHeaderFont, fieldIt.value().name() ) );
+    if ( mDisplayAttributes.size() < 1 || mDisplayAttributes.contains( fieldIt.key() ) )
+    {
+      maxWidthMap.insert( fieldIt.key(), textWidthMillimeters( mHeaderFont, attributeDisplayName( fieldIt.key(), fieldIt.value().name() ) ) );
+    }
   }
 
   //go through all the attributes and adapt the max width values
@@ -337,3 +437,16 @@
   }
 }
 
+QString QgsComposerTable::attributeDisplayName( int attributeIndex, const QString& name ) const
+{
+  QMap<int, QString>::const_iterator it = mFieldAliasMap.find( attributeIndex );
+  if ( it != mFieldAliasMap.constEnd() )
+  {
+    return it.value();
+  }
+  else
+  {
+    return name;
+  }
+}
+

Modified: trunk/qgis/src/core/composer/qgscomposertable.h
===================================================================
--- trunk/qgis/src/core/composer/qgscomposertable.h	2010-01-08 15:51:44 UTC (rev 12708)
+++ trunk/qgis/src/core/composer/qgscomposertable.h	2010-01-08 16:30:10 UTC (rev 12709)
@@ -20,6 +20,7 @@
 
 #include "qgscomposeritem.h"
 #include "qgsfeature.h"
+#include <QSet>
 
 class QgsComposerMap;
 class QgsVectorLayer;
@@ -37,7 +38,7 @@
     bool writeXML( QDomElement& elem, QDomDocument & doc ) const;
     bool readXML( const QDomElement& itemElem, const QDomDocument& doc );
 
-    void setVectorLayer( QgsVectorLayer* vl ) { mVectorLayer = vl; }
+    void setVectorLayer( QgsVectorLayer* vl );// { mVectorLayer = vl; }
     const QgsVectorLayer* vectorLayer() const { return mVectorLayer; }
 
     void setComposerMap( const QgsComposerMap* map );
@@ -64,6 +65,12 @@
     void setGridColor( const QColor& c ) { mGridColor = c; }
     QColor gridColor() const { return mGridColor; }
 
+    QSet<int> displayAttributes() const { return mDisplayAttributes; }
+    void setDisplayAttributes( const QSet<int>& attr ) { mDisplayAttributes = attr;}
+
+    QMap<int, QString> fieldAliasMap() const { return mFieldAliasMap; }
+    void setFieldAliasMap( const QMap<int, QString>& map ) { mFieldAliasMap = map; }
+
   private:
     /**Associated vector layer*/
     QgsVectorLayer* mVectorLayer;
@@ -81,6 +88,11 @@
     double mGridStrokeWidth;
     QColor mGridColor;
 
+    /**List of attribute indices to display (or all attributes if list is empty)*/
+    QSet<int> mDisplayAttributes;
+    /**Map of attribute name aliases. The aliases might be different to those of QgsVectorLayer (but those from the vector layer are the default)*/
+    QMap<int, QString> mFieldAliasMap;
+
     /**Retrieves feature attributes*/
     bool getFeatureAttributes( QList<QgsAttributeMap>& attributes );
     /**Calculate the maximum width values of the vector attributes*/
@@ -89,6 +101,10 @@
     void adaptItemFrame( const QMap<int, double>& maxWidthMap, const QList<QgsAttributeMap>& attributeList );
     void drawHorizontalGridLines( QPainter* p, int nAttributes );
     void drawVerticalGridLines( QPainter* p, const QMap<int, double>& maxWidthMap );
+    /**Inserts aliases from vector layer as starting configuration to the alias map*/
+    void initializeAliasMap();
+    /**Returns the attribute name to display in the item (attribute name or an alias if present)*/
+    QString attributeDisplayName( int attributeIndex, const QString& name ) const;
 };
 
 #endif // QGSCOMPOSERTABLE_H

Modified: trunk/qgis/src/ui/qgscomposertablewidgetbase.ui
===================================================================
--- trunk/qgis/src/ui/qgscomposertablewidgetbase.ui	2010-01-08 15:51:44 UTC (rev 12708)
+++ trunk/qgis/src/ui/qgscomposertablewidgetbase.ui	2010-01-08 16:30:10 UTC (rev 12709)
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>239</width>
-    <height>281</height>
+    <width>258</width>
+    <height>317</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -24,8 +24,8 @@
        <rect>
         <x>0</x>
         <y>0</y>
-        <width>221</width>
-        <height>237</height>
+        <width>240</width>
+        <height>273</height>
        </rect>
       </property>
       <attribute name="label">
@@ -46,7 +46,14 @@
          </item>
         </layout>
        </item>
-       <item row="1" column="0" colspan="2">
+       <item row="1" column="0">
+        <widget class="QPushButton" name="mAttributesPushButton">
+         <property name="text">
+          <string>Attributes...</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0" colspan="2">
         <layout class="QHBoxLayout" name="horizontalLayout_3">
          <item>
           <widget class="QLabel" name="mComposerMapLabel">
@@ -60,7 +67,7 @@
          </item>
         </layout>
        </item>
-       <item row="2" column="0" colspan="2">
+       <item row="3" column="0" colspan="2">
         <layout class="QHBoxLayout" name="horizontalLayout_2">
          <item>
           <widget class="QLabel" name="mMaxNumFeaturesLabel">
@@ -74,7 +81,7 @@
          </item>
         </layout>
        </item>
-       <item row="3" column="0" colspan="2">
+       <item row="4" column="0" colspan="2">
         <layout class="QHBoxLayout" name="horizontalLayout">
          <item>
           <widget class="QLabel" name="mMarginLabel">
@@ -88,14 +95,14 @@
          </item>
         </layout>
        </item>
-       <item row="4" column="0" colspan="2">
+       <item row="5" column="0">
         <widget class="QCheckBox" name="mShowGridCheckBox">
          <property name="text">
           <string>Show grid</string>
          </property>
         </widget>
        </item>
-       <item row="5" column="0" colspan="2">
+       <item row="6" column="0" colspan="2">
         <layout class="QHBoxLayout" name="horizontalLayout_5">
          <item>
           <widget class="QLabel" name="mGridStrokeWidthLabel">
@@ -109,14 +116,14 @@
          </item>
         </layout>
        </item>
-       <item row="6" column="0">
+       <item row="7" column="0">
         <widget class="QLabel" name="mGridColorLabel">
          <property name="text">
           <string>Grid color</string>
          </property>
         </widget>
        </item>
-       <item row="6" column="1">
+       <item row="7" column="1">
         <widget class="QgsColorButton" name="mGridColorButton">
          <property name="sizePolicy">
           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
@@ -129,20 +136,33 @@
          </property>
         </widget>
        </item>
-       <item row="7" column="0">
+       <item row="8" column="0">
         <widget class="QPushButton" name="mHeaderFontPushButton">
          <property name="text">
           <string>Header Font...</string>
          </property>
         </widget>
        </item>
-       <item row="7" column="1">
+       <item row="8" column="1">
         <widget class="QPushButton" name="mContentFontPushButton">
          <property name="text">
           <string>Content Font...</string>
          </property>
         </widget>
        </item>
+       <item row="1" column="1">
+        <spacer name="horizontalSpacer">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
       </layout>
      </widget>
     </widget>



More information about the QGIS-commit mailing list