QDateEdit->setSpecialValueText() not working
Unsolved
General and Desktop
-
I'm trying to visualize an empty value in QDateEdit. But instead of "null" string, QDateEdit shows me default value 01.01.2000. Here's my code:
#include <QApplication> #include <QDateEdit> int main(int argc, char *argv[]) { QApplication a(argc, argv); QDateEdit date_edit; date_edit.setSpecialValueText("null"); date_edit.show(); return a.exec(); }
I'm using Qt 5.5.1 x32 on windows 8.1 with a msvc2012 compiler.
What's wrong with my code? -
Hi and welcome
Nothing wrong with your code.
I dont think it allows an empty date.
The TimeDate class dont allow so I think the widget also enforces that.http://www.qtcentre.org/threads/17295-How-to-put-empty-value-in-QDateEdit
-
@dream_captain
look at this https://bugreports.qt.io/browse/QTBUG-277 -
Thanks. Seems like i need another workaround.