Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.2
-
None
Description
A QDateTimeEdit with calendarPopup set to true have a strange behavior with the style oxygen.
To reproduce the problem, start the following code and click in the right margin.
#include <QtGui>
int main(int argc, char **argv){
QApplication app(argc, argv);
QDateEdit dateEdit;
dateEdit.setCalendarPopup(true);
dateEdit.show();
return app.exec();
}
With the style Oxygen, the button of the QDateTimeEdit does not cover all the surface where the spin box controls usually are. The "if" fails in following code and the spin box are invoqued.
d->updateHoverControl(event->pos());
if (d->hoverControl == QStyle::SC_ComboBoxArrow)
else
{ QAbstractSpinBox::mousePressEvent(event); }Here is a patch to avoid all behavior of the QAbstractSpinBox in calendarPopup mode:
diff --git a/src/gui/widgets/qdatetimeedit.cpp b/src/gui/widgets/qdatetimeedit.cpp
index ef01d7c..b9c2bca 100644
— a/src/gui/widgets/qdatetimeedit.cpp
+++ b/src/gui/widgets/qdatetimeedit.cpp
@@ -1499,8 +1499,6 @@ void QDateTimeEdit::mousePressEvent(QMouseEvent *event)
d->positionCalendarPopup();
//Show the calendar
d->monthCalendar->show();
- } else
{
- QAbstractSpinBox::mousePressEvent(event);
}
}