Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.2.1
-
None
-
Qt 5.2.1 on a Mac running OSX 10.8
Description
QDateTimeEdit with calendarPopup set to true has rendering issues on the Mac.
Reproduction Steps:
- Create a new Qt Designer app project in Qt Creator on the Mac.
- Add a QDateTimeEdit control to the main window.
- Check the box next to "calendarPopup"
Expected:
QDateTimeEdit renders similar to what it did in Qt 4.8.4
Actual:
The edit field is shifted.
Attached is a screen shot of the sample application in Qt Creator and running.
Some investigation in to the QT code revealed a change in QMacStylePrivate::comboboxEditBounds that accounts for some of the shift.
QMacStyle::subControlRect contains specific code to adjust the the rect for combo boxes when being used with QDateTimeEdit but this code did not change for Qt 5.2.1.
The Workaround
Create a QT Style for your application with the following overlaoded code
QRect subControlRect(QStyle::ComplexControl control, const QStyleOptionComplex * option, QStyle::SubControl subControl, const QWidget * widget) const { switch(control) { case CC_ComboBox: { if(subControl == SC_ComboBoxEditField) { if(qobject_cast<const QDateTimeEdit*>(widget)) { QRect result = TableauMacProxyStyle::subControlRect(control, option, subControl, widget); result.moveTop(result.top() + 3); result.setHeight(result.height() - 3); result.setWidth(result.width() - 2); return result; } } } break; } return BASE_CLASS::subControlRect(control, option, subControl, widget); }
Attachments
Issue Links
- duplicates
-
QTBUG-36692 Missing top border of a QtGui.QDateEdit when setCalendarPopup(True) on Mac (OS X 10.9)
- Closed