Skip to content

Commit 34d7c3b

Browse files
committed
Fix crash when 'use popup' is selected for time based datetime widgets
(cherry-picked from 63cc762)
1 parent 7ac9807 commit 34d7c3b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/gui/editorwidgets/qgsdatetimeeditwrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void QgsDateTimeEditWrapper::initWidget( QWidget *editor )
6666

6767
const bool calendar = config( "calendar_popup", false ).toBool();
6868
mQDateTimeEdit->setCalendarPopup( calendar );
69-
if ( calendar )
69+
if ( calendar && mQDateTimeEdit->calendarWidget() )
7070
{
7171
// highlight today's date
7272
QTextCharFormat todayFormat;

src/gui/editorwidgets/qgsdatetimesearchwidgetwrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ void QgsDateTimeSearchWidgetWrapper::initWidget( QWidget* editor )
156156

157157
const bool calendar = config( "calendar_popup", false ).toBool();
158158
mDateTimeEdit->setCalendarPopup( calendar );
159-
if ( calendar )
159+
if ( calendar && mDateTimeEdit->calendarWidget() )
160160
{
161161
// highlight today's date
162162
QTextCharFormat todayFormat;

0 commit comments

Comments
 (0)