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">&lt;<a href="mailto:david@boddie.org.uk">david@boddie.org.uk</a>&gt;</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>
&gt; Le Saturday 31 January 2009 19:15:23 Marc Nations, vous avez écrit :<br>
<br>
</div><div class="Ih2E3d">&gt; &gt; I can&#39;t seem to clear out the QDateTime field in cases where I don&#39;t want<br>
&gt; &gt; the date displayed. Using clear() seems to wipe out the first entry (in<br>
&gt; &gt; this case the hour). I tried hitting multiple clears thinking that it may<br>
&gt; &gt; just work down the list, but that didn&#39;t work. Is there a way to blank<br>
&gt; &gt; out the field completely? I know it can be disbled, but I&#39;d like to have<br>
&gt; &gt; it be blank until the user goes and selects the pop-up calendar.<br>
&gt;<br>
</div><div class="Ih2E3d">&gt; This is a gap in Qt, and it won&#39;t happen before a while. See<br>
&gt; <a href="http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&amp;id" target="_blank">http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&amp;id</a><br>
&gt;=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>
 &nbsp;dateTimeEdit = QDateTimeEdit()<br>
 &nbsp;lineEdit = dateTimeEdit.findChild(QLineEdit)<br>
 &nbsp;lineEdit.setText(&quot;&quot;)<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&#39;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&#39;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 &nbsp; &nbsp;<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>