Skip to content
Permalink
Browse files

Use icons on fields properties, disable "editable" where inappropriate

  • Loading branch information
m-kuhn committed Jul 23, 2014
1 parent 1395367 commit 1494069735dc5bce1e1056d93a0de9d6dc4e2641
Showing with 21 additions and 0 deletions.
  1. +7 −0 src/app/qgsattributetypedialog.cpp
  2. +14 −0 src/app/qgsfieldsproperties.cpp
@@ -62,6 +62,13 @@ QgsAttributeTypeDialog::QgsAttributeTypeDialog( QgsVectorLayer *vl , int fieldId
+ 2 );
selectionListWidget->setMaximumWidth( selectionListWidget->sizeHintForColumn( 0 )
+ 2 );

if ( vl->pendingFields().fieldOrigin( fieldIdx ) == QgsFields::OriginJoin ||
vl->pendingFields().fieldOrigin( fieldIdx ) == QgsFields::OriginExpression )
{
isFieldEditableCheckBox->setEnabled( false );
}

QSettings settings;
restoreGeometry( settings.value( "/Windows/QgsAttributeTypeDialog/geometry" ).toByteArray() );
}
@@ -212,6 +212,20 @@ void QgsFieldsProperties::setRow( int row, int idx, const QgsField& field )
dataItem->setData( Qt::DisplayRole, idx );
DesignerTreeItemData itemData( DesignerTreeItemData::Field, field.name() );
dataItem->setData( DesignerTreeRole, itemData.asQVariant() );
switch ( mLayer->pendingFields().fieldOrigin( idx ) )
{
case QgsFields::OriginExpression:
dataItem->setIcon( QgsApplication::getThemeIcon( "/mIconExpression.svg" ) );
break;

case QgsFields::OriginJoin:
dataItem->setIcon( QgsApplication::getThemeIcon( "/propertyicons/join.png" ) );
break;

default:
dataItem->setIcon( QgsApplication::getThemeIcon( "/propertyicons/attributes.png" ) );
break;
}
mFieldsList->setItem( row, attrIdCol, dataItem );
mIndexedWidgets.insert( idx, mFieldsList->item( row, 0 ) );
mFieldsList->setItem( row, attrNameCol, new QTableWidgetItem( field.name() ) );

0 comments on commit 1494069

Please sign in to comment.
You can’t perform that action at this time.