diff options
Diffstat (limited to 'src/entrygroupitem.cpp')
-rw-r--r-- | src/entrygroupitem.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/entrygroupitem.cpp b/src/entrygroupitem.cpp index f2de60d..14b1573 100644 --- a/src/entrygroupitem.cpp +++ b/src/entrygroupitem.cpp @@ -22,30 +22,30 @@ #include <kiconloader.h> #include <klocale.h> -#include <qpixmap.h> -#include <qpainter.h> +#include <tqpixmap.h> +#include <tqpainter.h> using Tellico::EntryGroupItem; -EntryGroupItem::EntryGroupItem(GUI::ListView* parent_, Data::EntryGroup* group_, int fieldType_) - : GUI::CountedItem(parent_), m_group(group_), m_fieldType(fieldType_) { +EntryGroupItem::EntryGroupItem(GUI::ListView* tqparent_, Data::EntryGroup* group_, int fieldType_) + : GUI::CountedItem(tqparent_), m_group(group_), m_fieldType(fieldType_) { setText(0, group_->groupName()); m_emptyGroup = group_->groupName() == i18n(Data::Collection::s_emptyGroupTitle); } -QPixmap EntryGroupItem::ratingPixmap() { +TQPixmap EntryGroupItem::ratingPixmap() { if(!m_group) { - return QPixmap(); + return TQPixmap(); } - QPixmap stars = GUI::RatingWidget::pixmap(m_group->groupName()); + TQPixmap stars = GUI::RatingWidget::pixmap(m_group->groupName()); if(m_pix.isNull() && stars.isNull()) { m_emptyGroup = true; - return QPixmap(); + return TQPixmap(); } - QPixmap newPix(m_pix.width() + 4 + stars.width(), QMAX(m_pix.height(), stars.height())); - newPix.fill(isSelected() ? listView()->colorGroup().highlight() : backgroundColor(0)); - QPainter p(&newPix); + TQPixmap newPix(m_pix.width() + 4 + stars.width(), TQMAX(m_pix.height(), stars.height())); + newPix.fill(isSelected() ? listView()->tqcolorGroup().highlight() : backgroundColor(0)); + TQPainter p(&newPix); if(!m_pix.isNull()) { p.drawPixmap(0, 0, m_pix); } @@ -56,25 +56,25 @@ QPixmap EntryGroupItem::ratingPixmap() { return newPix; } -void EntryGroupItem::setPixmap(int col, const QPixmap& pix) { +void EntryGroupItem::setPixmap(int col, const TQPixmap& pix) { m_pix = pix; GUI::CountedItem::setPixmap(col, m_pix); } -void EntryGroupItem::paintCell(QPainter* p_, const QColorGroup& cg_, +void EntryGroupItem::paintCell(TQPainter* p_, const TQColorGroup& cg_, int column_, int width_, int align_) { if(column_> 0 || m_fieldType != Data::Field::Rating || m_emptyGroup) { return GUI::CountedItem::paintCell(p_, cg_, column_, width_, align_); } - QString oldText = text(column_); + TQString oldText = text(column_); // "\t\t" is the flag to not paint the item // CountedItem already uses "\t" if(oldText == Latin1Literal("\t\t")) { return; } - setText(column_, QString::fromLatin1("\t\t")); + setText(column_, TQString::tqfromLatin1("\t\t")); GUI::CountedItem::setPixmap(column_, ratingPixmap()); GUI::CountedItem::paintCell(p_, cg_, column_, width_, align_); // GUI::CountedItem::setPixmap(column_, m_pix); @@ -83,7 +83,7 @@ void EntryGroupItem::paintCell(QPainter* p_, const QColorGroup& cg_, // prepend a tab character to always sort the empty group name first // also check for surname prefixes -QString EntryGroupItem::key(int col_, bool) const { +TQString EntryGroupItem::key(int col_, bool) const { if(col_ > 0) { return text(col_); } @@ -92,31 +92,31 @@ QString EntryGroupItem::key(int col_, bool) const { && pixmap(col_) && !pixmap(col_)->isNull()) { // a little weird, sort for width, too, in case of rating widget // but sort reverse by width - return QChar('\t') + QString::number(1000-pixmap(col_)->width()); + return TQChar('\t') + TQString::number(1000-pixmap(col_)->width()); } else if(text(col_) == i18n(Data::Collection::s_emptyGroupTitle)) { - return QChar('\t'); + return TQChar('\t'); } if(m_text.isEmpty() || m_text != text(col_)) { m_text = text(col_); if(Config::autoFormat()) { - const QStringList prefixes = Config::surnamePrefixList(); + const TQStringList prefixes = Config::surnamePrefixList(); // build a regexp to match surname prefixes // complicated by fact that prefix could have an apostrophe - QString tokens; - for(QStringList::ConstIterator it = prefixes.begin(); + TQString tokens; + for(TQStringList::ConstIterator it = prefixes.begin(); it != prefixes.end(); ++it) { tokens += (*it); - if(!(*it).endsWith(QChar('\''))) { - tokens += QString::fromLatin1("\\s"); + if(!(*it).endsWith(TQChar('\''))) { + tokens += TQString::tqfromLatin1("\\s"); } // if it's not the last item, add a pipe if((*it) != prefixes.last()) { - tokens += QChar('|'); + tokens += TQChar('|'); } } - QRegExp rx(QString::fromLatin1("^(") + tokens + QChar(')'), false); + TQRegExp rx(TQString::tqfromLatin1("^(") + tokens + TQChar(')'), false); // expensive if(rx.search(m_text) > -1) { m_key = m_text.mid(rx.matchedLength()); |