summaryrefslogtreecommitdiffabout
path: root/korganizer/journalentry.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/journalentry.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/journalentry.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp
index 7f6f221..5269af7 100644
--- a/korganizer/journalentry.cpp
+++ b/korganizer/journalentry.cpp
@@ -135,2 +135,6 @@ JournalEntry::JournalEntry(Calendar *calendar,QWidget *parent) :
mEditor->installEventFilter(this);
+ installEventFilter(this);
+ mTitle->installEventFilter(this);
+ setFocusPolicy (QWidget::NoFocus);
+
connect( saveTemplate, SIGNAL( clicked() ), this , SLOT( slotSaveTemplate() ) );
@@ -313,3 +317,9 @@ bool JournalEntry::eventFilter( QObject *o, QEvent *e )
// kdDebug() << "JournalEntry::event received " << e->type() << endl;
-
+ if ( isVisible() ) {
+ mEditor->setFocusPolicy (QWidget::StrongFocus);
+ mTitle->setFocusPolicy (QWidget::StrongFocus);
+ } else {
+ mEditor->setFocusPolicy (QWidget::NoFocus);
+ mTitle->setFocusPolicy (QWidget::NoFocus);
+ }
if ( e->type() == QEvent::FocusOut ) {
@@ -319,2 +329,4 @@ bool JournalEntry::eventFilter( QObject *o, QEvent *e )
QKeyEvent * k = (QKeyEvent *) e;
+ if ( !isVisible() )
+ return true;
if ( k->state() == Qt::ControlButton ) {