Skip to content

Commit 0deb329

Browse files
marcomach0
marco
authored andcommitted
Insert date value in attribute editor
1 parent 083924b commit 0deb329

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/gui/qgsattributeeditor.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -716,9 +716,15 @@ bool QgsAttributeEditor::setValue( QWidget *editor, QgsVectorLayer *vl, int idx,
716716
case QgsVectorLayer::FileName:
717717
case QgsVectorLayer::Calendar:
718718
{
719-
QLineEdit *le = editor->findChild<QLineEdit *>();
720-
if ( le == NULL )
719+
QLineEdit* le = qobject_cast<QLineEdit*>( editor );
720+
if( !le )
721+
{
722+
le = editor->findChild<QLineEdit *>();
723+
}
724+
if ( !le )
725+
{
721726
return false;
727+
}
722728
le->setText( value.toString() );
723729
}
724730
break;

0 commit comments

Comments
 (0)