-rw-r--r-- | libkdepim/kdateedit.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libkdepim/kdateedit.cpp b/libkdepim/kdateedit.cpp index 2c78ea3..946fc0d 100644 --- a/libkdepim/kdateedit.cpp +++ b/libkdepim/kdateedit.cpp @@ -77,17 +77,17 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) mDatePicker = new KDatePicker(mDateFrame,QDate::currentDate()); connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate))); connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate))); connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate))); connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate))); connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide())); connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); - + mDateButton->setFocusPolicy( QWidget::NoFocus ); //mDateFrame->resize( 400, 300 ); } connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed())); connect(mDateEdit,SIGNAL(textChanged(const QString &)), SLOT(textChanged(const QString &))); // Create the keyword list. This will be used to match against when the user @@ -112,17 +112,17 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) if (i >= currentDay) mKeywordMap[dayName] = i - currentDay; else mKeywordMap[dayName] = 7 - currentDay + i; } mTextChanged = false; mHandleInvalid = false; - QWidget::setTabOrder( mDateEdit, mDateButton ); + // QWidget::setTabOrder( mDateEdit, mDateButton ); } KDateEdit::~KDateEdit() { delete mDateFrame; } void KDateEdit::clear() { @@ -457,20 +457,22 @@ QDate KDateEdit::readDate() const return date; } bool KDateEdit::eventFilter(QObject *, QEvent *e) { // We only process the focus out event if the text has changed // since we got focus - if ((e->type() == QEvent::FocusOut) && mTextChanged) + if ((e->type() == QEvent::FocusOut) ) { - lineEnterPressed(); - mTextChanged = false; + if ( mTextChanged ) { + lineEnterPressed(); + mTextChanged = false; + } } // switch dateFormShort by double klick with mouse else if (e->type() == QEvent::MouseButtonDblClick) { toggleDateFormat(); } else if (e->type() == QEvent::FocusIn) { |