diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
commit | 2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch) | |
tree | 18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/detailedentryitem.cpp | |
parent | 1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff) | |
download | tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip |
TQt4 port tellico
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/detailedentryitem.cpp')
-rw-r--r-- | src/detailedentryitem.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/detailedentryitem.cpp b/src/detailedentryitem.cpp index 0a71f25..4904e19 100644 --- a/src/detailedentryitem.cpp +++ b/src/detailedentryitem.cpp @@ -21,10 +21,10 @@ #include <klocale.h> #include <kstringhandler.h> -#include <qpainter.h> -#include <qheader.h> -#include <qdatetime.h> -#include <qtimer.h> +#include <tqpainter.h> +#include <tqheader.h> +#include <tqdatetime.h> +#include <tqtimer.h> namespace { static const short ENTRY_MAX_MINUTES_MESSAGE = 5; @@ -32,8 +32,8 @@ namespace { using Tellico::DetailedEntryItem; -DetailedEntryItem::DetailedEntryItem(DetailedListView* parent_, Data::EntryPtr entry_) - : EntryItem(parent_, entry_), m_state(Normal), m_time(0), m_timer(0) { +DetailedEntryItem::DetailedEntryItem(DetailedListView* tqparent_, Data::EntryPtr entry_) + : EntryItem(tqparent_, entry_), m_state(Normal), m_time(0), m_timer(0) { } DetailedEntryItem::~DetailedEntryItem() { @@ -56,22 +56,22 @@ void DetailedEntryItem::setState(State state_) { m_timer = 0; } else { if(!m_time) { - m_time = new QTime; + m_time = new TQTime; } m_time->start(); if(!m_timer) { - m_timer = new QTimer(); - m_timer->connect(m_timer, SIGNAL(timeout()), listView(), SLOT(triggerUpdate())); + m_timer = new TQTimer(); + m_timer->connect(m_timer, TQT_SIGNAL(timeout()), listView(), TQT_SLOT(triggerUpdate())); } m_timer->start(30 * 1000); // every 30 seconds } // have to put this in a timer, or it doesn't update properly - QTimer::singleShot(500, listView(), SLOT(triggerUpdate())); + TQTimer::singleShot(500, listView(), TQT_SLOT(triggerUpdate())); } -void DetailedEntryItem::paintCell(QPainter* p_, const QColorGroup& cg_, +void DetailedEntryItem::paintCell(TQPainter* p_, const TQColorGroup& cg_, int column_, int width_, int align_) { if(m_state == Normal) { EntryItem::paintCell(p_, cg_, column_, width_, align_); @@ -84,7 +84,7 @@ void DetailedEntryItem::paintCell(QPainter* p_, const QColorGroup& cg_, t = 0; } - QFont f = p_->font(); + TQFont f = p_->font(); f.setBold(true); if(m_state == New) { f.setItalic(true); @@ -92,22 +92,22 @@ void DetailedEntryItem::paintCell(QPainter* p_, const QColorGroup& cg_, p_->setFont(f); // taken from ListViewItem, but without line drawn to right of cell - QColorGroup cg = cg_; - const QPixmap* pm = listView()->viewport()->backgroundPixmap(); + TQColorGroup cg = cg_; + const TQPixmap* pm = listView()->viewport()->backgroundPixmap(); if(pm && !pm->isNull()) { - cg.setBrush(QColorGroup::Base, QBrush(backgroundColor(column_), *pm)); - QPoint o = p_->brushOrigin(); + cg.setBrush(TQColorGroup::Base, TQBrush(backgroundColor(column_), *pm)); + TQPoint o = p_->brushOrigin(); p_->setBrushOrigin(o.x()-listView()->contentsX(), o.y()-listView()->contentsY()); } else { - cg.setColor(listView()->viewport()->backgroundMode() == Qt::FixedColor ? - QColorGroup::Background : QColorGroup::Base, + cg.setColor(listView()->viewport()->backgroundMode() == TQt::FixedColor ? + TQColorGroup::Background : TQColorGroup::Base, backgroundColor(column_)); } // don't call KListViewItem::paintCell() since that also does alternate painting, etc... - QListViewItem::paintCell(p_, cg, column_, width_, align_); + TQListViewItem::paintCell(p_, cg, column_, width_, align_); } -QColor DetailedEntryItem::backgroundColor(int column_) { +TQColor DetailedEntryItem::backgroundColor(int column_) { GUI::ListView* lv = listView(); if(!lv || m_state == Normal || isSelected()) { return EntryItem::backgroundColor(column_); @@ -116,12 +116,12 @@ QColor DetailedEntryItem::backgroundColor(int column_) { if(t > ENTRY_MAX_MINUTES_MESSAGE) { return EntryItem::backgroundColor(column_); } - return blendColors(lv->colorGroup().highlight(), - lv->colorGroup().base(), + return blendColors(lv->tqcolorGroup().highlight(), + lv->tqcolorGroup().base(), 80 + 20*t/ENTRY_MAX_MINUTES_MESSAGE /* percent */); // no more than 20% of highlight color } -void DetailedEntryItem::paintFocus(QPainter*, const QColorGroup&, const QRect&) { +void DetailedEntryItem::paintFocus(TQPainter*, const TQColorGroup&, const TQRect&) { // don't paint anything } |