12 : QDialog( parent, f )
24 QList< DataDefinedSymbolEntry >::const_iterator entryIt = entries.constBegin();
25 for ( ; entryIt != entries.constEnd(); ++entryIt )
27 QTreeWidgetItem* item =
new QTreeWidgetItem( mTreeWidget );
30 QCheckBox* cb =
new QCheckBox( entryIt->title,
this );
31 cb->setChecked( !entryIt->initialValue.isEmpty() );
32 item->setData( 0, Qt::UserRole, entryIt->property );
33 mTreeWidget->setItemWidget( item, 0, cb );
37 few->setMaximumWidth( 350 );
38 few->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Maximum );
39 few->
setLayer( const_cast<QgsVectorLayer*>( vl ) );
40 few->
setField( entryIt->initialValue );
41 mTreeWidget->setItemWidget( item, 1, few );
44 item->setText( 2, entryIt->helpText );
46 mTreeWidget->addTopLevelItem( item );
50 for (
int c = 0; c != mTreeWidget->columnCount() - 1; c++ )
51 mTreeWidget->resizeColumnToContents( c );
54 restoreGeometry( settings.value(
"/Windows/QgsDataDefinedSymbolDialog/geometry" ).toByteArray() );
60 settings.setValue(
"/Windows/QgsDataDefinedSymbolDialog/geometry", saveGeometry() );
65 QMap< QString, QString > propertyMap;
66 int rowCount = mTreeWidget->topLevelItemCount();
67 for (
int i = 0; i < rowCount; ++i )
69 QTreeWidgetItem* item = mTreeWidget->topLevelItem( i );
71 QString propertyKey = item->data( 0, Qt::UserRole ).toString();
74 QCheckBox* cb = qobject_cast<QCheckBox*>( mTreeWidget->itemWidget( item, 0 ) );
77 checked = cb->isChecked();
79 QString expressionString;
85 propertyMap.insert( propertyKey, expressionString );
92 return tr(
"double" );
97 return tr(
"'<red>,<green>,<blue>,<alpha>'" );
107 return tr(
"'<filename>'" );
113 return "'left'|'center'|'right'";
119 return "'top'|'center'|'bottom'";
124 return tr(
"'linear'|'radial'|'conical'" );
129 return tr(
"'feature'|'viewport'" );
134 return tr(
"'pad'|'repeat'|'reflect'" );
139 return tr(
"0 (false)|1 (true)" );
144 return "'no'|'solid'|'dash'|'dot'|'dash dot'|'dash dot dot'";
149 return "'bevel'|'miter'|'round'";
154 return "'square'|'flat'|'round'";
159 return "'solid'|'horizontal'|'vertical'|'cross'|'b_diagonal'|'f_diagonal'|"
160 "'diagonal_x'|'dense1'|'dense2'|'dense3'|'dense4'|'dense5'|"
161 "'dense6'|'dense7'|'no'";