-rw-r--r-- | korganizer/journalentry.h | 1 | ||||
-rw-r--r-- | korganizer/kojournalview.cpp | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/korganizer/journalentry.h b/korganizer/journalentry.h index a69846c..ee17da8 100644 --- a/korganizer/journalentry.h +++ b/korganizer/journalentry.h @@ -58,2 +58,3 @@ class JournalEntry : public QFrame { void resizeEvent(QResizeEvent* e ) ; + KTextEdit * editor() {return mEditor;}; protected slots: diff --git a/korganizer/kojournalview.cpp b/korganizer/kojournalview.cpp index a23a3b2..406df5a 100644 --- a/korganizer/kojournalview.cpp +++ b/korganizer/kojournalview.cpp @@ -39,2 +39,3 @@ #include <kglobal.h> +#include <ktextedit.h> @@ -179,2 +180,3 @@ void KOJournalView::showList(QPtrList<Journal> jl) int iii = 0; + QWidget* fw = qApp->focusWidget (); while ( iii < count ) { @@ -189,2 +191,6 @@ void KOJournalView::showList(QPtrList<Journal> jl) } else { + int xxx = -1, yyy = -1; + if ( ((QWidget*) mEntry->editor() ) == fw ) { + mEntry->editor()->getCursorPosition( &xxx,&yyy); + } mEntry->setVisibleMode( true ); @@ -194,2 +200,5 @@ void KOJournalView::showList(QPtrList<Journal> jl) mEntry->show(); + if ( xxx > -1 && yyy > -1 ) { + mEntry->editor()->setCursorPosition( xxx, yyy ); + } mEntry = jEntries.next(); |