summaryrefslogtreecommitdiffabout
path: root/libkdepim/kdateedit.cpp
Side-by-side diff
Diffstat (limited to 'libkdepim/kdateedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kdateedit.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp
index 5fb948a..c4c0081 100644
--- a/libkdepim/kdateedit.cpp
+++ b/libkdepim/kdateedit.cpp
@@ -126,3 +126,9 @@ KDateEdit::~KDateEdit()
}
-
+void KDateEdit::clear()
+{
+ bool b = mDateEdit->signalsBlocked();
+ mDateEdit->blockSignals(true);
+ mDateEdit->setText("");
+ mDateEdit->blockSignals(b);
+}
void KDateEdit::setDate(QDate newDate)
@@ -465,4 +471,3 @@ bool KDateEdit::eventFilter(QObject *, QEvent *e)
{
- dateFormShort = dateFormShort?false:true;
- mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort));
+ toggleDateFormat();
}
@@ -475,2 +480,8 @@ bool KDateEdit::eventFilter(QObject *, QEvent *e)
}
+void KDateEdit::toggleDateFormat()
+{
+ dateFormShort = ! dateFormShort;
+ mDateEdit->setText(KGlobal::locale()->formatDate(readDate(),dateFormShort));
+
+}