author | eilers <eilers> | 2003-08-01 14:22:29 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-08-01 14:22:29 (UTC) |
commit | 7d51872c86155fbbf27aeb8e49e7a336d909caac (patch) (unidiff) | |
tree | 55ecf3452d6711065e36c6bceab8ec52bd5525d8 /core/pim/todo/textviewshow.cpp | |
parent | 34991bac7d96b1c17601be6a5607819342571e0c (diff) | |
download | opie-7d51872c86155fbbf27aeb8e49e7a336d909caac.zip opie-7d51872c86155fbbf27aeb8e49e7a336d909caac.tar.gz opie-7d51872c86155fbbf27aeb8e49e7a336d909caac.tar.bz2 |
Merging changes from BRANCH_1_0 to HEAD
Diffstat (limited to 'core/pim/todo/textviewshow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/textviewshow.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/core/pim/todo/textviewshow.cpp b/core/pim/todo/textviewshow.cpp index fe8a9c8..35ea74b 100644 --- a/core/pim/todo/textviewshow.cpp +++ b/core/pim/todo/textviewshow.cpp | |||
@@ -1,32 +1,48 @@ | |||
1 | #include "mainwindow.h" | ||
2 | #include "textviewshow.h" | 1 | #include "textviewshow.h" |
3 | 2 | ||
4 | using namespace Todo; | 3 | using namespace Todo; |
5 | 4 | ||
6 | TextViewShow::TextViewShow( QWidget* parent, MainWindow* win) | 5 | TextViewShow::TextViewShow( QWidget* parent, MainWindow* win) |
7 | : QTextView( parent ), TodoShow(win) { | 6 | : QTextView( parent ), TodoShow(win) { |
8 | 7 | ||
9 | } | 8 | } |
10 | TextViewShow::~TextViewShow() { | 9 | TextViewShow::~TextViewShow() { |
11 | } | 10 | } |
12 | QString TextViewShow::type()const { | 11 | QString TextViewShow::type()const { |
13 | return QString::fromLatin1("TextViewShow"); | 12 | return QString::fromLatin1("TextViewShow"); |
14 | } | 13 | } |
15 | void TextViewShow::slotShow( const OTodo& ev ) { | 14 | void TextViewShow::slotShow( const OTodo& ev ) { |
16 | setText( ev.toRichText() ); | 15 | setText( ev.toRichText() ); |
17 | } | 16 | } |
18 | QWidget* TextViewShow::widget() { | 17 | QWidget* TextViewShow::widget() { |
19 | return this; | 18 | return this; |
20 | } | 19 | } |
21 | void TextViewShow::keyPressEvent( QKeyEvent* event ) { | 20 | void TextViewShow::keyPressEvent( QKeyEvent* event ) { |
22 | switch( event->key() ) { | 21 | switch( event->key() ) { |
22 | case Qt::Key_Up: | ||
23 | if ( ( visibleHeight() < contentsHeight() ) && | ||
24 | ( verticalScrollBar()->value() > verticalScrollBar()->minValue() ) ) | ||
25 | scrollBy( 0, -(visibleHeight()-20) ); | ||
26 | else | ||
27 | showPrev(); | ||
28 | break; | ||
29 | case Qt::Key_Down: | ||
30 | if ( ( visibleHeight() < contentsHeight() ) && | ||
31 | ( verticalScrollBar()->value() < verticalScrollBar()->maxValue() ) ) | ||
32 | scrollBy( 0, visibleHeight()-20 ); | ||
33 | else | ||
34 | showNext(); | ||
35 | break; | ||
36 | case Qt::Key_Left: | ||
37 | case Qt::Key_Right: | ||
23 | case Qt::Key_F33: | 38 | case Qt::Key_F33: |
24 | case Qt::Key_Enter: | 39 | case Qt::Key_Enter: |
25 | case Qt::Key_Return: | 40 | case Qt::Key_Return: |
41 | case Qt::Key_Space: | ||
26 | escapeView(); | 42 | escapeView(); |
27 | break; | 43 | break; |
28 | default: | 44 | default: |
29 | QTextView::keyPressEvent( event ); | 45 | QTextView::keyPressEvent( event ); |
30 | break; | 46 | break; |
31 | } | 47 | } |
32 | } | 48 | } |