Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Do not emit changed signal if the value has not really changed
NULL case
  • Loading branch information
elpaso committed Jun 6, 2019
1 parent 0d4bb76 commit 6aa09b9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/gui/editorwidgets/qgsdatetimeedit.cpp
Expand Up @@ -62,7 +62,11 @@ void QgsDateTimeEdit::clear()
{
displayNull();

changed( QDateTime() );
// Check if it's really changed or crash, see GH #29937
if ( ! dateTime().isNull() )
{
changed( QDateTime() );
}

// emit signal of QDateTime::dateTimeChanged with an invalid date
// anyway, using parent's signal should be avoided
Expand Down Expand Up @@ -252,6 +256,7 @@ void QgsDateTimeEdit::setDateTime( const QDateTime &dateTime )
{
clear();
}
// Check if it's really changed or crash, see GH #29937
else if ( dateTime != QgsDateTimeEdit::dateTime() )
{
QDateTimeEdit::setDateTime( dateTime );
Expand Down

0 comments on commit 6aa09b9

Please sign in to comment.