summaryrefslogtreecommitdiffstats
path: root/kmymoney2/dialogs/investactivities.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/investactivities.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/investactivities.cpp')
-rw-r--r--kmymoney2/dialogs/investactivities.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/kmymoney2/dialogs/investactivities.cpp b/kmymoney2/dialogs/investactivities.cpp
index d929c38..be0f6d1 100644
--- a/kmymoney2/dialogs/investactivities.cpp
+++ b/kmymoney2/dialogs/investactivities.cpp
@@ -18,7 +18,7 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qlabel.h>
+#include <tqlabel.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -39,12 +39,12 @@
using namespace Invest;
using namespace KMyMoneyRegister;
-bool Activity::isComplete(QString& reason) const
+bool Activity::isComplete(TQString& reason) const
{
bool rc = false;
KMyMoneySecurity* security = dynamic_cast<KMyMoneySecurity*>(haveWidget("security"));
if(!security->currentText().isEmpty()) {
- rc = security->selector()->contains(security->currentText());
+ rc = security->selector()->tqcontains(security->currentText());
}
return rc;
}
@@ -58,12 +58,12 @@ bool Activity::haveAssetAccount(void) const
rc = !cat->currentText().isEmpty();
if(rc && !cat->currentText().isEmpty()) {
- rc = cat->selector()->contains(cat->currentText());
+ rc = cat->selector()->tqcontains(cat->currentText());
}
return rc;
}
-bool Activity::haveCategoryAndAmount(const QString& category, const QString& amount, bool optional) const
+bool Activity::haveCategoryAndAmount(const TQString& category, const TQString& amount, bool optional) const
{
KMyMoneyCategory* cat = dynamic_cast<KMyMoneyCategory*>(haveWidget(category));
@@ -72,7 +72,7 @@ bool Activity::haveCategoryAndAmount(const QString& category, const QString& amo
rc = !cat->currentText().isEmpty();
if(rc && !cat->currentText().isEmpty()) {
- rc = cat->selector()->contains(cat->currentText()) || cat->isSplitTransaction();
+ rc = cat->selector()->tqcontains(cat->currentText()) || cat->isSplitTransaction();
if(rc && !amount.isEmpty()) {
MyMoneyMoney value = dynamic_cast<kMyMoneyEdit*>(haveWidget(amount))->value();
if(!isMultiSelection())
@@ -100,14 +100,14 @@ bool Activity::havePrice(void) const
return !amount->value().isZero();
}
-bool Activity::createCategorySplits(const MyMoneyTransaction& t, KMyMoneyCategory* cat, kMyMoneyEdit* amount, MyMoneyMoney factor, QValueList<MyMoneySplit>&splits, const QValueList<MyMoneySplit>& osplits ) const
+bool Activity::createCategorySplits(const MyMoneyTransaction& t, KMyMoneyCategory* cat, kMyMoneyEdit* amount, MyMoneyMoney factor, TQValueList<MyMoneySplit>&splits, const TQValueList<MyMoneySplit>& osplits ) const
{
bool rc = true;
if(!isMultiSelection() || (isMultiSelection() && !cat->currentText().isEmpty())) {
if(!cat->isSplitTransaction()) {
splits.clear();
MyMoneySplit s1;
- QString categoryId;
+ TQString categoryId;
categoryId = cat->selectedItem();
if(!categoryId.isEmpty()) {
s1.setAccountId(categoryId);
@@ -128,18 +128,18 @@ void Activity::createAssetAccountSplit(MyMoneySplit& split, const MyMoneySplit&
{
KMyMoneyCategory* cat = dynamic_cast<KMyMoneyCategory*>(haveWidget("asset-account"));
if(!isMultiSelection() || (isMultiSelection() && !cat->currentText().isEmpty())) {
- QString categoryId;
+ TQString categoryId;
categoryId = cat->selectedItem();
split.setAccountId(categoryId);
}
split.setMemo(stockSplit.memo());
}
-MyMoneyMoney Activity::sumSplits(const MyMoneySplit& s0, const QValueList<MyMoneySplit>& feeSplits, const QValueList<MyMoneySplit>& interestSplits) const
+MyMoneyMoney Activity::sumSplits(const MyMoneySplit& s0, const TQValueList<MyMoneySplit>& feeSplits, const TQValueList<MyMoneySplit>& interestSplits) const
{
MyMoneyMoney total;
total = s0.value();
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = feeSplits.begin(); it_s != feeSplits.end(); ++it_s) {
total += (*it_s).value();
}
@@ -149,13 +149,13 @@ MyMoneyMoney Activity::sumSplits(const MyMoneySplit& s0, const QValueList<MyMone
return total;
}
-void Activity::setLabelText(const QString& idx, const QString& txt) const
+void Activity::setLabelText(const TQString& idx, const TQString& txt) const
{
- QLabel* w = dynamic_cast<QLabel*>(haveWidget(idx));
+ TQLabel* w = dynamic_cast<TQLabel*>(haveWidget(idx));
if(w) {
w->setText(txt);
} else {
- qDebug("Unknown QLabel named '%s'", idx.data());
+ qDebug("Unknown TQLabel named '%s'", idx.data());
}
}
@@ -165,7 +165,7 @@ void Activity::preloadAssetAccount(void)
cat = dynamic_cast<KMyMoneyCategory*>(haveWidget("asset-account"));
if(cat->isVisible()) {
if(cat->currentText().isEmpty()) {
- MyMoneyAccount acc = MyMoneyFile::instance()->accountByName(i18n("%1 (Brokerage)").arg(m_parent->account().name()));
+ MyMoneyAccount acc = MyMoneyFile::instance()->accountByName(i18n("%1 (Brokerage)").tqarg(m_parent->account().name()));
if(!acc.id().isEmpty()) {
bool blocked = cat->signalsBlocked();
// block signals, so that the focus does not go crazy
@@ -182,13 +182,13 @@ void Buy::showWidgets(void) const
{
KMyMoneyCategory* cat;
cat = dynamic_cast<KMyMoneyCategory*>(haveWidget("fee-account"));
- cat->parentWidget()->show();
+ cat->tqparentWidget()->show();
cat = dynamic_cast<KMyMoneyCategory*>(haveWidget("interest-account"));
- cat->parentWidget()->show();
+ cat->tqparentWidget()->show();
kMyMoneyEdit* shareEdit = dynamic_cast<kMyMoneyEdit*>(haveWidget("shares"));
shareEdit->show();
shareEdit->setPrecision(MyMoneyMoney::denomToPrec(m_parent->security().smallestAccountFraction()));
- cat->parentWidget()->show();
+ cat->tqparentWidget()->show();
haveWidget("asset-account")->show();
haveWidget("price")->show();
haveWidget("total")->show();
@@ -201,7 +201,7 @@ void Buy::showWidgets(void) const
setLabelText("total-label", i18n("Total"));
}
-bool Buy::isComplete(QString& reason) const
+bool Buy::isComplete(TQString& reason) const
{
bool rc = Activity::isComplete(reason);
rc &= haveAssetAccount();
@@ -213,13 +213,13 @@ bool Buy::isComplete(QString& reason) const
return rc;
}
-bool Buy::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList<MyMoneySplit>& feeSplits, QValueList<MyMoneySplit>& m_feeSplits, QValueList<MyMoneySplit>& interestSplits, QValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
+bool Buy::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList<MyMoneySplit>& feeSplits, TQValueList<MyMoneySplit>& m_feeSplits, TQValueList<MyMoneySplit>& interestSplits, TQValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
{
Q_UNUSED(m_interestSplits);
Q_UNUSED(security);
Q_UNUSED(currency);
- QString reason;
+ TQString reason;
if(!isComplete(reason))
return false;
@@ -271,9 +271,9 @@ void Sell::showWidgets(void) const
{
KMyMoneyCategory* cat;
cat = dynamic_cast<KMyMoneyCategory*>(haveWidget("interest-account"));
- cat->parentWidget()->show();
+ cat->tqparentWidget()->show();
cat = dynamic_cast<KMyMoneyCategory*>(haveWidget("fee-account"));
- cat->parentWidget()->show();
+ cat->tqparentWidget()->show();
kMyMoneyEdit* shareEdit = dynamic_cast<kMyMoneyEdit*>(haveWidget("shares"));
shareEdit->show();
shareEdit->setPrecision(MyMoneyMoney::denomToPrec(m_parent->security().smallestAccountFraction()));
@@ -290,7 +290,7 @@ void Sell::showWidgets(void) const
setLabelText("total-label", i18n("Total"));
}
-bool Sell::isComplete(QString& reason) const
+bool Sell::isComplete(TQString& reason) const
{
bool rc = Activity::isComplete(reason);
rc &= haveAssetAccount();
@@ -301,12 +301,12 @@ bool Sell::isComplete(QString& reason) const
return rc;
}
-bool Sell::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList<MyMoneySplit>& feeSplits, QValueList<MyMoneySplit>& m_feeSplits, QValueList<MyMoneySplit>& interestSplits, QValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
+bool Sell::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList<MyMoneySplit>& feeSplits, TQValueList<MyMoneySplit>& m_feeSplits, TQValueList<MyMoneySplit>& interestSplits, TQValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
{
Q_UNUSED(security);
Q_UNUSED(currency);
- QString reason;
+ TQString reason;
if(!isComplete(reason))
return false;
@@ -360,7 +360,7 @@ void Div::showWidgets(void) const
{
KMyMoneyCategory* cat;
cat = dynamic_cast<KMyMoneyCategory*>(haveWidget("interest-account"));
- cat->parentWidget()->show();
+ cat->tqparentWidget()->show();
haveWidget("asset-account")->show();
haveWidget("total")->show();
@@ -370,20 +370,20 @@ void Div::showWidgets(void) const
setLabelText("total-label", i18n("Total"));
}
-bool Div::isComplete(QString& reason) const
+bool Div::isComplete(TQString& reason) const
{
bool rc = haveAssetAccount();
rc &= haveInterest(false);
return rc;
}
-bool Div::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList<MyMoneySplit>& feeSplits, QValueList<MyMoneySplit>& m_feeSplits, QValueList<MyMoneySplit>& interestSplits, QValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
+bool Div::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList<MyMoneySplit>& feeSplits, TQValueList<MyMoneySplit>& m_feeSplits, TQValueList<MyMoneySplit>& interestSplits, TQValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
{
Q_UNUSED(m_feeSplits);
Q_UNUSED(security);
Q_UNUSED(currency);
- QString reason;
+ TQString reason;
if(!isComplete(reason))
return false;
@@ -413,9 +413,9 @@ void Reinvest::showWidgets(void) const
{
KMyMoneyCategory* cat;
cat = dynamic_cast<KMyMoneyCategory*>(haveWidget("interest-account"));
- cat->parentWidget()->show();
+ cat->tqparentWidget()->show();
cat = dynamic_cast<KMyMoneyCategory*>(haveWidget("fee-account"));
- cat->parentWidget()->show();
+ cat->tqparentWidget()->show();
kMyMoneyEdit* shareEdit = dynamic_cast<kMyMoneyEdit*>(haveWidget("shares"));
shareEdit->show();
shareEdit->setPrecision(MyMoneyMoney::denomToPrec(m_parent->security().smallestAccountFraction()));
@@ -429,23 +429,23 @@ void Reinvest::showWidgets(void) const
setLabelText("total-label", i18n("Total"));
}
-bool Reinvest::isComplete(QString& reason) const
+bool Reinvest::isComplete(TQString& reason) const
{
bool rc = Activity::isComplete(reason);
- rc &= haveCategoryAndAmount("interest-account", QString(), false);
+ rc &= haveCategoryAndAmount("interest-account", TQString(), false);
rc &= haveFees(true);
rc &= haveShares();
rc &= havePrice();
return rc;
}
-bool Reinvest::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList<MyMoneySplit>& feeSplits, QValueList<MyMoneySplit>& m_feeSplits, QValueList<MyMoneySplit>& interestSplits, QValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
+bool Reinvest::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList<MyMoneySplit>& feeSplits, TQValueList<MyMoneySplit>& m_feeSplits, TQValueList<MyMoneySplit>& interestSplits, TQValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
{
Q_UNUSED(assetAccountSplit);
Q_UNUSED(security);
Q_UNUSED(currency);
- QString reason;
+ TQString reason;
if(!isComplete(reason))
return false;
@@ -490,7 +490,7 @@ bool Reinvest::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMone
MyMoneySplit& s1 = interestSplits[0];
- MyMoneyMoney total = sumSplits(s0, feeSplits, QValueList<MyMoneySplit>());
+ MyMoneyMoney total = sumSplits(s0, feeSplits, TQValueList<MyMoneySplit>());
s1.setValue(-total);
if(!m_parent->setupPrice(t, s1))
@@ -508,14 +508,14 @@ void Add::showWidgets(void) const
setLabelText("shares-label", i18n("Shares"));
}
-bool Add::isComplete(QString& reason) const
+bool Add::isComplete(TQString& reason) const
{
bool rc = Activity::isComplete(reason);
rc &= haveShares();
return rc;
}
-bool Add::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList<MyMoneySplit>& feeSplits, QValueList<MyMoneySplit>& m_feeSplits, QValueList<MyMoneySplit>& interestSplits, QValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
+bool Add::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList<MyMoneySplit>& feeSplits, TQValueList<MyMoneySplit>& m_feeSplits, TQValueList<MyMoneySplit>& interestSplits, TQValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
{
Q_UNUSED(t);
Q_UNUSED(assetAccountSplit);
@@ -524,7 +524,7 @@ bool Add::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySpli
Q_UNUSED(security);
Q_UNUSED(currency);
- QString reason;
+ TQString reason;
if(!isComplete(reason))
return false;
@@ -549,14 +549,14 @@ void Remove::showWidgets(void) const
setLabelText("shares-label", i18n("Shares"));
}
-bool Remove::isComplete(QString& reason) const
+bool Remove::isComplete(TQString& reason) const
{
bool rc = Activity::isComplete(reason);
rc &= haveShares();
return rc;
}
-bool Remove::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList<MyMoneySplit>& feeSplits, QValueList<MyMoneySplit>& m_feeSplits, QValueList<MyMoneySplit>& interestSplits, QValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
+bool Remove::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList<MyMoneySplit>& feeSplits, TQValueList<MyMoneySplit>& m_feeSplits, TQValueList<MyMoneySplit>& interestSplits, TQValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
{
Q_UNUSED(t);
Q_UNUSED(assetAccountSplit);
@@ -565,7 +565,7 @@ bool Remove::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneyS
Q_UNUSED(security);
Q_UNUSED(currency);
- QString reason;
+ TQString reason;
if(!isComplete(reason))
return false;
@@ -592,14 +592,14 @@ void Split::showWidgets(void) const
setLabelText("shares-label", i18n("Ratio 1/"));
}
-bool Split::isComplete(QString& reason) const
+bool Split::isComplete(TQString& reason) const
{
bool rc = Activity::isComplete(reason);
rc &= haveShares();
return rc;
}
-bool Split::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, QValueList<MyMoneySplit>& feeSplits, QValueList<MyMoneySplit>& m_feeSplits, QValueList<MyMoneySplit>& interestSplits, QValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
+bool Split::createTransaction(MyMoneyTransaction& t, MyMoneySplit& s0, MyMoneySplit& assetAccountSplit, TQValueList<MyMoneySplit>& feeSplits, TQValueList<MyMoneySplit>& m_feeSplits, TQValueList<MyMoneySplit>& interestSplits, TQValueList<MyMoneySplit>& m_interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency)
{
Q_UNUSED(t);
Q_UNUSED(assetAccountSplit);