From fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 5 Jul 2011 06:00:29 +0000 Subject: 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 --- kmymoney2/dialogs/investtransactioneditor.cpp | 254 +++++++++++++------------- 1 file changed, 127 insertions(+), 127 deletions(-) (limited to 'kmymoney2/dialogs/investtransactioneditor.cpp') diff --git a/kmymoney2/dialogs/investtransactioneditor.cpp b/kmymoney2/dialogs/investtransactioneditor.cpp index 5a62436..d235ae5 100644 --- a/kmymoney2/dialogs/investtransactioneditor.cpp +++ b/kmymoney2/dialogs/investtransactioneditor.cpp @@ -20,11 +20,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -64,8 +64,8 @@ class InvestTransactionEditor::Private { friend class Invest::Activity; public: - Private(InvestTransactionEditor* parent) : - m_parent(parent), + Private(InvestTransactionEditor* tqparent) : + m_parent(tqparent), m_activity(0) { m_phonyAccount = MyMoneyAccount("Phony-ID", MyMoneyAccount()); @@ -75,7 +75,7 @@ public: delete m_activity; } - QWidget* haveWidget(const QString& name) { return m_parent->haveWidget(name); } + TQWidget* haveWidget(const TQString& name) { return m_parent->haveWidget(name); } InvestTransactionEditor* m_parent; Activity* m_activity; @@ -94,7 +94,7 @@ InvestTransactionEditor::~InvestTransactionEditor() delete d; } -InvestTransactionEditor::InvestTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::InvestTransaction* item, const KMyMoneyRegister::SelectedTransactions& list, const QDate& lastPostDate) : +InvestTransactionEditor::InvestTransactionEditor(TransactionEditorContainer* regForm, KMyMoneyRegister::InvestTransaction* item, const KMyMoneyRegister::SelectedTransactions& list, const TQDate& lastPostDate) : TransactionEditor(regForm, item, list, lastPostDate), d(new Private(this)) { @@ -143,14 +143,14 @@ void InvestTransactionEditor::activityFactory(MyMoneySplit::investTransactionTyp } } -void InvestTransactionEditor::dissectTransaction(const MyMoneyTransaction& transaction, const MyMoneySplit& split, MyMoneySplit& assetAccountSplit, QValueList& feeSplits, QValueList& interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency, MyMoneySplit::investTransactionTypeE& transactionType) +void InvestTransactionEditor::dissectTransaction(const MyMoneyTransaction& transaction, const MyMoneySplit& split, MyMoneySplit& assetAccountSplit, TQValueList& feeSplits, TQValueList& interestSplits, MyMoneySecurity& security, MyMoneySecurity& currency, MyMoneySplit::investTransactionTypeE& transactionType) { // collect the splits. split references the stock account and should already // be set up. assetAccountSplit references the corresponding asset account (maybe // empty), feeSplits is the list of all expenses and interestSplits // the list of all incomes MyMoneyFile* file = MyMoneyFile::instance(); - QValueList::ConstIterator it_s; + TQValueList::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { MyMoneyAccount acc = file->account((*it_s).accountId()); if((*it_s).id() == split.id()) { @@ -194,45 +194,45 @@ void InvestTransactionEditor::createEditWidgets(void) { KMyMoneyActivityCombo* activity = new KMyMoneyActivityCombo(); m_editWidgets["activity"] = activity; - connect(activity, SIGNAL(activitySelected(MyMoneySplit::investTransactionTypeE)), this, SLOT(slotUpdateActivity(MyMoneySplit::investTransactionTypeE))); - connect(activity, SIGNAL(activitySelected(MyMoneySplit::investTransactionTypeE)), this, SLOT(slotUpdateButtonState())); + connect(activity, TQT_SIGNAL(activitySelected(MyMoneySplit::investTransactionTypeE)), this, TQT_SLOT(slotUpdateActivity(MyMoneySplit::investTransactionTypeE))); + connect(activity, TQT_SIGNAL(activitySelected(MyMoneySplit::investTransactionTypeE)), this, TQT_SLOT(slotUpdateButtonState())); m_editWidgets["postdate"] = new kMyMoneyDateInput; - connect(m_editWidgets["postdate"], SIGNAL(dateChanged(const QDate&)), this, SLOT(slotUpdateButtonState())); + connect(m_editWidgets["postdate"], TQT_SIGNAL(dateChanged(const TQDate&)), this, TQT_SLOT(slotUpdateButtonState())); KMyMoneySecurity* security = new KMyMoneySecurity; security->setHint(i18n("Security")); m_editWidgets["security"] = security; - connect(security, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateSecurity(const QString&))); - connect(security, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(security, SIGNAL(createItem(const QString&, QString&)), this, SLOT(slotCreateSecurity(const QString&, QString&))); - connect(security, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); + connect(security, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateSecurity(const TQString&))); + connect(security, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(security, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SLOT(slotCreateSecurity(const TQString&, TQString&))); + connect(security, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); KMyMoneyCategory* asset = new KMyMoneyCategory(0, 0, false); asset->setHint(i18n("Asset account")); m_editWidgets["asset-account"] = asset; - connect(asset, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(asset, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); + connect(asset, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(asset, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); KMyMoneyCategory* fees = new KMyMoneyCategory(0, 0, true); fees->setHint(i18n("Fees")); m_editWidgets["fee-account"] = fees; - connect(fees, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateFeeCategory(const QString&))); - connect(fees, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(fees, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateFeeVisibility(const QString&))); - connect(fees, SIGNAL(createItem(const QString&, QString&)), this, SLOT(slotCreateFeeCategory(const QString&, QString&))); - connect(fees, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); - connect(fees->splitButton(), SIGNAL(clicked()), this, SLOT(slotEditFeeSplits())); + connect(fees, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateFeeCategory(const TQString&))); + connect(fees, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(fees, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateFeeVisibility(const TQString&))); + connect(fees, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SLOT(slotCreateFeeCategory(const TQString&, TQString&))); + connect(fees, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); + connect(fees->splitButton(), TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditFeeSplits())); KMyMoneyCategory* interest = new KMyMoneyCategory(0, 0, true); interest->setHint(i18n("Interest")); m_editWidgets["interest-account"] = interest; - connect(interest, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateInterestCategory(const QString&))); - connect(interest, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(interest, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateInterestVisibility(const QString&))); - connect(interest, SIGNAL(createItem(const QString&, QString&)), this, SLOT(slotCreateInterestCategory(const QString&, QString&))); - connect(interest, SIGNAL(objectCreation(bool)), this, SIGNAL(objectCreation(bool))); - connect(interest->splitButton(), SIGNAL(clicked()), this, SLOT(slotEditInterestSplits())); + connect(interest, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateInterestCategory(const TQString&))); + connect(interest, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(interest, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateInterestVisibility(const TQString&))); + connect(interest, TQT_SIGNAL(createItem(const TQString&, TQString&)), this, TQT_SLOT(slotCreateInterestCategory(const TQString&, TQString&))); + connect(interest, TQT_SIGNAL(objectCreation(bool)), this, TQT_SIGNAL(objectCreation(bool))); + connect(interest->splitButton(), TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditInterestSplits())); KTextEdit* memo = new KTextEdit; memo->setTabChangesFocus(true); @@ -242,76 +242,76 @@ void InvestTransactionEditor::createEditWidgets(void) value->setHint(i18n("Shares")); value->setResetButtonVisible(false); m_editWidgets["shares"] = value; - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateTotalAmount())); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateTotalAmount())); value = new kMyMoneyEdit; value->setHint(i18n("Price")); value->setResetButtonVisible(false); value->setPrecision(KMyMoneyGlobalSettings::pricePrecision()); m_editWidgets["price"] = value; - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateTotalAmount())); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateTotalAmount())); value = new kMyMoneyEdit; // TODO once we have the selected transactions as array of Transaction // we can allow multiple splits for fee and interest value->setResetButtonVisible(false); m_editWidgets["fee-amount"] = value; - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateTotalAmount())); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateTotalAmount())); value = new kMyMoneyEdit; // TODO once we have the selected transactions as array of Transaction // we can allow multiple splits for fee and interest value->setResetButtonVisible(false); m_editWidgets["interest-amount"] = value; - connect(value, SIGNAL(textChanged(const QString&)), this, SLOT(slotUpdateButtonState())); - connect(value, SIGNAL(valueChanged(const QString&)), this, SLOT(slotUpdateTotalAmount())); + connect(value, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); + connect(value, TQT_SIGNAL(valueChanged(const TQString&)), this, TQT_SLOT(slotUpdateTotalAmount())); KMyMoneyReconcileCombo* reconcile = new KMyMoneyReconcileCombo; m_editWidgets["status"] = reconcile; - connect(reconcile, SIGNAL(itemSelected(const QString&)), this, SLOT(slotUpdateButtonState())); + connect(reconcile, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotUpdateButtonState())); - KMyMoneyRegister::QWidgetContainer::iterator it_w; + KMyMoneyRegister::TQWidgetContainer::iterator it_w; for(it_w = m_editWidgets.begin(); it_w != m_editWidgets.end(); ++it_w) { (*it_w)->installEventFilter(this); } - QLabel* label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::AlignRight | Qt::DontClip); + TQLabel* label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::AlignRight | TQt::DontClip); m_editWidgets["total"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["total-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["asset-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["fee-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["fee-amount-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["interest-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["interest-amount-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["price-label"] = label; - label = new QLabel("", 0); - label->setAlignment(Qt::AlignVCenter | Qt::DontClip); + label = new TQLabel("", 0); + label->tqsetAlignment(TQt::AlignVCenter | TQt::DontClip); m_editWidgets["shares-label"] = label; // if we don't have more than 1 selected transaction, we don't need @@ -323,17 +323,17 @@ void InvestTransactionEditor::createEditWidgets(void) int InvestTransactionEditor::slotEditFeeSplits(void) { - return editSplits("fee-account", "fee-amount", m_feeSplits, false, SLOT(slotEditFeeSplits())); + return editSplits("fee-account", "fee-amount", m_feeSplits, false, TQT_SLOT(slotEditFeeSplits())); } int InvestTransactionEditor::slotEditInterestSplits(void) { - return editSplits("interest-account", "interest-amount", m_interestSplits, true, SLOT(slotEditInterestSplits())); + return editSplits("interest-account", "interest-amount", m_interestSplits, true, TQT_SLOT(slotEditInterestSplits())); } -int InvestTransactionEditor::editSplits(const QString& categoryWidgetName, const QString& amountWidgetName, QValueList& splits, bool isIncome, const char* slotEditSplits) +int InvestTransactionEditor::editSplits(const TQString& categoryWidgetName, const TQString& amountWidgetName, TQValueList& splits, bool isIncome, const char* slotEditSplits) { - int rc = QDialog::Rejected; + int rc = TQDialog::Rejected; if(!m_openEditSplits) { // only get in here in a single instance @@ -341,7 +341,7 @@ int InvestTransactionEditor::editSplits(const QString& categoryWidgetName, const // force focus change to update all data KMyMoneyCategory* category = dynamic_cast(m_editWidgets[categoryWidgetName]); - QWidget* w = category->splitButton(); + TQWidget* w = category->splitButton(); if(w) w->setFocus(); @@ -377,13 +377,13 @@ int InvestTransactionEditor::editSplits(const QString& categoryWidgetName, const 0, m_priceInfo, m_regForm); - // connect(dlg, SIGNAL(newCategory(MyMoneyAccount&)), this, SIGNAL(newCategory(MyMoneyAccount&))); + // connect(dlg, TQT_SIGNAL(newCategory(MyMoneyAccount&)), this, TQT_SIGNAL(newCategory(MyMoneyAccount&))); - if((rc = dlg->exec()) == QDialog::Accepted) { + if((rc = dlg->exec()) == TQDialog::Accepted) { transaction = dlg->transaction(); // collect splits out of the transaction splits.clear(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; MyMoneyMoney fees; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { if((*it_s).accountId() == d->m_phonyAccount.id()) @@ -394,7 +394,7 @@ int InvestTransactionEditor::editSplits(const QString& categoryWidgetName, const if(isIncome) fees = -fees; - QString categoryId; + TQString categoryId; setupCategoryWidget(category, splits, categoryId, slotEditSplits); amount->setValue(fees); slotUpdateTotalAmount(); @@ -413,7 +413,7 @@ int InvestTransactionEditor::editSplits(const QString& categoryWidgetName, const return rc; } -bool InvestTransactionEditor::createPseudoTransaction(MyMoneyTransaction& t, const QValueList& splits) +bool InvestTransactionEditor::createPseudoTransaction(MyMoneyTransaction& t, const TQValueList& splits) { t.removeSplits(); @@ -424,7 +424,7 @@ bool InvestTransactionEditor::createPseudoTransaction(MyMoneyTransaction& t, con t.addSplit(split); d->m_phonySplit = split; - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { split = *it_s; split.clearId(); @@ -433,10 +433,10 @@ bool InvestTransactionEditor::createPseudoTransaction(MyMoneyTransaction& t, con return true; } -void InvestTransactionEditor::slotCreateSecurity(const QString& name, QString& id) +void InvestTransactionEditor::slotCreateSecurity(const TQString& name, TQString& id) { MyMoneyAccount acc; - QRegExp exp("([^:]+)"); + TQRegExp exp("([^:]+)"); if(exp.search(name) != -1) { acc.setName(exp.cap(1)); @@ -451,7 +451,7 @@ void InvestTransactionEditor::slotCreateSecurity(const QString& name, QString& i } } -void InvestTransactionEditor::slotCreateFeeCategory(const QString& name, QString& id) +void InvestTransactionEditor::slotCreateFeeCategory(const TQString& name, TQString& id) { MyMoneyAccount acc; acc.setName(name); @@ -462,28 +462,28 @@ void InvestTransactionEditor::slotCreateFeeCategory(const QString& name, QString id = acc.id(); } -void InvestTransactionEditor::slotUpdateFeeCategory(const QString& id) +void InvestTransactionEditor::slotUpdateFeeCategory(const TQString& id) { haveWidget("fee-amount")->setDisabled(id.isEmpty()); } -void InvestTransactionEditor::slotUpdateFeeVisibility(const QString& txt) +void InvestTransactionEditor::slotUpdateFeeVisibility(const TQString& txt) { haveWidget("fee-amount")->setHidden(txt.isEmpty()); - QWidget* w = haveWidget("fee-amount-label"); + TQWidget* w = haveWidget("fee-amount-label"); if(w) w->setShown(haveWidget("fee-amount")->isVisible()); } -void InvestTransactionEditor::slotUpdateInterestCategory(const QString& id) +void InvestTransactionEditor::slotUpdateInterestCategory(const TQString& id) { haveWidget("interest-amount")->setDisabled(id.isEmpty()); } -void InvestTransactionEditor::slotUpdateInterestVisibility(const QString& txt) +void InvestTransactionEditor::slotUpdateInterestVisibility(const TQString& txt) { KMyMoneyCategory* interest = dynamic_cast(haveWidget("interest-account")); - QWidget* w = haveWidget("interest-amount-label"); + TQWidget* w = haveWidget("interest-amount-label"); if(dynamic_cast(d->m_activity)) { interest->splitButton()->hide(); @@ -501,7 +501,7 @@ void InvestTransactionEditor::slotUpdateInterestVisibility(const QString& txt) w->setShown(haveWidget("interest-amount")->isVisible()); } -void InvestTransactionEditor::slotCreateInterestCategory(const QString& name, QString& id) +void InvestTransactionEditor::slotCreateInterestCategory(const TQString& name, TQString& id) { MyMoneyAccount acc; acc.setName(name); @@ -519,19 +519,19 @@ void InvestTransactionEditor::slotReloadEditWidgets(void) KMyMoneySecurity* security = dynamic_cast(haveWidget("security")); AccountSet aSet; - QString id; + TQString id; // interest-account aSet.clear(); aSet.addAccountGroup(MyMoneyAccount::Income); aSet.load(interest->selector()); - setupCategoryWidget(interest, m_interestSplits, id, SLOT(slotEditInterestSplits())); + setupCategoryWidget(interest, m_interestSplits, id, TQT_SLOT(slotEditInterestSplits())); // fee-account aSet.clear(); aSet.addAccountGroup(MyMoneyAccount::Expense); aSet.load(fees->selector()); - setupCategoryWidget(fees, m_feeSplits, id, SLOT(slotEditFeeSplits())); + setupCategoryWidget(fees, m_feeSplits, id, TQT_SLOT(slotEditFeeSplits())); // security aSet.clear(); @@ -540,7 +540,7 @@ void InvestTransactionEditor::slotReloadEditWidgets(void) void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action */) { - QString id; + TQString id; kMyMoneyDateInput* postDate = dynamic_cast(haveWidget("postdate")); KMyMoneyReconcileCombo* reconcile = dynamic_cast(haveWidget("status")); @@ -554,7 +554,7 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action // check if the current transaction has a reference to an equity account bool haveEquityAccount = false; - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; for(it_s = m_transaction.splits().begin(); !haveEquityAccount && it_s != m_transaction.splits().end(); ++it_s) { MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId()); if(acc.accountType() == MyMoneyAccount::Equity) @@ -586,7 +586,7 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action else if(m_lastPostDate.isValid()) postDate->setDate(m_lastPostDate); else - postDate->setDate(QDate::currentDate()); + postDate->setDate(TQDate::tqcurrentDate()); // security (but only if it's not the investment account) if(m_split.accountId() != m_account.id()) { @@ -605,14 +605,14 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action aSet.clear(); aSet.addAccountGroup(MyMoneyAccount::Income); aSet.load(interest->selector()); - setupCategoryWidget(interest, m_interestSplits, id, SLOT(slotEditInterestSplits())); + setupCategoryWidget(interest, m_interestSplits, id, TQT_SLOT(slotEditInterestSplits())); slotUpdateInterestVisibility(interest->currentText()); // fee-account aSet.clear(); aSet.addAccountGroup(MyMoneyAccount::Expense); aSet.load(fees->selector()); - setupCategoryWidget(fees, m_feeSplits, id, SLOT(slotEditFeeSplits())); + setupCategoryWidget(fees, m_feeSplits, id, TQT_SLOT(slotEditFeeSplits())); slotUpdateFeeVisibility(fees->currentText()); // memo @@ -650,9 +650,9 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action reconcile->setState(m_split.reconcileFlag()); } else { - postDate->loadDate(QDate()); + postDate->loadDate(TQDate()); reconcile->setState(MyMoneySplit::Unknown); - memo->setText(QString()); + memo->setText(TQString()); // We don't allow to change the activity activity->setActivity(d->m_activity->type()); @@ -662,16 +662,16 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action // scan the list of selected transactions and check that they have // the same activity. KMyMoneyRegister::SelectedTransactions::iterator it_t = m_transactions.begin(); - const QString& action = m_item->split().action(); + const TQString& action = m_item->split().action(); bool isNegative = m_item->split().shares().isNegative(); bool allSameActivity = true; for(it_t = m_transactions.begin(); allSameActivity && (it_t != m_transactions.end()); ++it_t) { allSameActivity = (action == (*it_t).split().action() && (*it_t).split().shares().isNegative() == isNegative); } - QStringList fields; + TQStringList fields; fields << "shares" << "price" << "fee-amount" << "interest-amount"; - QStringList::const_iterator it_f; + TQStringList::const_iterator it_f; for(it_f = fields.begin(); it_f != fields.end(); ++it_f) { value = dynamic_cast(haveWidget((*it_f))); value->setText(""); @@ -681,7 +681,7 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action // if we have transactions with different activities, disable some more widgets if(!allSameActivity) { fields << "asset-account" << "fee-account" << "interest-account"; - QStringList::const_iterator it_f; + TQStringList::const_iterator it_f; for(it_f = fields.begin(); it_f != fields.end(); ++it_f) { haveWidget(*it_f)->setDisabled(true); } @@ -689,21 +689,21 @@ void InvestTransactionEditor::loadEditWidgets(KMyMoneyRegister::Action /* action } } -QWidget* InvestTransactionEditor::firstWidget(void) const +TQWidget* InvestTransactionEditor::firstWidget(void) const { return 0; // let the creator use the first widget in the tab order } -bool InvestTransactionEditor::isComplete(QString& reason) const +bool InvestTransactionEditor::isComplete(TQString& reason) const { - reason = QString(); - // reason.clear(); // for Qt4 + reason = TQString(); + // reason.clear(); // for TQt4 return d->m_activity->isComplete(reason); } -MyMoneyMoney InvestTransactionEditor::subtotal(const QValueList& splits) const +MyMoneyMoney InvestTransactionEditor::subtotal(const TQValueList& splits) const { - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; MyMoneyMoney sum; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { @@ -713,7 +713,7 @@ MyMoneyMoney InvestTransactionEditor::subtotal(const QValueList& s return sum; } -void InvestTransactionEditor::slotUpdateSecurity(const QString& stockId) +void InvestTransactionEditor::slotUpdateSecurity(const TQString& stockId) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount stock = file->account(stockId); @@ -785,7 +785,7 @@ void InvestTransactionEditor::totalAmount(MyMoneyMoney& amount) const void InvestTransactionEditor::slotUpdateTotalAmount(void) { - QLabel* total = dynamic_cast(haveWidget("total")); + TQLabel* total = dynamic_cast(haveWidget("total")); if(total && total->isVisible()) { MyMoneyMoney amount; @@ -801,19 +801,19 @@ void InvestTransactionEditor::slotUpdateActivity(MyMoneySplit::investTransaction KMyMoneyCategory* cat; - // hide all dynamic widgets (make sure to use the parentWidget for the + // hide all dynamic widgets (make sure to use the tqparentWidget for the // category widgets) - haveWidget("interest-account")->parentWidget()->hide(); - haveWidget("fee-account")->parentWidget()->hide(); + haveWidget("interest-account")->tqparentWidget()->hide(); + haveWidget("fee-account")->tqparentWidget()->hide(); - QStringList dynwidgets; + TQStringList dynwidgets; dynwidgets << "total-label" << "asset-label" << "fee-label" << "fee-amount-label" << "interest-label" << "interest-amount-label" << "price-label" << "shares-label"; // hiding labels works by clearing them. hide() does not do the job - // as the underlying text in the QTable object will shine through - QStringList::const_iterator it_s; + // as the underlying text in the TQTable object will shine through + TQStringList::const_iterator it_s; for(it_s = dynwidgets.begin(); it_s != dynwidgets.end(); ++it_s) { - QLabel* w = dynamic_cast(haveWidget(*it_s)); + TQLabel* w = dynamic_cast(haveWidget(*it_s)); if(w) w->setText(" "); } @@ -823,7 +823,7 @@ void InvestTransactionEditor::slotUpdateActivity(MyMoneySplit::investTransaction dynwidgets << "asset-account" << "interest-amount" << "fee-amount" << "shares" << "price" << "total"; for(it_s = dynwidgets.begin(); it_s != dynwidgets.end(); ++it_s) { - QWidget* w = haveWidget(*it_s); + TQWidget* w = haveWidget(*it_s); if(w) w->hide(); } @@ -833,11 +833,11 @@ void InvestTransactionEditor::slotUpdateActivity(MyMoneySplit::investTransaction d->m_activity->preloadAssetAccount(); cat = dynamic_cast(haveWidget("interest-account")); - if(cat->parentWidget()->isVisible()) + if(cat->tqparentWidget()->isVisible()) slotUpdateInterestVisibility(cat->currentText()); cat = dynamic_cast(haveWidget("fee-account")); - if(cat->parentWidget()->isVisible()) + if(cat->tqparentWidget()->isVisible()) slotUpdateFeeVisibility(cat->currentText()); } @@ -845,7 +845,7 @@ InvestTransactionEditor::priceModeE InvestTransactionEditor::priceMode(void) con { priceModeE mode = static_cast(0); KMyMoneySecurity* sec = dynamic_cast(m_editWidgets["security"]); - QString accId; + TQString accId; if(!sec->currentText().isEmpty()) { accId = sec->selectedItem(); if(accId.isEmpty()) @@ -854,7 +854,7 @@ InvestTransactionEditor::priceModeE InvestTransactionEditor::priceMode(void) con while(!accId.isEmpty() && mode == 0) { MyMoneyAccount acc = MyMoneyFile::instance()->account(accId); if(acc.value("priceMode").isEmpty()) - accId = acc.parentAccountId(); + accId = acc.tqparentAccountId(); else mode = static_cast(acc.value("priceMode").toInt()); } @@ -873,9 +873,9 @@ bool InvestTransactionEditor::setupPrice(const MyMoneyTransaction& t, MyMoneySpl int fract = acc.fraction(); if(acc.currencyId() != t.commodity()) { - QMap::Iterator it_p; - QString key = t.commodity() + "-" + acc.currencyId(); - it_p = m_priceInfo.find(key); + TQMap::Iterator it_p; + TQString key = t.commodity() + "-" + acc.currencyId(); + it_p = m_priceInfo.tqfind(key); // if it's not found, then collect it from the user first MyMoneyMoney price; @@ -895,7 +895,7 @@ bool InvestTransactionEditor::setupPrice(const MyMoneyTransaction& t, MyMoneySpl fract, m_regForm, "currencyCalculator"); - if(calc.exec() == QDialog::Rejected) { + if(calc.exec() == TQDialog::Rejected) { return false; } price = calc.price(); @@ -924,11 +924,11 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM KMyMoneySecurity* sec = dynamic_cast(m_editWidgets["security"]); if(!isMultiSelection() || (isMultiSelection() && !sec->currentText().isEmpty())) { - QString securityId = sec->selectedItem(); + TQString securityId = sec->selectedItem(); if(!securityId.isEmpty()) { s0.setAccountId(securityId); MyMoneyAccount stockAccount = file->account(securityId); - QString currencyId = stockAccount.currencyId(); + TQString currencyId = stockAccount.currencyId(); MyMoneySecurity security = file->security(currencyId); t.setCommodity(security.tradingCurrency()); @@ -940,7 +940,7 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM // extract price info from original transaction m_priceInfo.clear(); - QValueList::const_iterator it_s; + TQValueList::const_iterator it_s; if(!torig.id().isEmpty()) { for(it_s = torig.splits().begin(); it_s != torig.splits().end(); ++it_s) { if((*it_s).id() != sorig.id()) { @@ -973,8 +973,8 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM } MyMoneySplit assetAccountSplit; - QValueList feeSplits; - QValueList interestSplits; + TQValueList feeSplits; + TQValueList interestSplits; MyMoneySecurity security, currency; MyMoneySplit::investTransactionTypeE transactionType; @@ -1014,7 +1014,7 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM s0.setReconcileFlag(status->state()); if(s0.reconcileFlag() == MyMoneySplit::Reconciled && !s0.reconcileDate().isValid()) - s0.setReconcileDate(QDate::currentDate()); + s0.setReconcileDate(TQDate::tqcurrentDate()); // call the creation logic for the current selected activity bool rc = d->m_activity->createTransaction(t, s0, assetAccountSplit, feeSplits, m_feeSplits, interestSplits, m_interestSplits, security, currency); @@ -1032,7 +1032,7 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM t.addSplit(s0); - QValueList::iterator it_s; + TQValueList::iterator it_s; for(it_s = feeSplits.begin(); it_s != feeSplits.end(); ++it_s) { (*it_s).clearId(); t.addSplit(*it_s); @@ -1057,7 +1057,7 @@ bool InvestTransactionEditor::createTransaction(MyMoneyTransaction& t, const MyM void InvestTransactionEditor::updatePriceMode(const MyMoneySplit& split) { - QLabel* label = dynamic_cast(haveWidget("price-label")); + TQLabel* label = dynamic_cast(haveWidget("price-label")); if(label) { kMyMoneyEdit* sharesEdit = dynamic_cast(haveWidget("shares")); kMyMoneyEdit* priceEdit = dynamic_cast(haveWidget("price")); -- cgit v1.2.1