Missing top border of a PySide.QtGui.QDateEdit when setCalendarPopup(True) on a Mac (OS X 10.9)

StackOverflow https://stackoverflow.com/questions/21565346

Вопрос

Anyone know what is causing the top border of a QtGui.QDateEdit to be missing when setCalendarPopup(True) on a Mac (OS X 10.9)?

Example:

missingTopBorder

date_input = QtGui.QDateEdit()
date_input.setDate(QtCore.QDate.currentDate())
date_input.setCalendarPopup(True)
date_input.setDisplayFormat("MM/dd/yyyy")
Это было полезно?

Решение

It's a Qt bug. It reproduces in C++ under both Qt 5.2.0 and Qt 4.8.5. Please file a bug report.

#include <QApplication>
#include <QDateEdit>
#include <QDate>
#include <QHBoxLayout>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    QWidget w;
    QHBoxLayout * layout = new QHBoxLayout(&w);
    QDateEdit edit;
    edit.setDate(QDate::currentDate());
    edit.setCalendarPopup(true);
    edit.setDisplayFormat("MM/dd/yyyy");
    layout->addWidget(&edit);
    w.show();
    return a.exec();
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top