summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/kmymoneyaccounttreeforecast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/widgets/kmymoneyaccounttreeforecast.cpp')
-rw-r--r--kmymoney2/widgets/kmymoneyaccounttreeforecast.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/kmymoney2/widgets/kmymoneyaccounttreeforecast.cpp b/kmymoney2/widgets/kmymoneyaccounttreeforecast.cpp
index 0da5194..df1f735 100644
--- a/kmymoney2/widgets/kmymoneyaccounttreeforecast.cpp
+++ b/kmymoney2/widgets/kmymoneyaccounttreeforecast.cpp
@@ -30,10 +30,10 @@
using namespace reports;
-KMyMoneyAccountTreeForecast::KMyMoneyAccountTreeForecast(QWidget* parent, const char* name) :
- KMyMoneyAccountTreeBase::KMyMoneyAccountTreeBase(parent, name)
+KMyMoneyAccountTreeForecast::KMyMoneyAccountTreeForecast(TQWidget* tqparent, const char* name) :
+ KMyMoneyAccountTreeBase::KMyMoneyAccountTreeBase(tqparent, name)
{
- setResizeMode(QListView::NoColumn);
+ setResizeMode(TQListView::NoColumn);
}
void KMyMoneyAccountTreeForecast::showAccount( void )
@@ -57,14 +57,14 @@ void KMyMoneyAccountTreeForecast::showSummary(MyMoneyForecast& forecast)
addColumn(i18n("Current"), -1);
//if beginning of forecast is today, set the begin day to next cycle to avoid repeating the first cycle
- if(QDate::currentDate() < forecast.beginForecastDate()) {
- daysToBeginDay = QDate::currentDate().daysTo(forecast.beginForecastDate());
+ if(TQDate::tqcurrentDate() < forecast.beginForecastDate()) {
+ daysToBeginDay = TQDate::tqcurrentDate().daysTo(forecast.beginForecastDate());
} else {
daysToBeginDay = forecast.accountsCycle();
}
for(int i = 0; ((i*forecast.accountsCycle())+daysToBeginDay) <= forecast.forecastDays(); ++i) {
int intervalDays = ((i*forecast.accountsCycle())+daysToBeginDay);
- QString columnName = i18n("%1 days").arg(intervalDays, 0, 10);
+ TQString columnName = i18n("%1 days").tqarg(intervalDays, 0, 10);
addColumn(columnName, -1);
}
@@ -73,7 +73,7 @@ void KMyMoneyAccountTreeForecast::showSummary(MyMoneyForecast& forecast)
//align columns
for(int i = 1; i < columns(); ++i) {
- setColumnAlignment(i, Qt::AlignRight);
+ setColumnAlignment(i, TQt::AlignRight);
}
}
@@ -84,8 +84,8 @@ void KMyMoneyAccountTreeForecast::showDetailed(MyMoneyForecast& forecast)
addColumn(i18n("Current"), -1);
for(int i = 1; i <= forecast.forecastDays(); ++i) {
- QDate forecastDate = QDate::currentDate().addDays(i);
- QString columnName = KGlobal::locale()->formatDate(forecastDate, true);
+ TQDate forecastDate = TQDate::tqcurrentDate().addDays(i);
+ TQString columnName = KGlobal::locale()->formatDate(forecastDate, true);
addColumn(columnName, -1);
}
@@ -94,7 +94,7 @@ void KMyMoneyAccountTreeForecast::showDetailed(MyMoneyForecast& forecast)
//align columns
for(int i = 1; i < columns(); ++i) {
- setColumnAlignment(i, Qt::AlignRight);
+ setColumnAlignment(i, TQt::AlignRight);
}
}
@@ -103,36 +103,36 @@ void KMyMoneyAccountTreeForecast::showAdvanced(MyMoneyForecast& forecast)
int daysToBeginDay;
//if beginning of forecast is today, set the begin day to next cycle to avoid repeating the first cycle
- if(QDate::currentDate() < forecast.beginForecastDate()) {
- daysToBeginDay = QDate::currentDate().daysTo(forecast.beginForecastDate());
+ if(TQDate::tqcurrentDate() < forecast.beginForecastDate()) {
+ daysToBeginDay = TQDate::tqcurrentDate().daysTo(forecast.beginForecastDate());
} else {
daysToBeginDay = forecast.accountsCycle();
}
//add columns
for(int i = 1; ((i * forecast.accountsCycle()) + daysToBeginDay) <= forecast.forecastDays(); ++i) {
- int col = addColumn(i18n("Min Bal %1").arg(i), -1);
- setColumnAlignment(col, Qt::AlignRight);
- addColumn(i18n("Min Date %1").arg(i), -1);
+ int col = addColumn(i18n("Min Bal %1").tqarg(i), -1);
+ setColumnAlignment(col, TQt::AlignRight);
+ addColumn(i18n("Min Date %1").tqarg(i), -1);
}
for(int i = 1; ((i * forecast.accountsCycle()) + daysToBeginDay) <= forecast.forecastDays(); ++i) {
- int col = addColumn(i18n("Max Bal %1").arg(i), -1);
- setColumnAlignment(col, Qt::AlignRight);
- addColumn(i18n("Max Date %1").arg(i), -1);
+ int col = addColumn(i18n("Max Bal %1").tqarg(i), -1);
+ setColumnAlignment(col, TQt::AlignRight);
+ addColumn(i18n("Max Date %1").tqarg(i), -1);
}
int col = addColumn(i18n("Average"), -1);
- setColumnAlignment(col, Qt::AlignRight);
+ setColumnAlignment(col, TQt::AlignRight);
}
void KMyMoneyAccountTreeForecast::showBudget(MyMoneyForecast& forecast)
{
- QDate forecastStartDate = forecast.forecastStartDate();
- QDate forecastEndDate = forecast.forecastEndDate();
+ TQDate forecastStartDate = forecast.forecastStartDate();
+ TQDate forecastEndDate = forecast.forecastEndDate();
//add cycle interval columns
- QDate f_date = forecastStartDate;
+ TQDate f_date = forecastStartDate;
for(; f_date <= forecastEndDate; f_date = f_date.addMonths(1)) {
- QString columnName = QDate::longMonthName(f_date.month());
+ TQString columnName = TQDate::longMonthName(f_date.month());
addColumn(columnName, -1);
}
//add total column
@@ -141,11 +141,11 @@ void KMyMoneyAccountTreeForecast::showBudget(MyMoneyForecast& forecast)
//align columns
for(int i = 1; i < columns(); ++i) {
- setColumnAlignment(i, Qt::AlignRight);
+ setColumnAlignment(i, TQt::AlignRight);
}
}
-void KMyMoneyAccountTreeForecast::slotSelectObject(const QListViewItem* i)
+void KMyMoneyAccountTreeForecast::slotSelectObject(const TQListViewItem* i)
{
emit selectObject(MyMoneyInstitution());
emit selectObject(MyMoneyAccount());
@@ -156,16 +156,16 @@ void KMyMoneyAccountTreeForecast::slotSelectObject(const QListViewItem* i)
}
}
-KMyMoneyAccountTreeForecastItem::KMyMoneyAccountTreeForecastItem(KListView *parent, const MyMoneyAccount& account, const MyMoneyForecast &forecast, const MyMoneySecurity& security, const QString& name) :
- KMyMoneyAccountTreeBaseItem(parent, account, security, name),
+KMyMoneyAccountTreeForecastItem::KMyMoneyAccountTreeForecastItem(KListView *tqparent, const MyMoneyAccount& account, const MyMoneyForecast &forecast, const MyMoneySecurity& security, const TQString& name) :
+ KMyMoneyAccountTreeBaseItem(tqparent, account, security, name),
m_forecast(forecast)
{
updateAccount(true);
}
-KMyMoneyAccountTreeForecastItem::KMyMoneyAccountTreeForecastItem(KMyMoneyAccountTreeForecastItem *parent, const MyMoneyAccount& account, const MyMoneyForecast& forecast, const QValueList<MyMoneyPrice>& price, const MyMoneySecurity& security, const EForecastViewType forecastType) :
- KMyMoneyAccountTreeBaseItem(parent, account, price, security),
+KMyMoneyAccountTreeForecastItem::KMyMoneyAccountTreeForecastItem(KMyMoneyAccountTreeForecastItem *tqparent, const MyMoneyAccount& account, const MyMoneyForecast& forecast, const TQValueList<MyMoneyPrice>& price, const MyMoneySecurity& security, const EForecastViewType forecastType) :
+ KMyMoneyAccountTreeBaseItem(tqparent, account, price, security),
m_forecast(forecast),
m_forecastType(forecastType)
{
@@ -205,8 +205,8 @@ void KMyMoneyAccountTreeForecastItem::updateSummary()
MyMoneyFile* file = MyMoneyFile::instance();
int daysToBeginDay;
- if(QDate::currentDate() < m_forecast.beginForecastDate()) {
- daysToBeginDay = QDate::currentDate().daysTo(m_forecast.beginForecastDate());
+ if(TQDate::tqcurrentDate() < m_forecast.beginForecastDate()) {
+ daysToBeginDay = TQDate::tqcurrentDate().daysTo(m_forecast.beginForecastDate());
} else {
daysToBeginDay = m_forecast.accountsCycle();
}
@@ -221,7 +221,7 @@ void KMyMoneyAccountTreeForecastItem::updateSummary()
//add current balance column
- QDate summaryDate = QDate::currentDate();
+ TQDate summaryDate = TQDate::tqcurrentDate();
amountMM = m_forecast.forecastBalance(m_account, summaryDate);
//calculate the balance in base currency for the total row
@@ -231,7 +231,7 @@ void KMyMoneyAccountTreeForecastItem::updateSummary()
it_c++;
//iterate through all other columns
- for(QDate summaryDate = QDate::currentDate().addDays(daysToBeginDay); summaryDate <= m_forecast.forecastEndDate();summaryDate = summaryDate.addDays(m_forecast.accountsCycle()), ++it_c) {
+ for(TQDate summaryDate = TQDate::tqcurrentDate().addDays(daysToBeginDay); summaryDate <= m_forecast.forecastEndDate();summaryDate = summaryDate.addDays(m_forecast.accountsCycle()), ++it_c) {
amountMM = m_forecast.forecastBalance(m_account, summaryDate);
//calculate the balance in base currency for the total row
@@ -248,8 +248,8 @@ void KMyMoneyAccountTreeForecastItem::updateSummary()
void KMyMoneyAccountTreeForecastItem::updateDetailed()
{
- QString amount;
- QString vAmount;
+ TQString amount;
+ TQString vAmount;
MyMoneyMoney vAmountMM;
MyMoneyFile* file = MyMoneyFile::instance();
@@ -263,7 +263,7 @@ void KMyMoneyAccountTreeForecastItem::updateDetailed()
int it_c = 1; // iterator for the columns of the listview
- for(QDate forecastDate = QDate::currentDate(); forecastDate <= m_forecast.forecastEndDate(); ++it_c, forecastDate = forecastDate.addDays(1)) {
+ for(TQDate forecastDate = TQDate::tqcurrentDate(); forecastDate <= m_forecast.forecastEndDate(); ++it_c, forecastDate = forecastDate.addDays(1)) {
MyMoneyMoney amountMM = m_forecast.forecastBalance(m_account, forecastDate);
//calculate the balance in base currency for the total row
@@ -286,7 +286,7 @@ void KMyMoneyAccountTreeForecastItem::updateBudget()
MyMoneyFile* file = MyMoneyFile::instance();
int it_c = 1; // iterator for the columns of the listview
- QDate forecastDate = m_forecast.forecastStartDate();
+ TQDate forecastDate = m_forecast.forecastStartDate();
if(m_account.isInvest()) {
MyMoneySecurity underSecurity = file->security(m_account.currencyId());
@@ -329,14 +329,14 @@ void KMyMoneyAccountTreeForecastItem::adjustParentValue(int column, const MyMone
m_values[column] += value;
m_values[column] = m_values[column].convert(listView()->baseCurrency().smallestAccountFraction());
- // if the entry has no children,
+ // if the entry has no tqchildren,
// or it is the top entry
// or it is currently not open
// we need to display the value of it
KMyMoneyAccountTreeForecast* lv = dynamic_cast<KMyMoneyAccountTreeForecast*>(listView());
if(!lv)
return;
- if(!firstChild() || !parent() || (!isOpen() && firstChild())
+ if(!firstChild() || !tqparent() || (!isOpen() && firstChild())
|| depth() == 1 ) {
if(firstChild())
setText(column, " ");
@@ -345,15 +345,15 @@ void KMyMoneyAccountTreeForecastItem::adjustParentValue(int column, const MyMone
}
// now make sure, the upstream accounts also get notified about the value change
- KMyMoneyAccountTreeForecastItem* p = dynamic_cast<KMyMoneyAccountTreeForecastItem*>(parent());
+ KMyMoneyAccountTreeForecastItem* p = dynamic_cast<KMyMoneyAccountTreeForecastItem*>(tqparent());
if(p != 0) {
p->adjustParentValue(column, value);
}
}
-void KMyMoneyAccountTreeForecastItem::setValue(int column, MyMoneyMoney amount, QDate forecastDate)
+void KMyMoneyAccountTreeForecastItem::setValue(int column, MyMoneyMoney amount, TQDate forecastDate)
{
- KMyMoneyAccountTreeForecastItem* p = dynamic_cast<KMyMoneyAccountTreeForecastItem*>(parent());
+ KMyMoneyAccountTreeForecastItem* p = dynamic_cast<KMyMoneyAccountTreeForecastItem*>(tqparent());
//calculate the balance in base currency for the total row
if(m_account.currencyId() != listView()->baseCurrency().id()) {