Skip to content

Commit

Permalink
append required date format to field label in attribute dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Jul 5, 2013
1 parent 7587972 commit 5c6ddba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gui/qgsattributedialog.cpp
Expand Up @@ -177,6 +177,13 @@ QgsAttributeDialog::QgsAttributeDialog( QgsVectorLayer *vl, QgsFeature *thepFeat
{
//show attribute alias if available
QString myFieldName = vl->attributeDisplayName( fldIdx );
// by default (until user defined alias) append date format
// (validator does not allow to enter a value in wrong format)
const QgsField &myField = theFields[fldIdx];
if ( myField.type() == QVariant::Date && vl->attributeAlias( fldIdx ).isEmpty() )
{
myFieldName += " (" + vl->dateFormat( fldIdx ) + ")";
}

QWidget *myWidget = QgsAttributeEditor::createAttributeEditor( 0, 0, vl, fldIdx, myAttributes[fldIdx], mProxyWidgets );
if ( !myWidget )
Expand Down

0 comments on commit 5c6ddba

Please sign in to comment.