-rw-r--r-- | core/pim/addressbook/picker.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/pim/addressbook/picker.cpp b/core/pim/addressbook/picker.cpp index 5099d68..9e0c78a 100644 --- a/core/pim/addressbook/picker.cpp +++ b/core/pim/addressbook/picker.cpp | |||
@@ -1,84 +1,85 @@ | |||
1 | #include "picker.h" | 1 | #include "picker.h" |
2 | 2 | ||
3 | #include <qfont.h> | 3 | #include <qfont.h> |
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qtimer.h> | 5 | #include <qtimer.h> |
6 | #include <qlayout.h> | 6 | #include <qlayout.h> |
7 | 7 | ||
8 | char PickerLabel::lastLetter = '\0'; | 8 | char PickerLabel::lastLetter = '\0'; |
9 | 9 | ||
10 | PickerLabel::PickerLabel( QWidget *parent, const char *name ) | 10 | PickerLabel::PickerLabel( QWidget *parent, const char *name ) |
11 | : QLabel ( parent, name ) | 11 | : QLabel ( parent, name ) |
12 | { | 12 | { |
13 | currentLetter = 0; | 13 | currentLetter = 0; |
14 | //lastLetter = 0; | 14 | //lastLetter = 0; |
15 | 15 | ||
16 | letter1 = '\0'; | 16 | letter1 = '\0'; |
17 | letter2 = '\0'; | 17 | letter2 = '\0'; |
18 | letter3 = '\0'; | 18 | letter3 = '\0'; |
19 | 19 | ||
20 | setFont( QFont( "smallsmooth", 9 ) ); | 20 | // setFont( QFont( "smallsmooth", 9 ) ); |
21 | setFont( QFont::defaultFont() ); | ||
21 | setTextFormat( Qt::RichText ); | 22 | setTextFormat( Qt::RichText ); |
22 | 23 | ||
23 | } | 24 | } |
24 | 25 | ||
25 | PickerLabel::~PickerLabel() | 26 | PickerLabel::~PickerLabel() |
26 | { | 27 | { |
27 | 28 | ||
28 | } | 29 | } |
29 | 30 | ||
30 | void PickerLabel::setLetters( char ch1, char ch2, char ch3 ) | 31 | void PickerLabel::setLetters( char ch1, char ch2, char ch3 ) |
31 | { | 32 | { |
32 | QString tmpStr; | 33 | QString tmpStr; |
33 | 34 | ||
34 | if (ch1 != '\0') | 35 | if (ch1 != '\0') |
35 | letter1 = ch1; | 36 | letter1 = ch1; |
36 | else | 37 | else |
37 | letter1 = ' '; | 38 | letter1 = ' '; |
38 | 39 | ||
39 | if (ch2 != '\0') | 40 | if (ch2 != '\0') |
40 | letter2 = ch2; | 41 | letter2 = ch2; |
41 | else | 42 | else |
42 | letter2 = ' '; | 43 | letter2 = ' '; |
43 | 44 | ||
44 | if (ch3 != '\0') | 45 | if (ch3 != '\0') |
45 | letter3 = ch3; | 46 | letter3 = ch3; |
46 | else | 47 | else |
47 | letter3 = ' '; | 48 | letter3 = ' '; |
48 | 49 | ||
49 | tmpStr = "<qt>"; | 50 | tmpStr = "<qt>"; |
50 | tmpStr += letter1; | 51 | tmpStr += letter1; |
51 | tmpStr += letter2; | 52 | tmpStr += letter2; |
52 | tmpStr += letter3; | 53 | tmpStr += letter3; |
53 | tmpStr += "</qt>"; | 54 | tmpStr += "</qt>"; |
54 | 55 | ||
55 | setText(tmpStr); | 56 | setText(tmpStr); |
56 | 57 | ||
57 | currentLetter = 0; | 58 | currentLetter = 0; |
58 | 59 | ||
59 | } | 60 | } |
60 | 61 | ||
61 | void PickerLabel::clearLetter() | 62 | void PickerLabel::clearLetter() |
62 | { | 63 | { |
63 | 64 | ||
64 | QString tmpStr; | 65 | QString tmpStr; |
65 | 66 | ||
66 | tmpStr = "<qt>"; | 67 | tmpStr = "<qt>"; |
67 | tmpStr += letter1; | 68 | tmpStr += letter1; |
68 | tmpStr += letter2; | 69 | tmpStr += letter2; |
69 | tmpStr += letter3; | 70 | tmpStr += letter3; |
70 | tmpStr += "</qt>"; | 71 | tmpStr += "</qt>"; |
71 | 72 | ||
72 | setText(tmpStr); | 73 | setText(tmpStr); |
73 | 74 | ||
74 | currentLetter = 0; | 75 | currentLetter = 0; |
75 | 76 | ||
76 | } | 77 | } |
77 | 78 | ||
78 | void PickerLabel::mousePressEvent( QMouseEvent* e ) | 79 | void PickerLabel::mousePressEvent( QMouseEvent* e ) |
79 | { | 80 | { |
80 | // If one pickerlabel is was, and an other is now selected, we | 81 | // If one pickerlabel is was, and an other is now selected, we |
81 | // have to simulate the releaseevent.. Otherwise the new label | 82 | // have to simulate the releaseevent.. Otherwise the new label |
82 | // will not get a highlighted letter.. | 83 | // will not get a highlighted letter.. |
83 | // Maybe there is a more intelligent solution, but this works and I am tired.. (se) | 84 | // Maybe there is a more intelligent solution, but this works and I am tired.. (se) |
84 | if ( ( currentLetter == 0 ) && ( lastLetter != '\0' ) ) mouseReleaseEvent( e ); | 85 | if ( ( currentLetter == 0 ) && ( lastLetter != '\0' ) ) mouseReleaseEvent( e ); |