26 #define YUILogComponent "qt-ui"
27 #include <yui/YUILog.h>
29 #include <qdatetimeedit.h>
30 #include <QVBoxLayout>
34 #include "YQDateField.h"
35 #include "YQWidgetCaption.h"
39 : QFrame( (QWidget *) parent->widgetRep() )
40 , YDateField( parent, label )
42 QVBoxLayout* layout =
new QVBoxLayout(
this );
46 layout->setSpacing( YQWidgetSpacing );
47 layout->setMargin ( YQWidgetMargin );
50 YUI_CHECK_NEW( _caption );
51 layout->addWidget( _caption );
53 _qt_dateEdit =
new QDateEdit(
this );
54 YUI_CHECK_NEW( _qt_dateEdit );
55 layout->addWidget( _qt_dateEdit );
58 _qt_dateEdit->setDisplayFormat(
"yyyy-MM-dd" );
59 _qt_dateEdit->setCalendarPopup(
true);
60 _caption->setBuddy( _qt_dateEdit );
72 return toUTF8( _qt_dateEdit->date().toString( Qt::ISODate ) );
78 _qt_dateEdit->setDate( QDate::fromString( fromUTF8( newValue ), Qt::ISODate ) );
85 _caption->
setText( fromUTF8( newLabel ) );
86 YDateField::setLabel( newLabel );
92 QFrame::setEnabled( enabled );
93 YWidget::setEnabled( enabled );
99 return sizeHint().width();
105 return sizeHint().height();
111 resize( newWidth, newHeight );
117 _qt_dateEdit->setFocus();
124 #include "YQDateField.moc"