summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/kmymoneycombo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/widgets/kmymoneycombo.cpp')
-rw-r--r--kmymoney2/widgets/kmymoneycombo.cpp278
1 files changed, 139 insertions, 139 deletions
diff --git a/kmymoney2/widgets/kmymoneycombo.cpp b/kmymoney2/widgets/kmymoneycombo.cpp
index 8bbec10..387929f 100644
--- a/kmymoney2/widgets/kmymoneycombo.cpp
+++ b/kmymoney2/widgets/kmymoneycombo.cpp
@@ -18,10 +18,10 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qrect.h>
-#include <qstyle.h>
-#include <qpainter.h>
-#include <qapplication.h>
+#include <tqrect.h>
+#include <tqstyle.h>
+#include <tqpainter.h>
+#include <tqapplication.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -43,7 +43,7 @@
#include <kmymoney/mymoneyscheduled.h>
#include "../kmymoneyutils.h"
-KMyMoneyCombo::KMyMoneyCombo(QWidget *w, const char *name) :
+KMyMoneyCombo::KMyMoneyCombo(TQWidget *w, const char *name) :
KComboBox(w, name),
m_completion(0),
m_edit(0),
@@ -52,7 +52,7 @@ KMyMoneyCombo::KMyMoneyCombo(QWidget *w, const char *name) :
{
}
-KMyMoneyCombo::KMyMoneyCombo(bool rw, QWidget *w, const char *name) :
+KMyMoneyCombo::KMyMoneyCombo(bool rw, TQWidget *w, const char *name) :
KComboBox(rw, w, name),
m_completion(0),
m_edit(0),
@@ -65,17 +65,17 @@ KMyMoneyCombo::KMyMoneyCombo(bool rw, QWidget *w, const char *name) :
}
}
-void KMyMoneyCombo::setCurrentTextById(const QString& id)
+void KMyMoneyCombo::setCurrentTextById(const TQString& id)
{
setCurrentText();
if(!id.isEmpty()) {
- QListViewItem* item = selector()->item(id);
+ TQListViewItem* item = selector()->item(id);
if(item)
setCurrentText(item->text(0));
}
}
-void KMyMoneyCombo::slotItemSelected(const QString& id)
+void KMyMoneyCombo::slotItemSelected(const TQString& id)
{
if(editable()) {
bool blocked = signalsBlocked();
@@ -110,37 +110,37 @@ void KMyMoneyCombo::setEditable(bool y)
}
}
-void KMyMoneyCombo::setHint(const QString& hint) const
+void KMyMoneyCombo::setHint(const TQString& hint) const
{
if(m_edit)
m_edit->setHint(hint);
}
-void KMyMoneyCombo::paintEvent(QPaintEvent* ev)
+void KMyMoneyCombo::paintEvent(TQPaintEvent* ev)
{
KComboBox::paintEvent(ev);
// if we don't have an edit field, we need to paint the text onto the button
if(!m_edit) {
if(m_completion) {
- QStringList list;
+ TQStringList list;
selector()->selectedItems(list);
if(!list.isEmpty()) {
- QString str = selector()->item(list[0])->text(0);
+ TQString str = selector()->item(list[0])->text(0);
// we only paint, if the text is longer than 1 char. Assumption
// is that length 1 is the blank case so no need to do painting
if(str.length() > 1) {
- QPainter p( this );
- const QColorGroup & g = colorGroup();
+ TQPainter p( this );
+ const TQColorGroup & g = tqcolorGroup();
p.setPen(g.text());
- QRect re = style().querySubControlMetrics( QStyle::CC_ComboBox, this,
- QStyle::SC_ComboBoxEditField );
- re = QStyle::visualRect(re, this);
+ TQRect re = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this,
+ TQStyle::SC_ComboBoxEditField );
+ re = TQStyle::tqvisualRect(re, this);
p.setClipRect( re );
p.save();
p.setFont(font());
- QFontMetrics fm(font());
+ TQFontMetrics fm(font());
int x = re.x(), y = re.y() + fm.ascent();
p.drawText( x, y, str );
p.restore();
@@ -150,7 +150,7 @@ void KMyMoneyCombo::paintEvent(QPaintEvent* ev)
}
}
-void KMyMoneyCombo::setPaletteBackgroundColor(const QColor& color)
+void KMyMoneyCombo::setPaletteBackgroundColor(const TQColor& color)
{
KComboBox::setPaletteBackgroundColor(color);
if(m_edit) {
@@ -158,10 +158,10 @@ void KMyMoneyCombo::setPaletteBackgroundColor(const QColor& color)
}
}
-void KMyMoneyCombo::mousePressEvent(QMouseEvent *e)
+void KMyMoneyCombo::mousePressEvent(TQMouseEvent *e)
{
- // mostly copied from QCombo::mousePressEvent() and adjusted for our needs
- if(e->button() != LeftButton)
+ // mostly copied from TQCombo::mousePressEvent() and adjusted for our needs
+ if(e->button() != Qt::LeftButton)
return;
if(((!editable() || isInArrowArea(mapToGlobal(e->pos()))) && selector()->itemList().count()) && !m_completion->isVisible()) {
@@ -178,24 +178,24 @@ void KMyMoneyCombo::mousePressEvent(QMouseEvent *e)
}
}
-bool KMyMoneyCombo::isInArrowArea(const QPoint& pos) const
+bool KMyMoneyCombo::isInArrowArea(const TQPoint& pos) const
{
- QRect arrowRect = style().querySubControlMetrics( QStyle::CC_ComboBox, this,
- QStyle::SC_ComboBoxArrow);
- arrowRect = QStyle::visualRect(arrowRect, this);
+ TQRect arrowRect = tqstyle().querySubControlMetrics( TQStyle::CC_ComboBox, this,
+ TQStyle::SC_ComboBoxArrow);
+ arrowRect = TQStyle::tqvisualRect(arrowRect, this);
// Correction for motif style, where arrow is smaller
// and thus has a rect that doesn't fit the button.
- arrowRect.setHeight( QMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) );
+ arrowRect.setHeight( TQMAX( height() - (2 * arrowRect.y()), arrowRect.height() ) );
// if the button is not editable, it covers the whole widget
if(!editable())
arrowRect = rect();
- return arrowRect.contains(mapFromGlobal(pos));
+ return arrowRect.tqcontains(mapFromGlobal(pos));
}
-void KMyMoneyCombo::keyPressEvent(QKeyEvent* e)
+void KMyMoneyCombo::keyPressEvent(TQKeyEvent* e)
{
if((e->key() == Key_F4 && e->state() == 0 ) ||
(e->key() == Key_Down && (e->state() & AltButton)) ||
@@ -211,19 +211,19 @@ void KMyMoneyCombo::keyPressEvent(QKeyEvent* e)
void KMyMoneyCombo::connectNotify(const char* signal)
{
- if(signal && !strcmp(signal, SIGNAL(createItem(const QString&,QString&)))) {
+ if(signal && !strcmp(signal, TQT_SIGNAL(createItem(const TQString&,TQString&)))) {
m_canCreateObjects = true;
}
}
void KMyMoneyCombo::disconnectNotify(const char* signal)
{
- if(signal && !strcmp(signal, SIGNAL(createItem(const QString&,QString&)))) {
+ if(signal && !strcmp(signal, TQT_SIGNAL(createItem(const TQString&,TQString&)))) {
m_canCreateObjects = false;
}
}
-void KMyMoneyCombo::focusOutEvent(QFocusEvent* e)
+void KMyMoneyCombo::focusOutEvent(TQFocusEvent* e)
{
if(m_inFocusOutEvent) {
KComboBox::focusOutEvent(e);
@@ -233,8 +233,8 @@ void KMyMoneyCombo::focusOutEvent(QFocusEvent* e)
m_inFocusOutEvent = true;
if(editable() && !currentText().isEmpty()) {
if(m_canCreateObjects) {
- if(!m_completion->selector()->contains(currentText())) {
- QString id;
+ if(!m_completion->selector()->tqcontains(currentText())) {
+ TQString id;
// annouce that we go into a possible dialog to create an object
// This can be used by upstream widgets to disable filters etc.
emit objectCreation(true);
@@ -254,8 +254,8 @@ void KMyMoneyCombo::focusOutEvent(QFocusEvent* e)
// else if we cannot create objects, and the current text is not
// in the list, then we clear the text and the selection.
- } else if(!m_completion->selector()->contains(currentText())) {
- setCurrentText(QString());
+ } else if(!m_completion->selector()->tqcontains(currentText())) {
+ setCurrentText(TQString());
}
}
@@ -263,11 +263,11 @@ void KMyMoneyCombo::focusOutEvent(QFocusEvent* e)
// force update of hint and id if there is no text in the widget
if(editable() && currentText().isEmpty()) {
- QString id = m_id;
- m_id = QString();
+ TQString id = m_id;
+ m_id = TQString();
if(!id.isEmpty())
emit itemSelected(m_id);
- repaint();
+ tqrepaint();
}
m_inFocusOutEvent = false;
}
@@ -282,12 +282,12 @@ kMyMoneyCompletion* KMyMoneyCombo::completion(void) const
return m_completion;
}
-void KMyMoneyCombo::selectedItem(QString& id) const
+void KMyMoneyCombo::selectedItem(TQString& id) const
{
id = m_id;
}
-void KMyMoneyCombo::selectedItems(QStringList& list) const
+void KMyMoneyCombo::selectedItems(TQStringList& list) const
{
if(lineEdit() && lineEdit()->text().length() == 0) {
list.clear();
@@ -296,7 +296,7 @@ void KMyMoneyCombo::selectedItems(QStringList& list) const
}
}
-void KMyMoneyCombo::setSelectedItem(const QString& id)
+void KMyMoneyCombo::setSelectedItem(const TQString& id)
{
m_completion->selector()->setSelected(id, true);
blockSignals(true);
@@ -305,54 +305,54 @@ void KMyMoneyCombo::setSelectedItem(const QString& id)
update();
}
-QSize KMyMoneyCombo::sizeHint() const
+TQSize KMyMoneyCombo::tqsizeHint() const
{
- return KComboBox::sizeHint();
+ return KComboBox::tqsizeHint();
// I wanted to use the code below to adjust the size of the combo box
- // according to the largest item in the selector list. Apparently that
+ // according to the largest item in the selector list. Aptqparently that
// does not work too well in the enter and edit schedule dialog for
// the category combo box. So we just use the standard implementation for now.
#if 0
constPolish();
int i, w;
- QFontMetrics fm = fontMetrics();
+ TQFontMetrics fm = fontMetrics();
- int maxW = count() ? 18 : 7 * fm.width(QChar('x')) + 18;
- int maxH = QMAX( fm.lineSpacing(), 14 ) + 2;
+ int maxW = count() ? 18 : 7 * fm.width(TQChar('x')) + 18;
+ int maxH = TQMAX( fm.lineSpacing(), 14 ) + 2;
w = selector()->optimizedWidth();
if ( w > maxW )
maxW = w;
- QSize sizeHint = (style().sizeFromContents(QStyle::CT_ComboBox, this,
- QSize(maxW, maxH)).
- expandedTo(QApplication::globalStrut()));
+ TQSize tqsizeHint = (style().sizeFromContents(TQStyle::CT_ComboBox, this,
+ TQSize(maxW, maxH)).
+ expandedTo(TQApplication::globalStrut()));
- return sizeHint;
+ return tqsizeHint;
#endif
}
-KMyMoneyReconcileCombo::KMyMoneyReconcileCombo(QWidget* w, const char* name) :
+KMyMoneyReconcileCombo::KMyMoneyReconcileCombo(TQWidget* w, const char* name) :
KMyMoneyCombo(false, w, name)
{
m_completion = new kMyMoneyCompletion(this, 0);
- // connect(m_completion, SIGNAL(itemSelected(const QString&)), this, SIGNAL(itemSelected(const QString&)));
+ // connect(m_completion, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SIGNAL(itemSelected(const TQString&)));
// add the items in reverse order of appearance (see KMyMoneySelector::newItem() for details)
- // selector()->newTopItem(i18n("Frozen"), QString(), "F");
- selector()->newTopItem(i18n("Reconciled"), QString(), "R");
- selector()->newTopItem(i18n("Cleared"), QString(), "C");
- selector()->newTopItem(i18n("Not reconciled"), QString(), " ");
- selector()->newTopItem(" ", QString(), "U");
+ // selector()->newTopItem(i18n("Frozen"), TQString(), "F");
+ selector()->newTopItem(i18n("Reconciled"), TQString(), "R");
+ selector()->newTopItem(i18n("Cleared"), TQString(), "C");
+ selector()->newTopItem(i18n("Not reconciled"), TQString(), " ");
+ selector()->newTopItem(" ", TQString(), "U");
- connect(m_completion, SIGNAL(itemSelected(const QString&)), this, SLOT(slotItemSelected(const QString&)));
- connect(this, SIGNAL(itemSelected(const QString&)), this, SLOT(slotSetState(const QString&)));
+ connect(m_completion, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotItemSelected(const TQString&)));
+ connect(this, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotSetState(const TQString&)));
}
-void KMyMoneyReconcileCombo::slotSetState(const QString& state)
+void KMyMoneyReconcileCombo::slotSetState(const TQString& state)
{
setSelectedItem(state);
}
@@ -364,7 +364,7 @@ void KMyMoneyReconcileCombo::removeDontCare(void)
void KMyMoneyReconcileCombo::setState(MyMoneySplit::reconcileFlagE state)
{
- QString id;
+ TQString id;
switch(state) {
case MyMoneySplit::NotReconciled:
id = " ";
@@ -392,7 +392,7 @@ MyMoneySplit::reconcileFlagE KMyMoneyReconcileCombo::state(void) const
{
MyMoneySplit::reconcileFlagE state = MyMoneySplit::NotReconciled;
- QStringList list;
+ TQStringList list;
selector()->selectedItems(list);
if(!list.isEmpty()) {
if(list[0] == "C")
@@ -408,28 +408,28 @@ MyMoneySplit::reconcileFlagE KMyMoneyReconcileCombo::state(void) const
}
-KMyMoneyComboAction::KMyMoneyComboAction(QWidget* w, const char* name) :
+KMyMoneyComboAction::KMyMoneyComboAction(TQWidget* w, const char* name) :
KMyMoneyCombo(false, w, name)
{
m_completion = new kMyMoneyCompletion(this, 0);
- QString num;
+ TQString num;
// add the items in reverse order of appearance (see KMyMoneySelector::newItem() for details)
- selector()->newTopItem(i18n("ATM"), QString(), num.setNum(KMyMoneyRegister::ActionAtm));
- selector()->newTopItem(i18n("Withdrawal"), QString(), num.setNum(KMyMoneyRegister::ActionWithdrawal));
- selector()->newTopItem(i18n("Transfer"), QString(), num.setNum(KMyMoneyRegister::ActionTransfer));
- selector()->newTopItem(i18n("Deposit"), QString(), num.setNum(KMyMoneyRegister::ActionDeposit));
- selector()->newTopItem(i18n("Cheque"), QString(), num.setNum(KMyMoneyRegister::ActionCheck));
- connect(m_completion, SIGNAL(itemSelected(const QString&)), this, SLOT(slotItemSelected(const QString&)));
- connect(this, SIGNAL(itemSelected(const QString&)), this, SLOT(slotSetAction(const QString&)));
+ selector()->newTopItem(i18n("ATM"), TQString(), num.setNum(KMyMoneyRegister::ActionAtm));
+ selector()->newTopItem(i18n("Withdrawal"), TQString(), num.setNum(KMyMoneyRegister::ActionWithdrawal));
+ selector()->newTopItem(i18n("Transfer"), TQString(), num.setNum(KMyMoneyRegister::ActionTransfer));
+ selector()->newTopItem(i18n("Deposit"), TQString(), num.setNum(KMyMoneyRegister::ActionDeposit));
+ selector()->newTopItem(i18n("Cheque"), TQString(), num.setNum(KMyMoneyRegister::ActionCheck));
+ connect(m_completion, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotItemSelected(const TQString&)));
+ connect(this, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotSetAction(const TQString&)));
}
void KMyMoneyComboAction::protectItem(int id, bool protect)
{
- QString num;
+ TQString num;
selector()->protectItem(num.setNum(id), protect);
}
-void KMyMoneyComboAction::slotSetAction(const QString& act)
+void KMyMoneyComboAction::slotSetAction(const TQString& act)
{
setSelectedItem(act);
update();
@@ -442,14 +442,14 @@ void KMyMoneyComboAction::setAction(int action)
kdDebug(2) << "KMyMoneyComboAction::slotSetAction(" << action << ") invalid. Replaced with 2\n";
action = 2;
}
- QString act;
+ TQString act;
act.setNum(action);
setSelectedItem(act);
}
int KMyMoneyComboAction::action(void) const
{
- QStringList list;
+ TQStringList list;
selector()->selectedItems(list);
if(!list.isEmpty()) {
return list[0].toInt();
@@ -458,35 +458,35 @@ int KMyMoneyComboAction::action(void) const
return 0;
}
-KMyMoneyCashFlowCombo::KMyMoneyCashFlowCombo(QWidget* w, const char* name, MyMoneyAccount::accountTypeE accountType) :
+KMyMoneyCashFlowCombo::KMyMoneyCashFlowCombo(TQWidget* w, const char* name, MyMoneyAccount::accountTypeE accountType) :
KMyMoneyCombo(false, w, name)
{
m_completion = new kMyMoneyCompletion(this, 0);
- QString num;
+ TQString num;
// add the items in reverse order of appearance (see KMyMoneySelector::newItem() for details)
if(accountType == MyMoneyAccount::Income || accountType == MyMoneyAccount::Expense) {
// this is used for income/expense accounts to just show the reverse sense
- selector()->newTopItem(i18n("Activity for expense categories", "Paid"), QString(), num.setNum(KMyMoneyRegister::Deposit));
- selector()->newTopItem(i18n("Activity for income categories", "Received"), QString(), num.setNum(KMyMoneyRegister::Payment));
+ selector()->newTopItem(i18n("Activity for expense categories", "Paid"), TQString(), num.setNum(KMyMoneyRegister::Deposit));
+ selector()->newTopItem(i18n("Activity for income categories", "Received"), TQString(), num.setNum(KMyMoneyRegister::Payment));
} else {
- selector()->newTopItem(i18n("From"), QString(), num.setNum(KMyMoneyRegister::Deposit));
- selector()->newTopItem(i18n("Pay to"), QString(), num.setNum(KMyMoneyRegister::Payment));
+ selector()->newTopItem(i18n("From"), TQString(), num.setNum(KMyMoneyRegister::Deposit));
+ selector()->newTopItem(i18n("Pay to"), TQString(), num.setNum(KMyMoneyRegister::Payment));
}
- selector()->newTopItem(" ", QString(), num.setNum(KMyMoneyRegister::Unknown));
- connect(m_completion, SIGNAL(itemSelected(const QString&)), this, SLOT(slotItemSelected(const QString&)));
- connect(this, SIGNAL(itemSelected(const QString&)), this, SLOT(slotSetDirection(const QString&)));
+ selector()->newTopItem(" ", TQString(), num.setNum(KMyMoneyRegister::Unknown));
+ connect(m_completion, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotItemSelected(const TQString&)));
+ connect(this, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotSetDirection(const TQString&)));
}
void KMyMoneyCashFlowCombo::setDirection(KMyMoneyRegister::CashFlowDirection dir)
{
m_dir = dir;
- QString num;
+ TQString num;
setSelectedItem(num.setNum(dir));
}
-void KMyMoneyCashFlowCombo::slotSetDirection(const QString& id)
+void KMyMoneyCashFlowCombo::slotSetDirection(const TQString& id)
{
- QString num;
+ TQString num;
for(int i = KMyMoneyRegister::Deposit; i <= KMyMoneyRegister::Unknown; ++i) {
num.setNum(i);
if(num == id) {
@@ -500,41 +500,41 @@ void KMyMoneyCashFlowCombo::slotSetDirection(const QString& id)
void KMyMoneyCashFlowCombo::removeDontCare(void)
{
- QString num;
+ TQString num;
selector()->removeItem(num.setNum(KMyMoneyRegister::Unknown));
}
-KMyMoneyActivityCombo::KMyMoneyActivityCombo(QWidget* w, const char* name) :
+KMyMoneyActivityCombo::KMyMoneyActivityCombo(TQWidget* w, const char* name) :
KMyMoneyCombo(false, w, name),
m_activity(MyMoneySplit::UnknownTransactionType)
{
m_completion = new kMyMoneyCompletion(this, 0);
- QString num;
+ TQString num;
// add the items in reverse order of appearance (see KMyMoneySelector::newItem() for details)
- selector()->newTopItem(i18n("Split shares"), QString(), num.setNum(MyMoneySplit::SplitShares));
- selector()->newTopItem(i18n("Remove shares"), QString(), num.setNum(MyMoneySplit::RemoveShares));
- selector()->newTopItem(i18n("Add shares"), QString(), num.setNum(MyMoneySplit::AddShares));
- selector()->newTopItem(i18n("Yield"), QString(), num.setNum(MyMoneySplit::Yield));
- selector()->newTopItem(i18n("Reinvest dividend"), QString(), num.setNum(MyMoneySplit::ReinvestDividend));
- selector()->newTopItem(i18n("Dividend"), QString(), num.setNum(MyMoneySplit::Dividend));
- selector()->newTopItem(i18n("Sell shares"), QString(), num.setNum(MyMoneySplit::SellShares));
- selector()->newTopItem(i18n("Buy shares"), QString(), num.setNum(MyMoneySplit::BuyShares));
+ selector()->newTopItem(i18n("Split shares"), TQString(), num.setNum(MyMoneySplit::SplitShares));
+ selector()->newTopItem(i18n("Remove shares"), TQString(), num.setNum(MyMoneySplit::RemoveShares));
+ selector()->newTopItem(i18n("Add shares"), TQString(), num.setNum(MyMoneySplit::AddShares));
+ selector()->newTopItem(i18n("Yield"), TQString(), num.setNum(MyMoneySplit::Yield));
+ selector()->newTopItem(i18n("Reinvest dividend"), TQString(), num.setNum(MyMoneySplit::ReinvestDividend));
+ selector()->newTopItem(i18n("Dividend"), TQString(), num.setNum(MyMoneySplit::Dividend));
+ selector()->newTopItem(i18n("Sell shares"), TQString(), num.setNum(MyMoneySplit::SellShares));
+ selector()->newTopItem(i18n("Buy shares"), TQString(), num.setNum(MyMoneySplit::BuyShares));
- connect(m_completion, SIGNAL(itemSelected(const QString&)), this, SLOT(slotItemSelected(const QString&)));
- connect(this, SIGNAL(itemSelected(const QString&)), this, SLOT(slotSetActivity(const QString&)));
+ connect(m_completion, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotItemSelected(const TQString&)));
+ connect(this, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotSetActivity(const TQString&)));
}
void KMyMoneyActivityCombo::setActivity(MyMoneySplit::investTransactionTypeE activity)
{
m_activity = activity;
- QString num;
+ TQString num;
setSelectedItem(num.setNum(activity));
}
-void KMyMoneyActivityCombo::slotSetActivity(const QString& id)
+void KMyMoneyActivityCombo::slotSetActivity(const TQString& id)
{
- QString num;
+ TQString num;
for(int i = MyMoneySplit::BuyShares; i <= MyMoneySplit::SplitShares; ++i) {
num.setNum(i);
if(num == id) {
@@ -546,57 +546,57 @@ void KMyMoneyActivityCombo::slotSetActivity(const QString& id)
update();
}
-KMyMoneyPayeeCombo::KMyMoneyPayeeCombo(QWidget* parent, const char * name) :
- KMyMoneyCombo(true, parent, name)
+KMyMoneyPayeeCombo::KMyMoneyPayeeCombo(TQWidget* tqparent, const char * name) :
+ KMyMoneyCombo(true, tqparent, name)
{
m_completion = new kMyMoneyCompletion(this);
// set to ascending sort
selector()->listView()->setSorting(0);
- connect(m_completion, SIGNAL(itemSelected(const QString&)), this, SLOT(slotItemSelected(const QString&)));
- connect(this, SIGNAL(textChanged(const QString&)), m_completion, SLOT(slotMakeCompletion(const QString&)));
+ connect(m_completion, TQT_SIGNAL(itemSelected(const TQString&)), this, TQT_SLOT(slotItemSelected(const TQString&)));
+ connect(this, TQT_SIGNAL(textChanged(const TQString&)), m_completion, TQT_SLOT(slotMakeCompletion(const TQString&)));
}
-void KMyMoneyPayeeCombo::loadPayees(const QValueList<MyMoneyPayee>& list)
+void KMyMoneyPayeeCombo::loadPayees(const TQValueList<MyMoneyPayee>& list)
{
selector()->listView()->clear();
- QValueList<MyMoneyPayee>::const_iterator it;
+ TQValueList<MyMoneyPayee>::const_iterator it;
for(it = list.begin(); it != list.end(); ++it) {
- selector()->newTopItem((*it).name(), QString(), (*it).id());
+ selector()->newTopItem((*it).name(), TQString(), (*it).id());
}
}
class KMyMoneyGeneralCombo::Private {
public:
- QMap<QString, int> m_strings;
- void insertItem(const QString& s, int id) { m_strings[s] = id; }
+ TQMap<TQString, int> m_strings;
+ void insertItem(const TQString& s, int id) { m_strings[s] = id; }
- int itemId(const QString& s) const {
- QMap<QString, int>::const_iterator it;
- it = m_strings.find(s);
+ int itemId(const TQString& s) const {
+ TQMap<TQString, int>::const_iterator it;
+ it = m_strings.tqfind(s);
if(it != m_strings.end())
return *it;
return -1;
}
- const QString& itemText(int id) {
- QMap<QString, int>::const_iterator it;
+ const TQString& itemText(int id) {
+ TQMap<TQString, int>::const_iterator it;
for(it = m_strings.begin(); it != m_strings.end(); ++it) {
if(*it == id) {
return it.key();
}
}
- return QString::null;
+ return TQString();
}
};
-KMyMoneyGeneralCombo::KMyMoneyGeneralCombo(QWidget* w, const char* name) :
+KMyMoneyGeneralCombo::KMyMoneyGeneralCombo(TQWidget* w, const char* name) :
KComboBox(w, name),
d(new Private)
{
- connect(this, SIGNAL(highlighted(int)), this, SLOT(slotChangeItem(int)));
+ connect(this, TQT_SIGNAL(highlighted(int)), this, TQT_SLOT(slotChangeItem(int)));
}
KMyMoneyGeneralCombo::~KMyMoneyGeneralCombo()
@@ -616,7 +616,7 @@ int KMyMoneyGeneralCombo::item(void) const
void KMyMoneyGeneralCombo::setCurrentItem(int id)
{
- const QString& txt = d->itemText(id);
+ const TQString& txt = d->itemText(id);
for(int idx = 0; idx < count(); ++idx) {
if(txt == text(idx)) {
KComboBox::setCurrentItem(idx);
@@ -636,7 +636,7 @@ void KMyMoneyGeneralCombo::clear(void)
KComboBox::clear();
}
-void KMyMoneyGeneralCombo::insertItem(const QString& txt, int id, int idx)
+void KMyMoneyGeneralCombo::insertItem(const TQString& txt, int id, int idx)
{
d->insertItem(txt, id);
KComboBox::insertItem(txt, idx);
@@ -644,7 +644,7 @@ void KMyMoneyGeneralCombo::insertItem(const QString& txt, int id, int idx)
void KMyMoneyGeneralCombo::removeItem(int id)
{
- const QString& txt = d->itemText(id);
+ const TQString& txt = d->itemText(id);
for(int idx = 0; idx < count(); ++idx) {
if(txt == text(idx)) {
KComboBox::removeItem(idx);
@@ -658,8 +658,8 @@ void KMyMoneyGeneralCombo::slotChangeItem(int idx)
emit itemSelected(d->itemId(text(idx)));
}
-KMyMoneyPeriodCombo::KMyMoneyPeriodCombo(QWidget* parent, const char* name) :
- KMyMoneyGeneralCombo(parent, name)
+KMyMoneyPeriodCombo::KMyMoneyPeriodCombo(TQWidget* tqparent, const char* name) :
+ KMyMoneyGeneralCombo(tqparent, name)
{
insertItem(i18n("All dates"), MyMoneyTransactionFilter::allDates);
insertItem(i18n("As of today"), MyMoneyTransactionFilter::asOfToday);
@@ -704,28 +704,28 @@ MyMoneyTransactionFilter::dateOptionE KMyMoneyPeriodCombo::currentItem(void) con
return static_cast<MyMoneyTransactionFilter::dateOptionE>(KMyMoneyGeneralCombo::currentItem());
}
-QDate KMyMoneyPeriodCombo::start(MyMoneyTransactionFilter::dateOptionE id)
+TQDate KMyMoneyPeriodCombo::start(MyMoneyTransactionFilter::dateOptionE id)
{
- QDate start, end;
+ TQDate start, end;
MyMoneyTransactionFilter::translateDateRange(id, start, end);
return start;
}
-QDate KMyMoneyPeriodCombo::end(MyMoneyTransactionFilter::dateOptionE id)
+TQDate KMyMoneyPeriodCombo::end(MyMoneyTransactionFilter::dateOptionE id)
{
- QDate start, end;
+ TQDate start, end;
MyMoneyTransactionFilter::translateDateRange(id, start, end);
return end;
}
#if 0
-void KMyMoneyPeriodCombo::dates(QDate& start, QDate& end, MyMoneyTransactionFilter::dateOptionE id)
+void KMyMoneyPeriodCombo::dates(TQDate& start, TQDate& end, MyMoneyTransactionFilter::dateOptionE id)
{
}
#endif
-KMyMoneyOccurenceCombo::KMyMoneyOccurenceCombo(QWidget* parent, const char* name) :
- KMyMoneyGeneralCombo(parent, name)
+KMyMoneyOccurenceCombo::KMyMoneyOccurenceCombo(TQWidget* tqparent, const char* name) :
+ KMyMoneyGeneralCombo(tqparent, name)
{
}
@@ -734,8 +734,8 @@ MyMoneySchedule::occurenceE KMyMoneyOccurenceCombo::currentItem(void) const
return static_cast<MyMoneySchedule::occurenceE>(KMyMoneyGeneralCombo::currentItem());
}
-KMyMoneyOccurencePeriodCombo::KMyMoneyOccurencePeriodCombo(QWidget* parent, const char* name) :
- KMyMoneyOccurenceCombo(parent, name)
+KMyMoneyOccurencePeriodCombo::KMyMoneyOccurencePeriodCombo(TQWidget* tqparent, const char* name) :
+ KMyMoneyOccurenceCombo(tqparent, name)
{
insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_ONCE)), MyMoneySchedule::OCCUR_ONCE);
insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_DAILY)), MyMoneySchedule::OCCUR_DAILY);
@@ -745,8 +745,8 @@ KMyMoneyOccurencePeriodCombo::KMyMoneyOccurencePeriodCombo(QWidget* parent, cons
insertItem(i18n(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_YEARLY)), MyMoneySchedule::OCCUR_YEARLY);
}
-KMyMoneyFrequencyCombo::KMyMoneyFrequencyCombo(QWidget* parent, const char* name) :
- KMyMoneyOccurenceCombo(parent, name)
+KMyMoneyFrequencyCombo::KMyMoneyFrequencyCombo(TQWidget* tqparent, const char* name) :
+ KMyMoneyOccurenceCombo(tqparent, name)
{
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_ONCE)), MyMoneySchedule::OCCUR_ONCE);
insertItem(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_DAILY)), MyMoneySchedule::OCCUR_DAILY);