author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /microkde/ktextedit.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
-rw-r--r-- | microkde/ktextedit.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/microkde/ktextedit.cpp b/microkde/ktextedit.cpp index 4dd6875..d74706b 100644 --- a/microkde/ktextedit.cpp +++ b/microkde/ktextedit.cpp | |||
@@ -1,12 +1,14 @@ | |||
1 | 1 | ||
2 | #include <ktextedit.h> | 2 | #include <ktextedit.h> |
3 | #ifndef DESKTOP_VERSION | 3 | #ifndef DESKTOP_VERSION |
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | //Added by qt3to4: | ||
6 | #include <QMouseEvent> | ||
5 | #endif | 7 | #endif |
6 | 8 | ||
7 | 9 | ||
8 | KTextEdit::KTextEdit ( QWidget *parent ) : QMultiLineEdit( parent ) | 10 | KTextEdit::KTextEdit ( QWidget *parent ) : Q3MultiLineEdit( parent ) |
9 | { | 11 | { |
10 | mAllowPopupMenu = false; | 12 | mAllowPopupMenu = false; |
11 | mMouseDown = false; | 13 | mMouseDown = false; |
12 | mIgnoreMark = false; | 14 | mIgnoreMark = false; |
@@ -16,29 +18,29 @@ KTextEdit::KTextEdit ( QWidget *parent ) : QMultiLineEdit( parent ) | |||
16 | } | 18 | } |
17 | 19 | ||
18 | void KTextEdit::mousePressEvent(QMouseEvent *e) | 20 | void KTextEdit::mousePressEvent(QMouseEvent *e) |
19 | { | 21 | { |
20 | if ( e->button() == LeftButton ) { | 22 | if ( e->button() == Qt::LeftButton ) { |
21 | mAllowPopupMenu = true; | 23 | mAllowPopupMenu = true; |
22 | mYMousePos = mapToGlobal( (e->pos())).y(); | 24 | mYMousePos = mapToGlobal( (e->pos())).y(); |
23 | mXMousePos = mapToGlobal( (e->pos())).x(); | 25 | mXMousePos = mapToGlobal( (e->pos())).x(); |
24 | } | 26 | } |
25 | if ( e->button() == RightButton && !mAllowPopupMenu ) | 27 | if ( e->button() == Qt::RightButton && !mAllowPopupMenu ) |
26 | return; | 28 | return; |
27 | if ( e->button() == LeftButton ) { | 29 | if ( e->button() == Qt::LeftButton ) { |
28 | if ( hasMarkedText () ) | 30 | if ( hasMarkedText () ) |
29 | mIgnoreMark = !mIgnoreMark; | 31 | mIgnoreMark = !mIgnoreMark; |
30 | if ( mIgnoreMark && hasMarkedText () ) { | 32 | if ( mIgnoreMark && hasMarkedText () ) { |
31 | mMouseDown = false; | 33 | mMouseDown = false; |
32 | return ; | 34 | return ; |
33 | } | 35 | } |
34 | } | 36 | } |
35 | QMultiLineEdit::mousePressEvent( e ); | 37 | Q3MultiLineEdit::mousePressEvent( e ); |
36 | } | 38 | } |
37 | 39 | ||
38 | void KTextEdit::mouseReleaseEvent(QMouseEvent *e) | 40 | void KTextEdit::mouseReleaseEvent(QMouseEvent *e) |
39 | { | 41 | { |
40 | QMultiLineEdit::mouseReleaseEvent(e); | 42 | Q3MultiLineEdit::mouseReleaseEvent(e); |
41 | } | 43 | } |
42 | 44 | ||
43 | void KTextEdit::mouseMoveEvent(QMouseEvent *e) | 45 | void KTextEdit::mouseMoveEvent(QMouseEvent *e) |
44 | { | 46 | { |
@@ -47,7 +49,7 @@ void KTextEdit::mouseMoveEvent(QMouseEvent *e) | |||
47 | int diff2 = mXMousePos - mapToGlobal( (e->pos())).x(); | 49 | int diff2 = mXMousePos - mapToGlobal( (e->pos())).x(); |
48 | if ( diff2 < 0 ) diff2 = -diff2; | 50 | if ( diff2 < 0 ) diff2 = -diff2; |
49 | if ( diff+ diff2 > 20 ) | 51 | if ( diff+ diff2 > 20 ) |
50 | mAllowPopupMenu = false; | 52 | mAllowPopupMenu = false; |
51 | QMultiLineEdit::mouseMoveEvent(e); | 53 | Q3MultiLineEdit::mouseMoveEvent(e); |
52 | } | 54 | } |
53 | 55 | ||