summaryrefslogtreecommitdiffstats
path: root/kmymoney2/dialogs/kcurrencycalculator.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-05 06:00:29 +0000
commitfecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch)
tree6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/dialogs/kcurrencycalculator.cpp
parentdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff)
downloadkmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz
kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/dialogs/kcurrencycalculator.cpp')
-rw-r--r--kmymoney2/dialogs/kcurrencycalculator.cpp74
1 files changed, 37 insertions, 37 deletions
diff --git a/kmymoney2/dialogs/kcurrencycalculator.cpp b/kmymoney2/dialogs/kcurrencycalculator.cpp
index 6e674dc..0457a98 100644
--- a/kmymoney2/dialogs/kcurrencycalculator.cpp
+++ b/kmymoney2/dialogs/kcurrencycalculator.cpp
@@ -23,11 +23,11 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qlabel.h>
-#include <qradiobutton.h>
-#include <qcheckbox.h>
-#include <qwidgetstack.h>
-#include <qgroupbox.h>
+#include <tqlabel.h>
+#include <tqradiobutton.h>
+#include <tqcheckbox.h>
+#include <tqwidgetstack.h>
+#include <tqgroupbox.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -51,7 +51,7 @@
#include "../kmymoneyutils.h"
-bool KCurrencyCalculator::setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTransaction& t, const MyMoneySplit& s, const QMap<QString, MyMoneyMoney>& priceInfo, QWidget* parentWidget)
+bool KCurrencyCalculator::setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTransaction& t, const MyMoneySplit& s, const TQMap<TQString, MyMoneyMoney>& priceInfo, TQWidget* tqparentWidget)
{
bool rc = true;
MyMoneyFile* file = MyMoneyFile::instance();
@@ -72,7 +72,7 @@ bool KCurrencyCalculator::setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTra
fromValue = s.value().abs();
// if we had a price info in the beginning, we use it here
- if(priceInfo.find(cat.currencyId()) != priceInfo.end()) {
+ if(priceInfo.tqfind(cat.currencyId()) != priceInfo.end()) {
toValue = (fromValue * priceInfo[cat.currencyId()]).convert(fract);
}
@@ -95,9 +95,9 @@ bool KCurrencyCalculator::setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTra
toValue,
t.postDate(),
fract,
- parentWidget, "currencyCalculator");
+ tqparentWidget, "currencyCalculator");
- if(calc.exec() == QDialog::Rejected) {
+ if(calc.exec() == TQDialog::Rejected) {
rc = false;
} else
shares = (s.value() * calc.price()).convert(fract);
@@ -111,8 +111,8 @@ bool KCurrencyCalculator::setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTra
return rc;
}
-KCurrencyCalculator::KCurrencyCalculator(const MyMoneySecurity& from, const MyMoneySecurity& to, const MyMoneyMoney& value, const MyMoneyMoney& shares, const QDate& date, const signed64 resultFraction, QWidget *parent, const char *name ) :
- KCurrencyCalculatorDecl(parent, name),
+KCurrencyCalculator::KCurrencyCalculator(const MyMoneySecurity& from, const MyMoneySecurity& to, const MyMoneyMoney& value, const MyMoneyMoney& shares, const TQDate& date, const signed64 resultFraction, TQWidget *tqparent, const char *name ) :
+ KCurrencyCalculatorDecl(tqparent, name),
m_fromCurrency(from),
m_toCurrency(to),
m_result(shares.abs()),
@@ -125,7 +125,7 @@ KCurrencyCalculator::KCurrencyCalculator(const MyMoneySecurity& from, const MyMo
if(date.isValid())
m_dateEdit->setDate(date);
else
- m_dateEdit->setDate(QDate::currentDate());
+ m_dateEdit->setDate(TQDate::tqcurrentDate());
m_fromCurrencyText->setText(m_fromCurrency.isCurrency() ? m_fromCurrency.id() : m_fromCurrency.tradingSymbol());
m_toCurrencyText->setText(m_toCurrency.isCurrency() ? m_toCurrency.id() : m_toCurrency.tradingSymbol());
@@ -157,13 +157,13 @@ KCurrencyCalculator::KCurrencyCalculator(const MyMoneySecurity& from, const MyMo
m_conversionRate->setPrecision(KMyMoneyGlobalSettings::pricePrecision());
- connect(m_amountButton, SIGNAL(clicked()), this, SLOT(slotSetToAmount()));
- connect(m_rateButton, SIGNAL(clicked()), this, SLOT(slotSetExchangeRate()));
+ connect(m_amountButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSetToAmount()));
+ connect(m_rateButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotSetExchangeRate()));
- connect(m_toAmount, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateResult(const QString&)));
- connect(m_conversionRate, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateRate(const QString&)));
- connect(m_cancelButton, SIGNAL(clicked()), this, SLOT(reject()));
- connect(m_okButton, SIGNAL(clicked()), this, SLOT(accept()));
+ connect(m_toAmount, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateResult(const TQString&)));
+ connect(m_conversionRate, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateRate(const TQString&)));
+ connect(m_cancelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject()));
+ connect(m_okButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()));
// use this as the default
m_amountButton->animateClick();
@@ -204,14 +204,14 @@ void KCurrencyCalculator::slotSetExchangeRate(void)
m_conversionRate->setEnabled(true);
}
-void KCurrencyCalculator::slotUpdateResult(const QString& /*txt*/)
+void KCurrencyCalculator::slotUpdateResult(const TQString& /*txt*/)
{
MyMoneyMoney result = m_toAmount->value();
MyMoneyMoney price(0, 1);
if(result.isNegative()) {
m_toAmount->setValue(-result);
- slotUpdateResult(QString());
+ slotUpdateResult(TQString());
return;
}
@@ -225,13 +225,13 @@ void KCurrencyCalculator::slotUpdateResult(const QString& /*txt*/)
updateExample(price);
}
-void KCurrencyCalculator::slotUpdateRate(const QString& /*txt*/)
+void KCurrencyCalculator::slotUpdateRate(const TQString& /*txt*/)
{
MyMoneyMoney price = m_conversionRate->value();
if(price.isNegative()) {
m_conversionRate->setValue(-price);
- slotUpdateRate(QString());
+ slotUpdateRate(TQString());
return;
}
@@ -245,24 +245,24 @@ void KCurrencyCalculator::slotUpdateRate(const QString& /*txt*/)
void KCurrencyCalculator::updateExample(const MyMoneyMoney& price)
{
- QString msg;
+ TQString msg;
if(price.isZero()) {
- msg = QString("1 %1 = ? %2").arg(m_fromCurrency.tradingSymbol())
- .arg(m_toCurrency.tradingSymbol());
+ msg = TQString("1 %1 = ? %2").tqarg(m_fromCurrency.tradingSymbol())
+ .tqarg(m_toCurrency.tradingSymbol());
if(m_fromCurrency.isCurrency()) {
- msg += QString("\n");
- msg += QString("1 %1 = ? %2").arg(m_toCurrency.tradingSymbol())
- .arg(m_fromCurrency.tradingSymbol());
+ msg += TQString("\n");
+ msg += TQString("1 %1 = ? %2").tqarg(m_toCurrency.tradingSymbol())
+ .tqarg(m_fromCurrency.tradingSymbol());
}
} else {
- msg = QString("1 %1 = %2 %3").arg(m_fromCurrency.tradingSymbol())
- .arg(price.formatMoney("", KMyMoneyGlobalSettings::pricePrecision()))
- .arg(m_toCurrency.tradingSymbol());
+ msg = TQString("1 %1 = %2 %3").tqarg(m_fromCurrency.tradingSymbol())
+ .tqarg(price.formatMoney("", KMyMoneyGlobalSettings::pricePrecision()))
+ .tqarg(m_toCurrency.tradingSymbol());
if(m_fromCurrency.isCurrency()) {
- msg += QString("\n");
- msg += QString("1 %1 = %2 %3").arg(m_toCurrency.tradingSymbol())
- .arg((MyMoneyMoney(1,1)/price).formatMoney("", KMyMoneyGlobalSettings::pricePrecision()))
- .arg(m_fromCurrency.tradingSymbol());
+ msg += TQString("\n");
+ msg += TQString("1 %1 = %2 %3").tqarg(m_toCurrency.tradingSymbol())
+ .tqarg((MyMoneyMoney(1,1)/price).formatMoney("", KMyMoneyGlobalSettings::pricePrecision()))
+ .tqarg(m_fromCurrency.tradingSymbol());
}
}
m_conversionExample->setText(msg);
@@ -272,9 +272,9 @@ void KCurrencyCalculator::updateExample(const MyMoneyMoney& price)
void KCurrencyCalculator::accept(void)
{
if(m_conversionRate->isEnabled())
- slotUpdateRate(QString());
+ slotUpdateRate(TQString());
else
- slotUpdateResult(QString());
+ slotUpdateResult(TQString());
if(m_updateButton->isChecked()) {
MyMoneyPrice pr = MyMoneyFile::instance()->price(m_fromCurrency.id(), m_toCurrency.id(), m_dateEdit->date());