diff options
Diffstat (limited to 'lib/widgets/fancylistviewitem.cpp')
-rw-r--r-- | lib/widgets/fancylistviewitem.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/lib/widgets/fancylistviewitem.cpp b/lib/widgets/fancylistviewitem.cpp index a327ac04..6e60f1a4 100644 --- a/lib/widgets/fancylistviewitem.cpp +++ b/lib/widgets/fancylistviewitem.cpp @@ -17,15 +17,15 @@ Boston, MA 02110-1301, USA. */ -#include <qpixmap.h> -#include <qapplication.h> -#include <qnamespace.h> +#include <tqpixmap.h> +#include <tqapplication.h> +#include <tqnamespace.h> #include <kdeversion.h> #include "fancylistviewitem.h" -void FancyListViewItem::init(const QString& label1, const QString& /*label2*/) { +void FancyListViewItem::init(const TQString& label1, const TQString& /*label2*/) { if( !label1.isEmpty() ) { setText(0, label1); } @@ -41,7 +41,7 @@ void FancyListViewItem::setItem(int column, TextPaintItem item) { } -void FancyListViewItem::setText ( int column, const QString & text ) { +void FancyListViewItem::setText ( int column, const TQString & text ) { if( column >= int(m_items.size()) ) { m_items.append( TextPaintItem(text) ); }else{ @@ -50,60 +50,60 @@ void FancyListViewItem::setText ( int column, const QString & text ) { } -QString FancyListViewItem::text(int column) const { +TQString FancyListViewItem::text(int column) const { if( m_items.isEmpty() ) return ""; - return (QString)m_items[column]; + return (TQString)m_items[column]; } -QColor FancyListViewItem::backgroundColor(int col) { +TQColor FancyListViewItem::backgroundColor(int col) { return KListViewItem::backgroundColor(col); } -///this is a modified version of the original QListViewItem::paintCell from the qt source +///this is a modified version of the original TQListViewItem::paintCell from the qt source ///multiline is not supported! -void FancyListViewItem::paintCell( QPainter *painter, const QColorGroup &cg, +void FancyListViewItem::paintCell( TQPainter *painter, const TQColorGroup &cg, int column, int width, int align) { if(column < 0 || column >= int(m_items.size()) || m_items[column].items().isEmpty()) { - QListViewItem::paintCell(painter, cg, column, width, align); + TQListViewItem::paintCell(painter, cg, column, width, align); return; } painter->save(); - QColorGroup grp(cg); + TQColorGroup grp(cg); int styleNum = m_items[column].items()[0].style; TextPaintStyleStore::Item& style = m_styles.getStyle( styleNum ); ///currently only the first background-color is used if( style.bgValid() ) { - grp.setColor( QColorGroup::Base, style.background ); + grp.setColor( TQColorGroup::Base, style.background ); }else{ if(backgroundColor(column).isValid()) - grp.setColor( QColorGroup::Base, backgroundColor(column) ); ///use the nice kde background-color + grp.setColor( TQColorGroup::Base, backgroundColor(column) ); ///use the nice kde background-color } - QListView *lv = listView(); + TQListView *lv = listView(); if ( !lv ) return; - QPainter* p = painter; - QFontMetrics fm( p->fontMetrics() ); + TQPainter* p = painter; + TQFontMetrics fm( p->fontMetrics() ); - QString t = text( column ); + TQString t = text( column ); int marg = lv->itemMargin(); int r = marg; - const QPixmap * icon = pixmap( column ); + const TQPixmap * icon = pixmap( column ); const BackgroundMode bgmode = lv->viewport()->backgroundMode(); - const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode( bgmode ); + const TQColorGroup::ColorRole crole = TQPalette::backgroundRoleFromMode( bgmode ); p->fillRect( 0, 0, width, height(), grp.brush( crole ) ); if ( isSelected() && (column == 0 || lv->allColumnsShowFocus()) ) { - p->fillRect( r - marg, 0, width - r + marg, height(), cg.brush( QColorGroup::Highlight ) ); + p->fillRect( r - marg, 0, width - r + marg, height(), cg.brush( TQColorGroup::Highlight ) ); if ( isEnabled() || !lv ) p->setPen( cg.highlightedText() ); @@ -164,9 +164,9 @@ void FancyListViewItem::paintCell( QPainter *painter, const QColorGroup &cg, } -int FancyListViewItem::textWidth(const QFont& font, const QString& text) +int FancyListViewItem::textWidth(const TQFont& font, const TQString& text) { - QFontMetrics fm( font ); + TQFontMetrics fm( font ); if ( multiLinesEnabled() ) return fm.size( AlignVCenter, text ).width(); else @@ -175,7 +175,7 @@ int FancyListViewItem::textWidth(const QFont& font, const QString& text) } -int FancyListViewItem::width(const QFontMetrics &fm, const QListView *lv, int column) +int FancyListViewItem::width(const TQFontMetrics &fm, const TQListView *lv, int column) { int width = 0; if (column >= 0 && column < (int)m_items.size() && !multiLinesEnabled()) { @@ -189,14 +189,14 @@ int FancyListViewItem::width(const QFontMetrics &fm, const QListView *lv, int co } width += lv->itemMargin() * 2;// - lv->d->minLeftBearing - lv->d->minRightBearing; - const QPixmap * pm = pixmap( column ); + const TQPixmap * pm = pixmap( column ); if ( pm ) width += pm->width() + lv->itemMargin(); - width = QMAX( width, QApplication::globalStrut().width() ); + width = QMAX( width, TQApplication::globalStrut().width() ); } else - width = QListViewItem::width(fm, lv, column); + width = TQListViewItem::width(fm, lv, column); return width; } |