Fix FSF address (mainly "Steet" typo)
[kdeaccessibility.git] / kmouth / phraselistitem.cpp
blob57eb0dcb5dfb0ca67a1ddc76bb1ccb02de3e1799
1 /***************************************************************************
2 phraselistitem.cpp - description
3 -------------------
4 begin : Fre Sep 6 2002
5 copyright : (C) 2002 by Gunnar Schmi Dt
6 email : kmouth@schmi-dt.de
7 ***************************************************************************/
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
18 #include "phraselistitem.h"
19 #include <qstyle.h>
20 #include <QStyleOptionFocusRect>
21 #include <qpainter.h>
23 PhraseListItem::PhraseListItem (const QString & text)
24 : Q3ListBoxText(text) {
27 PhraseListItem::~PhraseListItem() {
30 bool PhraseListItem::drawCursor() const {
31 if ((Q3ListBoxItem *)this != listBox()->item (listBox()->currentItem()))
32 return false;
34 for (Q3ListBoxItem *item = listBox()->firstItem(); item != 0; item = item->next() ) {
35 if (item->isSelected())
36 return true;
38 return false;
41 int PhraseListItem::rtti() const {
42 return RTTI;
45 void PhraseListItem::paint (QPainter *p) {
46 Q3ListBoxText::paint (p);
48 if (drawCursor()) {
49 QRect r (0, 0, listBox()->maxItemWidth(), height (listBox()));
50 QStyleOptionFocusRect option;
51 option.rect = r;
52 listBox()->style()->drawPrimitive ( QStyle::PE_FrameFocusRect, &option, p);