Thanks! ...it does work and functions like I need it to.<div><br></div><div>Marc</div><div><br><div class="gmail_quote">On Sun, Feb 1, 2009 at 3:24 PM, David Boddie <span dir="ltr"><<a href="mailto:david@boddie.org.uk">david@boddie.org.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">On Sun Feb 1 20:53:45 GMT 2009, David Douard wrote:<br>
> Le Saturday 31 January 2009 19:15:23 Marc Nations, vous avez écrit :<br>
<br>
</div><div class="Ih2E3d">> > I can't seem to clear out the QDateTime field in cases where I don't want<br>
> > the date displayed. Using clear() seems to wipe out the first entry (in<br>
> > this case the hour). I tried hitting multiple clears thinking that it may<br>
> > just work down the list, but that didn't work. Is there a way to blank<br>
> > out the field completely? I know it can be disbled, but I'd like to have<br>
> > it be blank until the user goes and selects the pop-up calendar.<br>
><br>
</div><div class="Ih2E3d">> This is a gap in Qt, and it won't happen before a while. See<br>
> <a href="http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&id" target="_blank">http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&id</a><br>
>=135683<br>
<br>
</div>One way to do this is to access the QLineEdit child widget of the<br>
QDateTimeEdit and clear that instead, like this:<br>
<br>
dateTimeEdit = QDateTimeEdit()<br>
lineEdit = dateTimeEdit.findChild(QLineEdit)<br>
lineEdit.setText("")<br>
<br>
Note that this puts the QDateTimeEdit into a state where validation is not<br>
used, so you need to make sure that it's enabled again before you let the<br>
user enter text. Perhaps disable the QDateTimeEdit as well to prevent that<br>
from happening and set the current section when you enable it again.<br>
<br>
As with all these hacks to get at the widgets behind the scenes, it's not<br>
guaranteed to work, either now or in the future, but it may prove to be a<br>
useful workaround if it happens to work for you.<br>
<br>
David<br>
<br>
_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</blockquote></div><br></div>