summaryrefslogtreecommitdiffstats
path: root/kmymoney2/views/kinvestmentlistitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/views/kinvestmentlistitem.cpp')
-rw-r--r--kmymoney2/views/kinvestmentlistitem.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/kmymoney2/views/kinvestmentlistitem.cpp b/kmymoney2/views/kinvestmentlistitem.cpp
index c2c41d9..f3cf29b 100644
--- a/kmymoney2/views/kinvestmentlistitem.cpp
+++ b/kmymoney2/views/kinvestmentlistitem.cpp
@@ -23,7 +23,7 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qpainter.h>
+#include <tqpainter.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -40,8 +40,8 @@
#include <kmymoney/mymoneysecurity.h>
#include <kmymoney/mymoneyfile.h>
-KInvestmentListItem::KInvestmentListItem(KListView* parent, const MyMoneyAccount& account)
- : KListViewItem(parent)
+KInvestmentListItem::KInvestmentListItem(KListView* tqparent, const MyMoneyAccount& account)
+ : KListViewItem(tqparent)
{
bColumn5Negative = false;
bColumn6Negative = false;
@@ -50,7 +50,7 @@ KInvestmentListItem::KInvestmentListItem(KListView* parent, const MyMoneyAccount
bColumn9Negative = false;
m_account = account;
- m_listView = parent;
+ m_listView = tqparent;
MyMoneySecurity security;
MyMoneyFile* file = MyMoneyFile::instance();
@@ -60,7 +60,7 @@ KInvestmentListItem::KInvestmentListItem(KListView* parent, const MyMoneyAccount
int prec = MyMoneyMoney::denomToPrec(m_tradingCurrency.smallestAccountFraction());
- QValueList<MyMoneyTransaction> transactionList;
+ TQValueList<MyMoneyTransaction> transactionList;
// FIXME PRICE
// equity_price_history history = equity.priceHistory();
@@ -100,37 +100,37 @@ KInvestmentListItem::~KInvestmentListItem()
// FIXME PRICE
#if 0
-const QString KInvestmentListItem::calculate1WeekGain(const equity_price_history& history)
+const TQString KInvestmentListItem::calculate1WeekGain(const equity_price_history& history)
{
return calculateGain(history, -7, 0, false, bColumn6Negative);
}
-const QString KInvestmentListItem::calculate4WeekGain(const equity_price_history& history)
+const TQString KInvestmentListItem::calculate4WeekGain(const equity_price_history& history)
{
return calculateGain(history, -28, 0, false, bColumn7Negative);
}
-const QString KInvestmentListItem::calculate3MonthGain(const equity_price_history& history)
+const TQString KInvestmentListItem::calculate3MonthGain(const equity_price_history& history)
{
return calculateGain(history, 0, -3, false, bColumn8Negative);
}
-const QString KInvestmentListItem::calculateYTDGain(const equity_price_history& history)
+const TQString KInvestmentListItem::calculateYTDGain(const equity_price_history& history)
{
return calculateGain(history, 0, 0, true, bColumn9Negative);
}
-const QString KInvestmentListItem::calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative)
+const TQString KInvestmentListItem::calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative)
{
bNegative = false;
if(history.isEmpty())
{
- return QString("0.0%");
+ return TQString("0.0%");
}
else
{
bool bFoundCurrent = false, bFoundComparison = false;
- QDate tempDate, comparisonDate = QDate::currentDate();
+ TQDate tempDate, comparisonDate = TQDate::tqcurrentDate();
if(YTD)
{
@@ -147,9 +147,9 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his
//find the current value, or closest to the current value.
equity_price_history::ConstIterator itToday = history.end();
- for(tempDate = QDate::currentDate(); tempDate >= comparisonDate; )
+ for(tempDate = TQDate::tqcurrentDate(); tempDate >= comparisonDate; )
{
- itToday = history.find(tempDate);
+ itToday = history.tqfind(tempDate);
if(itToday != history.end())
{
currentValue = itToday.data();
@@ -162,14 +162,14 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his
if(!bFoundCurrent)
{
- return QString("0.0%");
+ return TQString("0.0%");
}
- //find a date that is closest to a week old, not older, and not today's date. Because its a QMap, this map
+ //find a date that is closest to a week old, not older, and not today's date. Because its a TQMap, this map
//should already be sorted earliest to latest.
for(equity_price_history::ConstIterator it = history.begin(); it != history.end(); ++it)
{
- if(it.key() >= comparisonDate && it.key() < QDate::currentDate())
+ if(it.key() >= comparisonDate && it.key() < TQDate::tqcurrentDate())
{
comparisonDate = it.key();
comparisonValue = it.data();
@@ -180,7 +180,7 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his
if(!bFoundComparison)
{
- return QString("0.0%");
+ return TQString("0.0%");
}
//qDebug("Current date/value to use is %s/%s, Previous is %s/%s", tempDate.toString().data(), currentValue.toString().data(), comparisonDate.toString().data(), comparisonValue.toString().data());
@@ -195,21 +195,21 @@ const QString KInvestmentListItem::calculateGain(const equity_price_history& his
bNegative = true;
}
- QString ds = QString("%1%").arg(result, 0, 'f', 3);
+ TQString ds = TQString("%1%").tqarg(result, 0, 'f', 3);
return ds;
/*MyMoneyMoney result = (currentValue / comparisonValue);
result = result * 100;
result = result - 100;
qDebug("final result = %s", result.toString().data());
- return QString(result.formatMoney("", 3) + "%");*/
+ return TQString(result.formatMoney("", 3) + "%");*/
}
}
- return QString("");
+ return TQString("");
}
#endif
-int KInvestmentListItem::compare(QListViewItem* i, int col, bool ascending) const
+int KInvestmentListItem::compare(TQListViewItem* i, int col, bool ascending) const
{
KInvestmentListItem* item = dynamic_cast<KInvestmentListItem*>(i);
// do special sorting only for numeric columns
@@ -247,7 +247,7 @@ int KInvestmentListItem::compare(QListViewItem* i, int col, bool ascending) cons
return KListViewItem::compare(i, col, ascending);
}
-void KInvestmentListItem::paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align)
+void KInvestmentListItem::paintCell(TQPainter * p, const TQColorGroup & cg, int column, int width, int align)
{
bool bPaintRed = false;
if((column == COLUMN_RAWGAIN_INDEX && bColumn5Negative) ||
@@ -261,15 +261,15 @@ void KInvestmentListItem::paintCell(QPainter * p, const QColorGroup & cg, int co
p->save();
- QColorGroup cg2(cg);
+ TQColorGroup cg2(cg);
if(isAlternate())
- cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listColor());
+ cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listColor());
else
- cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listBGColor());
+ cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listBGColor());
#ifndef KMM_DESIGNER
- QFont font = KMyMoneyGlobalSettings::listCellFont();
+ TQFont font = KMyMoneyGlobalSettings::listCellFont();
// strike out closed accounts
if(m_account.isClosed())
font.setStrikeOut(true);
@@ -279,15 +279,15 @@ void KInvestmentListItem::paintCell(QPainter * p, const QColorGroup & cg, int co
if(bPaintRed)
{
- QColorGroup _cg( cg2);
- QColor c = _cg.text();
- _cg.setColor(QColorGroup::Text, Qt::red);
- QListViewItem::paintCell(p, _cg, column, width, align);
- _cg.setColor(QColorGroup::Text, c);
+ TQColorGroup _cg( cg2);
+ TQColor c = _cg.text();
+ _cg.setColor(TQColorGroup::Text, TQt::red);
+ TQListViewItem::paintCell(p, _cg, column, width, align);
+ _cg.setColor(TQColorGroup::Text, c);
}
else
{
- QListViewItem::paintCell(p, cg2, column, width, align);
+ TQListViewItem::paintCell(p, cg2, column, width, align);
}
p->restore();