Skip to content

Commit

Permalink
Fix crash when 'use popup' is selected for time based datetime widgets
Browse files Browse the repository at this point in the history
(cherry-picked from 63cc762)
  • Loading branch information
nyalldawson committed Sep 14, 2016
1 parent e6a1d5f commit 3bc6c47
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsdatetimeeditwrapper.cpp
Expand Up @@ -66,7 +66,7 @@ void QgsDateTimeEditWrapper::initWidget( QWidget *editor )

const bool calendar = config( "calendar_popup", false ).toBool();
mQDateTimeEdit->setCalendarPopup( calendar );
if ( calendar )
if ( calendar && mQDateTimeEdit->calendarWidget() )
{
// highlight today's date
QTextCharFormat todayFormat;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsdatetimesearchwidgetwrapper.cpp
Expand Up @@ -156,7 +156,7 @@ void QgsDateTimeSearchWidgetWrapper::initWidget( QWidget* editor )

const bool calendar = config( "calendar_popup", false ).toBool();
mDateTimeEdit->setCalendarPopup( calendar );
if ( calendar )
if ( calendar && mDateTimeEdit->calendarWidget() )
{
// highlight today's date
QTextCharFormat todayFormat;
Expand Down

0 comments on commit 3bc6c47

Please sign in to comment.