diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /parts/replace/replaceitem.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/replace/replaceitem.cpp')
-rw-r--r-- | parts/replace/replaceitem.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/parts/replace/replaceitem.cpp b/parts/replace/replaceitem.cpp index bc33211f..d810e2ad 100644 --- a/parts/replace/replaceitem.cpp +++ b/parts/replace/replaceitem.cpp @@ -9,10 +9,10 @@ * * ***************************************************************************/ -#include <qpainter.h> -#include <qstyle.h> -#include <qpalette.h> -#include <qcheckbox.h> +#include <tqpainter.h> +#include <tqstyle.h> +#include <tqpalette.h> +#include <tqcheckbox.h> #include "replaceitem.h" @@ -69,41 +69,41 @@ void ReplaceItem::setChecked( bool checked ) } } -// code mostly lifted from QCheckListItem::paintCell() -void ReplaceItem::paintCell( QPainter * p, const QColorGroup & cg, int column, int width, int align ) +// code mostly lifted from TQCheckListItem::paintCell() +void ReplaceItem::paintCell( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ) { if ( !p ) return; - QListView *lvv = listView(); + TQListView *lvv = listView(); if ( !lvv ) return; ReplaceView * lv = static_cast<ReplaceView*>(lvv); const BackgroundMode bgmode = lv->viewport()->backgroundMode(); - const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode( bgmode ); + const TQColorGroup::ColorRole crole = TQPalette::backgroundRoleFromMode( bgmode ); if ( cg.brush( crole ) != lv->colorGroup().brush( crole ) ) p->fillRect( 0, 0, width, height(), cg.brush( crole ) ); else - lv->paintEmptyArea( p, QRect( 0, 0, width, height() ) ); + lv->paintEmptyArea( p, TQRect( 0, 0, width, height() ) ); - QFontMetrics fm( lv->fontMetrics() ); - int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv); + TQFontMetrics fm( lv->fontMetrics() ); + int boxsize = lv->style().pixelMetric(TQStyle::PM_CheckListButtonSize, lv); int marg = lv->itemMargin(); int r = marg; // Draw controller / checkbox / radiobutton --------------------- - int styleflags = QStyle::Style_Default; + int styleflags = TQStyle::Style_Default; if ( isOn() ) - styleflags |= QStyle::Style_On; + styleflags |= TQStyle::Style_On; else - styleflags |= QStyle::Style_Off; + styleflags |= TQStyle::Style_Off; if ( isSelected() ) - styleflags |= QStyle::Style_Selected; + styleflags |= TQStyle::Style_Selected; if ( isEnabled() && lv->isEnabled() ) - styleflags |= QStyle::Style_Enabled; + styleflags |= TQStyle::Style_Enabled; int x = 0; int y = 0; @@ -116,30 +116,30 @@ void ReplaceItem::paintCell( QPainter * p, const QColorGroup & cg, int column, i else y = (fm.height() + 2 + marg - boxsize) / 2; - lv->style().drawPrimitive(QStyle::PE_CheckListIndicator, p, - QRect(x, y, boxsize, + lv->style().drawPrimitive(TQStyle::PE_CheckListIndicator, p, + TQRect(x, y, boxsize, fm.height() + 2 + marg), - cg, styleflags, QStyleOption(this)); + cg, styleflags, TQStyleOption(this)); r += boxsize + 4; // Draw text ---------------------------------------------------- p->translate( r, 0 ); - p->setPen( QPen( cg.text() ) ); + p->setPen( TQPen( cg.text() ) ); - QColorGroup mcg = cg; - mcg.setColor( QColorGroup::Text, ( isFile() ? Qt::darkGreen : Qt::blue ) ); - mcg.setColor( QColorGroup::HighlightedText, ( isFile() ? Qt::darkGreen : Qt::blue ) ); + TQColorGroup mcg = cg; + mcg.setColor( TQColorGroup::Text, ( isFile() ? Qt::darkGreen : Qt::blue ) ); + mcg.setColor( TQColorGroup::HighlightedText, ( isFile() ? Qt::darkGreen : Qt::blue ) ); - QListViewItem::paintCell( p, mcg, column, width - r, align ); + TQListViewItem::paintCell( p, mcg, column, width - r, align ); } -void ReplaceItem::activate( int, QPoint const & localPos ) +void ReplaceItem::activate( int, TQPoint const & localPos ) { - QListView * lv = listView(); - QCheckBox cb(0); + TQListView * lv = listView(); + TQCheckBox cb(0); int boxsize = cb.sizeHint().width(); -//that's KDE-3.1 only int boxsize = lv->style().pixelMetric(QStyle::PM_CheckListButtonSize, lv); +//that's KDE-3.1 only int boxsize = lv->style().pixelMetric(TQStyle::PM_CheckListButtonSize, lv); int rightside = lv->itemMargin() + boxsize + ( isFile() ? 0 : lv->treeStepSize() ); // _lineclicked indicates if the click was on the line or in the checkbox |