-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 | |||
@@ -79,13 +79,13 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) | |||
79 | connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate))); | 79 | connect(mDatePicker,SIGNAL(dateEntered(QDate)),SLOT(setDate(QDate))); |
80 | connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate))); | 80 | connect(mDatePicker,SIGNAL(dateEntered(QDate)),SIGNAL(dateChanged(QDate))); |
81 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate))); | 81 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(setDate(QDate))); |
82 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate))); | 82 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SIGNAL(dateChanged(QDate))); |
83 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide())); | 83 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),mDateFrame,SLOT(hide())); |
84 | connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); | 84 | connect(mDateButton,SIGNAL(clicked()),SLOT(toggleDatePicker())); |
85 | 85 | mDateButton->setFocusPolicy( QWidget::NoFocus ); | |
86 | //mDateFrame->resize( 400, 300 ); | 86 | //mDateFrame->resize( 400, 300 ); |
87 | 87 | ||
88 | } | 88 | } |
89 | connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed())); | 89 | connect(mDateEdit,SIGNAL(returnPressed()),SLOT(lineEnterPressed())); |
90 | connect(mDateEdit,SIGNAL(textChanged(const QString &)), | 90 | connect(mDateEdit,SIGNAL(textChanged(const QString &)), |
91 | SLOT(textChanged(const QString &))); | 91 | SLOT(textChanged(const QString &))); |
@@ -114,13 +114,13 @@ KDateEdit::KDateEdit(QWidget *parent, const char *name, bool withoutDP ) | |||
114 | else | 114 | else |
115 | mKeywordMap[dayName] = 7 - currentDay + i; | 115 | mKeywordMap[dayName] = 7 - currentDay + i; |
116 | } | 116 | } |
117 | 117 | ||
118 | mTextChanged = false; | 118 | mTextChanged = false; |
119 | mHandleInvalid = false; | 119 | mHandleInvalid = false; |
120 | QWidget::setTabOrder( mDateEdit, mDateButton ); | 120 | // QWidget::setTabOrder( mDateEdit, mDateButton ); |
121 | } | 121 | } |
122 | 122 | ||
123 | KDateEdit::~KDateEdit() | 123 | KDateEdit::~KDateEdit() |
124 | { | 124 | { |
125 | delete mDateFrame; | 125 | delete mDateFrame; |
126 | } | 126 | } |
@@ -459,16 +459,18 @@ QDate KDateEdit::readDate() const | |||
459 | } | 459 | } |
460 | 460 | ||
461 | bool KDateEdit::eventFilter(QObject *, QEvent *e) | 461 | bool KDateEdit::eventFilter(QObject *, QEvent *e) |
462 | { | 462 | { |
463 | // We only process the focus out event if the text has changed | 463 | // We only process the focus out event if the text has changed |
464 | // since we got focus | 464 | // since we got focus |
465 | if ((e->type() == QEvent::FocusOut) && mTextChanged) | 465 | if ((e->type() == QEvent::FocusOut) ) |
466 | { | 466 | { |
467 | lineEnterPressed(); | 467 | if ( mTextChanged ) { |
468 | mTextChanged = false; | 468 | lineEnterPressed(); |
469 | mTextChanged = false; | ||
470 | } | ||
469 | } | 471 | } |
470 | // switch dateFormShort by double klick with mouse | 472 | // switch dateFormShort by double klick with mouse |
471 | else if (e->type() == QEvent::MouseButtonDblClick) | 473 | else if (e->type() == QEvent::MouseButtonDblClick) |
472 | { | 474 | { |
473 | toggleDateFormat(); | 475 | toggleDateFormat(); |
474 | } | 476 | } |