-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,116 +1,117 @@ #include "picker.h" #include <qfont.h> #include <qstring.h> #include <qtimer.h> #include <qlayout.h> char PickerLabel::lastLetter = '\0'; PickerLabel::PickerLabel( QWidget *parent, const char *name ) : QLabel ( parent, name ) { currentLetter = 0; //lastLetter = 0; letter1 = '\0'; letter2 = '\0'; letter3 = '\0'; - setFont( QFont( "smallsmooth", 9 ) ); + // setFont( QFont( "smallsmooth", 9 ) ); + setFont( QFont::defaultFont() ); setTextFormat( Qt::RichText ); } PickerLabel::~PickerLabel() { } void PickerLabel::setLetters( char ch1, char ch2, char ch3 ) { QString tmpStr; if (ch1 != '\0') letter1 = ch1; else letter1 = ' '; if (ch2 != '\0') letter2 = ch2; else letter2 = ' '; if (ch3 != '\0') letter3 = ch3; else letter3 = ' '; tmpStr = "<qt>"; tmpStr += letter1; tmpStr += letter2; tmpStr += letter3; tmpStr += "</qt>"; setText(tmpStr); currentLetter = 0; } void PickerLabel::clearLetter() { QString tmpStr; tmpStr = "<qt>"; tmpStr += letter1; tmpStr += letter2; tmpStr += letter3; tmpStr += "</qt>"; setText(tmpStr); currentLetter = 0; } void PickerLabel::mousePressEvent( QMouseEvent* e ) { // If one pickerlabel is was, and an other is now selected, we // have to simulate the releaseevent.. Otherwise the new label // will not get a highlighted letter.. // Maybe there is a more intelligent solution, but this works and I am tired.. (se) if ( ( currentLetter == 0 ) && ( lastLetter != '\0' ) ) mouseReleaseEvent( e ); } void PickerLabel::mouseReleaseEvent( QMouseEvent* /* e */ ) { QString tmpStr; if (lastLetter != letter1 && lastLetter != letter2 && lastLetter != letter3 && lastLetter != '\0') QTimer::singleShot( 0, this, SLOT(emitClearSignal()) ); switch (currentLetter) { case 0: tmpStr = "<qt><u><b><font color=\"#FF00FF\">"; tmpStr += letter1; tmpStr += "</font></b></u>"; tmpStr += letter2; tmpStr += letter3; tmpStr += "</qt>"; setText(tmpStr); currentLetter++; lastLetter = letter1; emit selectedLetter( letter1 ); break; case 1: tmpStr = "<qt>"; tmpStr += letter1; tmpStr += "<u><b><font color=\"#FF00FF\">"; tmpStr += letter2; tmpStr += "</font></b></u>"; tmpStr += letter3; |