PDA

View Full Version : Null for QDateEdit



wirasto
16th November 2009, 18:36
if I use QDateEdit, automaticaly I have a date value. Well, how to set "null" value for QDateEdit like setCurrentIndex(-1) in QComboBox ?
I tried reimplement QDateEdit widget and set like this. But failed :(



myDE::myDE(QWidget *parent)
:QDateEdit(parent)
{
setCalendarPopup(true);
calendarWidget()->setGridVisible(true);
setDate(QDate::currentDate());
setMaximumDate(QDate::currentDate());

QLineEdit *le=new QLineEdit();
setLineEdit(le);
le->clear();
}

wysota
16th November 2009, 21:54
I'd use QAbstractSpinBox::setSpecialValueText().