[QGIS Commit] r12134 - in branches/symbology-ng-branch/src:
gui/symbology-ng ui
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Sun Nov 15 17:47:26 EST 2009
Author: wonder
Date: 2009-11-15 17:47:24 -0500 (Sun, 15 Nov 2009)
New Revision: 12134
Modified:
branches/symbology-ng-branch/src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp
branches/symbology-ng-branch/src/ui/qgsrendererv2propsdialogbase.ui
Log:
Renderer properties: switched from list widget to a combo box with renderers
Modified: branches/symbology-ng-branch/src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp
===================================================================
--- branches/symbology-ng-branch/src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp 2009-11-15 22:29:32 UTC (rev 12133)
+++ branches/symbology-ng-branch/src/gui/symbology-ng/qgsrendererv2propertiesdialog.cpp 2009-11-15 22:47:24 UTC (rev 12134)
@@ -51,10 +51,11 @@
if (!pix.load(iconPath, "png"))
pix = QPixmap();
- QListWidgetItem* item = new QListWidgetItem(QIcon(pix), m.visibleName(), listRenderers);
- item->setData(Qt::UserRole, name);
+ cboRenderers->addItem(QIcon(pix), m.visibleName(), name);
}
+ cboRenderers->setCurrentIndex(-1); // set no current renderer
+
// if the layer doesn't use renderer V2, let's start using it!
if (!mLayer->isUsingRendererV2())
{
@@ -63,15 +64,15 @@
}
// setup slot rendererChanged()
- connect(listRenderers, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(rendererChanged()));
+ connect(cboRenderers, SIGNAL(currentIndexChanged(int)), this, SLOT(rendererChanged()));
// set current renderer from layer
QString rendererName = mLayer->rendererV2()->type();
- for (int i = 0; i < listRenderers->count(); i++)
+ for (int i = 0; i < cboRenderers->count(); i++)
{
- if (listRenderers->item(i)->data(Qt::UserRole).toString() == rendererName)
+ if (cboRenderers->itemData(i).toString() == rendererName)
{
- listRenderers->setCurrentItem( listRenderers->item(i) );
+ cboRenderers->setCurrentIndex(i);
return;
}
}
@@ -85,13 +86,13 @@
void QgsRendererV2PropertiesDialog::rendererChanged()
{
- if (listRenderers->currentItem() == NULL)
+ if (cboRenderers->currentIndex() == -1)
{
QgsDebugMsg("No current item -- this should never happen!");
return;
}
- QString rendererName = listRenderers->currentItem()->data(Qt::UserRole).toString();
+ QString rendererName = cboRenderers->itemData( cboRenderers->currentIndex() ).toString();
// get rid of old active widget (if any)
if (mActiveWidget)
Modified: branches/symbology-ng-branch/src/ui/qgsrendererv2propsdialogbase.ui
===================================================================
--- branches/symbology-ng-branch/src/ui/qgsrendererv2propsdialogbase.ui 2009-11-15 22:29:32 UTC (rev 12133)
+++ branches/symbology-ng-branch/src/ui/qgsrendererv2propsdialogbase.ui 2009-11-15 22:47:24 UTC (rev 12134)
@@ -13,36 +13,42 @@
<property name="windowTitle">
<string>Renderer settings</string>
</property>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QListWidget" name="listRenderers">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
- <horstretch>1</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="editTriggers">
- <set>QAbstractItemView::NoEditTriggers</set>
- </property>
- <property name="showDropIndicator" stdset="0">
- <bool>false</bool>
- </property>
- <property name="iconSize">
- <size>
- <width>48</width>
- <height>48</height>
- </size>
- </property>
- <property name="spacing">
- <number>4</number>
- </property>
- <property name="viewMode">
- <enum>QListView::IconMode</enum>
- </property>
- </widget>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Renderer:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="cboRenderers"/>
+ </item>
+ <item>
+ <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>
+ <item>
+ <widget class="QPushButton" name="btnSymbolLevels">
+ <property name="text">
+ <string>Symbol levels</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
- <item row="0" column="1" rowspan="2">
+ <item>
<widget class="QStackedWidget" name="stackedWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
@@ -69,24 +75,17 @@
</widget>
</widget>
</item>
- <item row="2" column="0" colspan="2">
+ <item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QPushButton" name="btnSymbolLevels">
- <property name="text">
- <string>Symbol levels</string>
- </property>
- </widget>
- </item>
</layout>
</widget>
<tabstops>
- <tabstop>listRenderers</tabstop>
+ <tabstop>cboRenderers</tabstop>
<tabstop>btnSymbolLevels</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
More information about the QGIS-commit
mailing list