5
5
#include < QComboBox>
6
6
#include < QPushButton>
7
7
8
- QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog ( const QMap< QString, QPair< QString, QString > >& properties, const QgsVectorLayer* vl,
9
- QWidget* parent, Qt::WindowFlags f ): QDialog( parent, f ), mVectorLayer( vl )
8
+ QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog ( const QList< DataDefinedSymbolEntry >& entries, const QgsVectorLayer* vl, QWidget * parent, Qt::WindowFlags f ): QDialog( parent, f ), mVectorLayer( vl )
10
9
{
11
10
setupUi ( this );
12
11
@@ -16,26 +15,26 @@ QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog( const QMap< QString, QPa
16
15
attributeFields = mVectorLayer ->pendingFields ();
17
16
}
18
17
19
- mTableWidget ->setRowCount ( properties .size () );
18
+ mTableWidget ->setRowCount ( entries .size () );
20
19
21
20
int i = 0 ;
22
- QMap< QString, QPair< QString, QString > > ::const_iterator it = properties .constBegin ();
23
- for ( ; it != properties .constEnd (); ++it )
21
+ QList< DataDefinedSymbolEntry > ::const_iterator entryIt = entries .constBegin ();
22
+ for ( ; entryIt != entries .constEnd (); ++entryIt )
24
23
{
25
24
// check box
26
25
QCheckBox* cb = new QCheckBox ( this );
27
- cb->setChecked ( !it. value (). second .isEmpty () );
26
+ cb->setChecked ( !entryIt-> initialValue .isEmpty () );
28
27
mTableWidget ->setCellWidget ( i, 0 , cb );
29
28
mTableWidget ->setColumnWidth ( 0 , cb->width () );
30
29
31
30
32
31
// property name
33
- QTableWidgetItem* propertyItem = new QTableWidgetItem ( it. value (). first );
34
- propertyItem->setData ( Qt::UserRole, it. key () );
32
+ QTableWidgetItem* propertyItem = new QTableWidgetItem ( entryIt-> title );
33
+ propertyItem->setData ( Qt::UserRole, entryIt-> property );
35
34
mTableWidget ->setItem ( i, 1 , propertyItem );
36
35
37
36
// attribute list
38
- QString expressionString = it. value (). second ;
37
+ QString expressionString = entryIt-> initialValue ;
39
38
QComboBox* attributeComboBox = new QComboBox ( this );
40
39
attributeComboBox->addItem ( QString () );
41
40
for ( int j = 0 ; j < attributeFields.count (); ++j )
@@ -59,6 +58,11 @@ QgsDataDefinedSymbolDialog::QgsDataDefinedSymbolDialog( const QMap< QString, QPa
59
58
QPushButton* expressionButton = new QPushButton ( " ..." , this );
60
59
QObject::connect ( expressionButton, SIGNAL ( clicked () ), this , SLOT ( expressionButtonClicked () ) );
61
60
mTableWidget ->setCellWidget ( i, 3 , expressionButton );
61
+
62
+ // help text
63
+ QTableWidgetItem* helpItem = new QTableWidgetItem ( entryIt->helpText );
64
+ mTableWidget ->setItem ( i, 4 , helpItem );
65
+
62
66
++i;
63
67
}
64
68
}
@@ -158,3 +162,23 @@ int QgsDataDefinedSymbolDialog::comboIndexForExpressionString( const QString& ex
158
162
}
159
163
return comboIndex;
160
164
}
165
+
166
+ QString QgsDataDefinedSymbolDialog::doubleHelpText ()
167
+ {
168
+ return tr ( " double" );
169
+ }
170
+
171
+ QString QgsDataDefinedSymbolDialog::colorHelpText ()
172
+ {
173
+ return tr ( " '<red>,<green>,<blue>,<alpha>'" );
174
+ }
175
+
176
+ QString QgsDataDefinedSymbolDialog::offsetHelpText ()
177
+ {
178
+ return " <x>,<y>" ;
179
+ }
180
+
181
+ QString QgsDataDefinedSymbolDialog::fileNameHelpText ()
182
+ {
183
+ return tr ( " '<filename>'" );
184
+ }
0 commit comments