-rw-r--r-- | libkdepim/kdateedit.cpp | 9 | ||||
-rw-r--r-- | libkdepim/kdateedit.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index 3d9e690..bf38479 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp @@ -70,2 +70,5 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) mDateButton->setPixmap(pixmap); + QPixmap pixmap2 = SmallIcon("today_small"); + QPushButton* nowButton = new QPushButton(this); + nowButton->setPixmap(pixmap2); @@ -84,2 +87,3 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); + connect(nowButton,SIGNAL(clicked()),SLOT(goToNow())); mDateButton->setFocusPolicy( QWidget::NoFocus ); @@ -134,2 +138,7 @@ void KDateEdit::clear() } +void KDateEdit::goToNow() +{ + setDate(QDate::currentDate() ); + emit setTimeTo( QTime::currentTime() ); +} void KDateEdit::setDate(QDate newDate) diff --git a/libkdepim/kdateedit.h b/libkdepim/kdateedit.h index cf3b90a..2d8c452 100644 --- a/libkdepim/kdateedit.h +++ b/libkdepim/kdateedit.h @@ -89,2 +89,3 @@ class KDateEdit : public QHBox void returnPressed(); + void setTimeTo( QTime ); public slots: @@ -110,2 +111,3 @@ class KDateEdit : public QHBox void textChanged(const QString &); + void goToNow(); |