Skip to content

Commit

Permalink
Do not emit changed signal if the value has not really changed
Browse files Browse the repository at this point in the history
NULL case
  • Loading branch information
elpaso authored and nyalldawson committed Jun 7, 2019
1 parent cd42d65 commit bde5561
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 bde5561

Please sign in to comment.