From 2a6c50aa26da831253bef6c623073a80e672d457 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Wed, 26 Feb 2014 15:07:10 +0100 Subject: [PATCH] Fix QDateEdit popup appearance on mac The WS/OS was obviously incorrect and the hack seems not to be needed any more. [ChangeLog][QtWidgets][Mac] Fixed incorrect appearance of QDateEdit with calendarPopup enabled. Task-number: QTBUG-36692 Change-Id: Ic62c9993dc13e783c00fcb56f75d92967eb5074d Reviewed-by: Gabriel de Dietrich --- src/widgets/styles/qmacstyle_mac.mm | 6 ------ src/widgets/widgets/qdatetimeedit.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index a8926e0ad0..53568f3c53 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -5827,12 +5827,6 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op switch (sc) { case SC_ComboBoxEditField:{ ret = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi); - // hack to posistion the edit feld correctly for QDateTimeEdits - // in calendarPopup mode. - if (qobject_cast(widget)) { - ret.moveTop(ret.top() - 2); - ret.setHeight(ret.height() +1); - } break; } case SC_ComboBoxArrow:{ ret = QMacStylePrivate::comboboxEditBounds(combo->rect, bdi); diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 7a723c5f1f..770c954c2a 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -993,7 +993,7 @@ QSize QDateTimeEdit::sizeHint() const QSize hint(w, h); -#ifdef Q_WS_MAC +#ifdef Q_OS_MAC if (d->calendarPopupEnabled()) { QStyleOptionComboBox opt; d->cachedSizeHint = style()->sizeFromContents(QStyle::CT_ComboBox, &opt, hint, this);