diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
commit | fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch) | |
tree | 6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/widgets/kmymoneyaccounttreebase.cpp | |
parent | dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff) | |
download | kmymoney-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/widgets/kmymoneyaccounttreebase.cpp')
-rw-r--r-- | kmymoney2/widgets/kmymoneyaccounttreebase.cpp | 212 |
1 files changed, 106 insertions, 106 deletions
diff --git a/kmymoney2/widgets/kmymoneyaccounttreebase.cpp b/kmymoney2/widgets/kmymoneyaccounttreebase.cpp index da35ea1..b64b17c 100644 --- a/kmymoney2/widgets/kmymoneyaccounttreebase.cpp +++ b/kmymoney2/widgets/kmymoneyaccounttreebase.cpp @@ -18,15 +18,15 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qpoint.h> -#include <qevent.h> -#include <qdragobject.h> -#include <qtimer.h> -#include <qcursor.h> -#include <qheader.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qstyle.h> +#include <tqpoint.h> +#include <tqevent.h> +#include <tqdragobject.h> +#include <tqtimer.h> +#include <tqcursor.h> +#include <tqheader.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqstyle.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -46,8 +46,8 @@ #include <kmymoney/kmymoneyutils.h> -KMyMoneyAccountTreeBase::KMyMoneyAccountTreeBase(QWidget* parent, const char* name) : - KListView(parent, name), +KMyMoneyAccountTreeBase::KMyMoneyAccountTreeBase(TQWidget* tqparent, const char* name) : + KListView(tqparent, name), m_accountConnections(false), m_institutionConnections(false), m_queuedSort(0) @@ -56,7 +56,7 @@ KMyMoneyAccountTreeBase::KMyMoneyAccountTreeBase(QWidget* parent, const char* na setAllColumnsShowFocus(true); m_nameColumn = addColumn(i18n("Account")); - setColumnWidthMode(m_nameColumn, QListView::Manual); + setColumnWidthMode(m_nameColumn, TQListView::Manual); m_typeColumn = -1; m_balanceColumn = -1; @@ -64,7 +64,7 @@ KMyMoneyAccountTreeBase::KMyMoneyAccountTreeBase(QWidget* parent, const char* na setMultiSelection(false); - setResizeMode(QListView::LastColumn); + setResizeMode(TQListView::LastColumn); setShowSortIndicator(true); setSorting(0); @@ -80,14 +80,14 @@ KMyMoneyAccountTreeBase::KMyMoneyAccountTreeBase(QWidget* parent, const char* na m_baseCurrency.setSmallestAccountFraction(100); m_baseCurrency.setSmallestCashFraction(100); - connect(this, SIGNAL(dropped(QDropEvent*,QListViewItem*,QListViewItem*)), this, SLOT(slotObjectDropped(QDropEvent*,QListViewItem*,QListViewItem*))); - connect(this, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectObject(QListViewItem*))); - connect(this, SIGNAL(contextMenu(KListView*, QListViewItem* , const QPoint&)), this, SLOT(slotOpenContextMenu(KListView*, QListViewItem*, const QPoint&))); - connect(this, SIGNAL(doubleClicked(QListViewItem*,const QPoint&,int)), this, SLOT(slotOpenObject(QListViewItem*))); + connect(this, TQT_SIGNAL(dropped(TQDropEvent*,TQListViewItem*,TQListViewItem*)), this, TQT_SLOT(slotObjectDropped(TQDropEvent*,TQListViewItem*,TQListViewItem*))); + connect(this, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotSelectObject(TQListViewItem*))); + connect(this, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem* , const TQPoint&)), this, TQT_SLOT(slotOpenContextMenu(KListView*, TQListViewItem*, const TQPoint&))); + connect(this, TQT_SIGNAL(doubleClicked(TQListViewItem*,const TQPoint&,int)), this, TQT_SLOT(slotOpenObject(TQListViewItem*))); // drag and drop timer connections - connect( &m_autoopenTimer, SIGNAL( timeout() ), this, SLOT( slotOpenFolder() ) ); - connect( &m_autoscrollTimer, SIGNAL( timeout() ), this, SLOT( slotAutoScroll() ) ); + connect( &m_autoopenTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotOpenFolder() ) ); + connect( &m_autoscrollTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAutoScroll() ) ); } @@ -97,7 +97,7 @@ KMyMoneyAccountTreeBase::~KMyMoneyAccountTreeBase() saveLayout(KGlobal::config(), m_configGroup); } -void KMyMoneyAccountTreeBase::restoreLayout(const QString& group) +void KMyMoneyAccountTreeBase::restoreLayout(const TQString& group) { if (!m_configGroup.isEmpty()) return; // already done @@ -111,26 +111,26 @@ void KMyMoneyAccountTreeBase::restoreLayout(const QString& group) void KMyMoneyAccountTreeBase::showType(void) { m_typeColumn = addColumn(i18n("Type")); - setColumnWidthMode(m_typeColumn, QListView::Manual); - setColumnAlignment(m_typeColumn, Qt::AlignLeft); + setColumnWidthMode(m_typeColumn, TQListView::Manual); + setColumnAlignment(m_typeColumn, TQt::AlignLeft); } void KMyMoneyAccountTreeBase::showValue(void) { m_balanceColumn = addColumn(i18n("Total Balance")); - setColumnWidthMode(m_balanceColumn, QListView::Manual); - setColumnAlignment(m_balanceColumn, Qt::AlignRight); + setColumnWidthMode(m_balanceColumn, TQListView::Manual); + setColumnAlignment(m_balanceColumn, TQt::AlignRight); m_valueColumn = addColumn(i18n("Total Value")); - setColumnWidthMode(m_valueColumn, QListView::Manual); - setColumnAlignment(m_valueColumn, Qt::AlignRight); + setColumnWidthMode(m_valueColumn, TQListView::Manual); + setColumnAlignment(m_valueColumn, TQt::AlignRight); } void KMyMoneyAccountTreeBase::connectNotify(const char * /* s */) { // update drag and drop settings - m_accountConnections = (receivers(SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))) != 0); - m_institutionConnections = (receivers(SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&))) != 0); + m_accountConnections = (tqreceivers(TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))) != 0); + m_institutionConnections = (tqreceivers(TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&))) != 0); setDragEnabled(m_accountConnections | m_institutionConnections); setAcceptDrops(m_accountConnections | m_institutionConnections); } @@ -138,13 +138,13 @@ void KMyMoneyAccountTreeBase::connectNotify(const char * /* s */) void KMyMoneyAccountTreeBase::disconnectNotify(const char * /* s */) { // update drag and drop settings - m_accountConnections = (receivers(SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))) != 0); - m_institutionConnections = (receivers(SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&))) != 0); + m_accountConnections = (tqreceivers(TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyAccount&))) != 0); + m_institutionConnections = (tqreceivers(TQT_SIGNAL(reparent(const MyMoneyAccount&, const MyMoneyInstitution&))) != 0); setDragEnabled(m_accountConnections | m_institutionConnections); setAcceptDrops(m_accountConnections | m_institutionConnections); } -void KMyMoneyAccountTreeBase::setSectionHeader(const QString& txt) +void KMyMoneyAccountTreeBase::setSectionHeader(const TQString& txt) { header()->setLabel(nameColumn(), txt); } @@ -154,12 +154,12 @@ KMyMoneyAccountTreeBaseItem* KMyMoneyAccountTreeBase::selectedItem(void) const return dynamic_cast<KMyMoneyAccountTreeBaseItem *>(KListView::selectedItem()); } -const KMyMoneyAccountTreeBaseItem* KMyMoneyAccountTreeBase::findItem(const QString& id) const +const KMyMoneyAccountTreeBaseItem* KMyMoneyAccountTreeBase::findItem(const TQString& id) const { - // tried to use a QListViewItemIterator but that does not fit + // tried to use a TQListViewItemIterator but that does not fit // with the constness of this method. Arghhh. - QListViewItem* p = firstChild(); + TQListViewItem* p = firstChild(); while(p) { // item found, check for the id KMyMoneyAccountTreeBaseItem* item = dynamic_cast<KMyMoneyAccountTreeBaseItem*>(p); @@ -167,10 +167,10 @@ const KMyMoneyAccountTreeBaseItem* KMyMoneyAccountTreeBase::findItem(const QStri break; // item did not match, search the next one - QListViewItem* next = p->firstChild(); + TQListViewItem* next = p->firstChild(); if(!next) { while((next = p->nextSibling()) == 0) { - p = p->parent(); + p = p->tqparent(); if(!p) break; } @@ -186,9 +186,9 @@ bool KMyMoneyAccountTreeBase::dropAccountOnAccount(const MyMoneyAccount& accFrom bool rc = false; // it does not make sense to reparent an account to oneself - // or to reparent it to it's current parent + // or to reparent it to it's current tqparent if(accTo.id() != accFrom.id() - && accFrom.parentAccountId() != accTo.id()) { + && accFrom.tqparentAccountId() != accTo.id()) { // Moving within a group is generally ok rc = accTo.accountGroup() == accFrom.accountGroup(); @@ -231,14 +231,14 @@ bool KMyMoneyAccountTreeBase::dropAccountOnAccount(const MyMoneyAccount& accFrom return rc; } -bool KMyMoneyAccountTreeBase::acceptDrag(QDropEvent* event) const +bool KMyMoneyAccountTreeBase::acceptDrag(TQDropEvent* event) const { bool rc; if((rc = (acceptDrops()) && (event->source() == viewport()))) { rc = false; KMyMoneyAccountTreeBaseItem* to = dynamic_cast<KMyMoneyAccountTreeBaseItem*>(itemAt( contentsToViewport(event->pos()) )); - QString fromId(event->encodedData("text/plain")); + TQString fromId(event->tqencodedData("text/plain")); const KMyMoneyAccountTreeBaseItem* from = findItem(fromId); // we can only move accounts around @@ -265,19 +265,19 @@ bool KMyMoneyAccountTreeBase::acceptDrag(QDropEvent* event) const void KMyMoneyAccountTreeBase::startDrag(void) { - QListViewItem* item = currentItem(); + TQListViewItem* item = currentItem(); KMyMoneyAccountTreeBaseItem* p = dynamic_cast<KMyMoneyAccountTreeBaseItem *>(item); if(!p) return; if(p->isAccount()) { - QTextDrag* drag = new QTextDrag(p->id(), viewport()); + TQTextDrag* drag = new TQTextDrag(p->id(), viewport()); drag->setSubtype("plain"); // use the icon that is attached to the item to be dragged if (p->pixmap(0)) { - QPixmap pixmap(*p->pixmap(0)); - QPoint hotspot( pixmap.width() / 2, pixmap.height() / 2 ); + TQPixmap pixmap(*p->pixmap(0)); + TQPoint hotspot( pixmap.width() / 2, pixmap.height() / 2 ); drag->setPixmap(pixmap, hotspot); } @@ -287,7 +287,7 @@ void KMyMoneyAccountTreeBase::startDrag(void) return; } -void KMyMoneyAccountTreeBase::slotObjectDropped(QDropEvent* event, QListViewItem* /* parent */, QListViewItem* /* after */) +void KMyMoneyAccountTreeBase::slotObjectDropped(TQDropEvent* event, TQListViewItem* /* tqparent */, TQListViewItem* /* after */) { m_autoopenTimer.stop(); slotStopAutoScroll(); @@ -296,7 +296,7 @@ void KMyMoneyAccountTreeBase::slotObjectDropped(QDropEvent* event, QListViewItem KMyMoneyAccountTreeBaseItem* newParent = dynamic_cast<KMyMoneyAccountTreeBaseItem*>(m_dropItem); if(newParent) { - QString fromId(event->encodedData("text/plain")); + TQString fromId(event->tqencodedData("text/plain")); const KMyMoneyAccountTreeBaseItem* from = findItem(fromId); // we can only move accounts around @@ -321,7 +321,7 @@ void KMyMoneyAccountTreeBase::slotObjectDropped(QDropEvent* event, QListViewItem } } -void KMyMoneyAccountTreeBase::slotSelectObject(QListViewItem* i) +void KMyMoneyAccountTreeBase::slotSelectObject(TQListViewItem* i) { emit selectObject(MyMoneyInstitution()); emit selectObject(MyMoneyAccount()); @@ -332,7 +332,7 @@ void KMyMoneyAccountTreeBase::slotSelectObject(QListViewItem* i) } } -void KMyMoneyAccountTreeBase::slotOpenContextMenu(KListView* lv, QListViewItem* i, const QPoint&) +void KMyMoneyAccountTreeBase::slotOpenContextMenu(KListView* lv, TQListViewItem* i, const TQPoint&) { Q_UNUSED(lv); @@ -352,7 +352,7 @@ void KMyMoneyAccountTreeBase::slotOpenContextMenu(KListView* lv, QListViewItem* } } -void KMyMoneyAccountTreeBase::slotOpenObject(QListViewItem* i) +void KMyMoneyAccountTreeBase::slotOpenObject(TQListViewItem* i) { KMyMoneyAccountTreeBaseItem* item = dynamic_cast<KMyMoneyAccountTreeBaseItem *>(i); if(item) { @@ -380,7 +380,7 @@ void KMyMoneyAccountTreeBase::slotOpenFolder(void) m_autoopenTimer.stop(); if ( m_dropItem && !m_dropItem->isOpen() ) { m_dropItem->setOpen( TRUE ); - m_dropItem->repaint(); + m_dropItem->tqrepaint(); } } @@ -403,14 +403,14 @@ void KMyMoneyAccountTreeBase::slotAutoScroll(void) // don't show a highlighter during scrolling cleanItemHighlighter(); - QPoint p = viewport()->mapFromGlobal( QCursor::pos() ); + TQPoint p = viewport()->mapFromGlobal( TQCursor::pos() ); if ( m_autoscrollAccel-- <= 0 && m_autoscrollTime ) { m_autoscrollAccel = initialScrollAccel; m_autoscrollTime--; m_autoscrollTimer.start( m_autoscrollTime ); } - int l = QMAX(1,(initialScrollTime-m_autoscrollTime)); + int l = TQMAX(1,(initialScrollTime-m_autoscrollTime)); int dx=0,dy=0; if ( p.y() < autoscrollMargin ) { @@ -430,10 +430,10 @@ void KMyMoneyAccountTreeBase::slotAutoScroll(void) } } -void KMyMoneyAccountTreeBase::contentsDragMoveEvent(QDragMoveEvent* e) +void KMyMoneyAccountTreeBase::contentsDragMoveEvent(TQDragMoveEvent* e) { - QPoint vp = contentsToViewport(e->pos()); - QRect inside_margin((contentsX() > 0) ? autoscrollMargin : 0, + TQPoint vp = contentsToViewport(e->pos()); + TQRect inside_margin((contentsX() > 0) ? autoscrollMargin : 0, (contentsY() > 0) ? autoscrollMargin : 0, visibleWidth() - ((contentsX() + visibleWidth() < contentsWidth()) ? autoscrollMargin*2 : 0), @@ -441,22 +441,22 @@ void KMyMoneyAccountTreeBase::contentsDragMoveEvent(QDragMoveEvent* e) ? autoscrollMargin*2 : 0)); bool accepted = false; - QListViewItem *i = itemAt( vp ); + TQListViewItem *i = itemAt( vp ); if ( i ) { accepted = acceptDrag(e); if(accepted && !m_autoscrollTimer.isActive()) { if (dropHighlighter()) { - QRect tmpRect = drawItemHighlighter(0, i); + TQRect tmpRect = drawItemHighlighter(0, i); if (tmpRect != m_lastDropHighlighter) { cleanItemHighlighter(); m_lastDropHighlighter = tmpRect; - viewport()->repaint(tmpRect); + viewport()->tqrepaint(tmpRect); } } } - if ( !inside_margin.contains(vp) ) { + if ( !inside_margin.tqcontains(vp) ) { slotStartAutoScroll(); - e->accept(QRect(0,0,0,0)); // Keep sending move events + e->accept(TQRect(0,0,0,0)); // Keep sending move events m_autoopenTimer.stop(); } else { @@ -472,10 +472,10 @@ void KMyMoneyAccountTreeBase::contentsDragMoveEvent(QDragMoveEvent* e) } if ( accepted ) { switch ( e->action() ) { - case QDropEvent::Copy: - case QDropEvent::Link: + case TQDropEvent::Copy: + case TQDropEvent::Link: break; - case QDropEvent::Move: + case TQDropEvent::Move: e->acceptAction(); break; default: @@ -495,27 +495,27 @@ void KMyMoneyAccountTreeBase::contentsDragMoveEvent(QDragMoveEvent* e) void KMyMoneyAccountTreeBase::cleanItemHighlighter(void) { if(m_lastDropHighlighter.isValid()) { - QRect rect=m_lastDropHighlighter; - m_lastDropHighlighter = QRect(); - // make sure, we repaint a bit more. that's important during + TQRect rect=m_lastDropHighlighter; + m_lastDropHighlighter = TQRect(); + // make sure, we tqrepaint a bit more. that's important during // autoscroll. if we don't do that, parts of the highlighter // do not get removed rect.moveBy(-1, -1); - rect.setSize(rect.size() + QSize(2,2)); - viewport()->repaint(rect, true); + rect.setSize(rect.size() + TQSize(2,2)); + viewport()->tqrepaint(rect, true); } } -void KMyMoneyAccountTreeBase::viewportPaintEvent(QPaintEvent* e) +void KMyMoneyAccountTreeBase::viewportPaintEvent(TQPaintEvent* e) { - QListView::viewportPaintEvent(e); + TQListView::viewportPaintEvent(e); if (m_lastDropHighlighter.isValid() && e->rect().intersects(m_lastDropHighlighter)) { - QPainter painter(viewport()); + TQPainter painter(viewport()); // This is where we actually draw the drop-highlighter - style().drawPrimitive(QStyle::PE_FocusRect, &painter, m_lastDropHighlighter, colorGroup(), - QStyle::Style_FocusAtBorder); + tqstyle().tqdrawPrimitive(TQStyle::PE_FocusRect, &painter, m_lastDropHighlighter, tqcolorGroup(), + TQStyle::Style_FocusAtBorder); } } @@ -533,8 +533,8 @@ const MyMoneyObject& KMyMoneyAccountTreeBaseItem::itemObject(void) const return m_account; } -KMyMoneyAccountTreeBaseItem::KMyMoneyAccountTreeBaseItem(KListView *parent, const MyMoneyInstitution& institution) : - KListViewItem(parent), +KMyMoneyAccountTreeBaseItem::KMyMoneyAccountTreeBaseItem(KListView *tqparent, const MyMoneyInstitution& institution) : + KListViewItem(tqparent), m_totalValue(MyMoneyMoney(0)), m_negative(false), m_institution(institution), @@ -543,8 +543,8 @@ KMyMoneyAccountTreeBaseItem::KMyMoneyAccountTreeBaseItem(KListView *parent, cons setName(); } -KMyMoneyAccountTreeBaseItem::KMyMoneyAccountTreeBaseItem(KListView *parent, const MyMoneyAccount& account, const MyMoneySecurity& security, const QString& name) : - KListViewItem(parent), +KMyMoneyAccountTreeBaseItem::KMyMoneyAccountTreeBaseItem(KListView *tqparent, const MyMoneyAccount& account, const MyMoneySecurity& security, const TQString& name) : + KListViewItem(tqparent), m_security(security), m_totalValue(MyMoneyMoney(0)), m_account(account), @@ -560,8 +560,8 @@ KMyMoneyAccountTreeBaseItem::KMyMoneyAccountTreeBaseItem(KListView *parent, cons setName(); } -KMyMoneyAccountTreeBaseItem::KMyMoneyAccountTreeBaseItem(KMyMoneyAccountTreeBaseItem *parent, const MyMoneyAccount& account, const QValueList<MyMoneyPrice>& price, const MyMoneySecurity& security) : - KListViewItem(parent), +KMyMoneyAccountTreeBaseItem::KMyMoneyAccountTreeBaseItem(KMyMoneyAccountTreeBaseItem *tqparent, const MyMoneyAccount& account, const TQValueList<MyMoneyPrice>& price, const MyMoneySecurity& security) : + KListViewItem(tqparent), m_price(price), m_security(security), m_totalValue(MyMoneyMoney(0)), @@ -576,18 +576,18 @@ KMyMoneyAccountTreeBaseItem::~KMyMoneyAccountTreeBaseItem() { } -const QString& KMyMoneyAccountTreeBaseItem::id(void) const +const TQString& KMyMoneyAccountTreeBaseItem::id(void) const { if(m_type == Institution) return m_institution.id(); return m_account.id(); } -bool KMyMoneyAccountTreeBaseItem::isChildOf(const QListViewItem* const item) const +bool KMyMoneyAccountTreeBaseItem::isChildOf(const TQListViewItem* const item) const { - QListViewItem *p = parent(); + TQListViewItem *p = tqparent(); while(p && p != item) { - p = p->parent(); + p = p->tqparent(); } return (p != 0); } @@ -596,8 +596,8 @@ MyMoneyMoney KMyMoneyAccountTreeBaseItem::value() const { // calculate the new value by running down the price list MyMoneyMoney result = balance(); - QValueList<MyMoneyPrice>::const_iterator it_p; - QString security = m_security.id(); + TQValueList<MyMoneyPrice>::const_iterator it_p; + TQString security = m_security.id(); for(it_p = m_price.begin(); it_p != m_price.end(); ++it_p) { result = (result * (MyMoneyMoney(1,1) / (*it_p).rate(security))).convert(MyMoneyMoney::precToDenom(KMyMoneyGlobalSettings::pricePrecision())); if((*it_p).from() == security) @@ -636,7 +636,7 @@ void KMyMoneyAccountTreeBaseItem::fillColumns() if (lv->valueColumn()<0) return; // show the top accounts always in total value - if((isOpen() || m_account.accountList().count() == 0) && parent()) { + if((isOpen() || m_account.accountList().count() == 0) && tqparent()) { // only show the balance, if its a different security/currency if(m_security.id() != listView()->baseCurrency().id()) { @@ -646,7 +646,7 @@ void KMyMoneyAccountTreeBaseItem::fillColumns() } else { setText(lv->balanceColumn(), " "); - if(parent()) + if(tqparent()) setText(lv->valueColumn(), m_totalValue.formatMoney(listView()->baseCurrency()) + " "); else setText(lv->valueColumn(), m_totalValue.formatMoney(listView()->baseCurrency())); @@ -684,30 +684,30 @@ void KMyMoneyAccountTreeBaseItem::adjustTotalValue(const MyMoneyMoney& diff) { m_totalValue += diff; - // 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 KMyMoneyAccountTreeBase* lv = dynamic_cast<KMyMoneyAccountTreeBase*>(listView()); if(!lv) return; - if(!firstChild() || !parent() || (!isOpen() && firstChild())) { + if(!firstChild() || !tqparent() || (!isOpen() && firstChild())) { if(firstChild()) setText(lv->balanceColumn(), " "); - if(parent()) + if(tqparent()) setText(lv->valueColumn(), m_totalValue.formatMoney(listView()->baseCurrency()) + " "); else setText(lv->valueColumn(), m_totalValue.formatMoney(listView()->baseCurrency())); } // now make sure, the upstream accounts also get notified about the value change - KMyMoneyAccountTreeBaseItem* p = dynamic_cast<KMyMoneyAccountTreeBaseItem*>(parent()); + KMyMoneyAccountTreeBaseItem* p = dynamic_cast<KMyMoneyAccountTreeBaseItem*>(tqparent()); if(p != 0) { p->adjustTotalValue(diff); } } -int KMyMoneyAccountTreeBaseItem::compare(QListViewItem* i, int col, bool ascending) const +int KMyMoneyAccountTreeBaseItem::compare(TQListViewItem* i, int col, bool ascending) const { KMyMoneyAccountTreeBaseItem* item = dynamic_cast<KMyMoneyAccountTreeBaseItem*>(i); // do special sorting only if @@ -734,20 +734,20 @@ int KMyMoneyAccountTreeBaseItem::compare(QListViewItem* i, int col, bool ascendi return KListViewItem::compare(i, col, ascending); } -void KMyMoneyAccountTreeBaseItem::paintCell(QPainter *p, const QColorGroup & cg, int column, int width, int align) +void KMyMoneyAccountTreeBaseItem::paintCell(TQPainter *p, const TQColorGroup & cg, int column, int width, int align) { - QColorGroup cg2(cg); + TQColorGroup cg2(cg); //set item background if(isAlternate()) - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listColor()); else - cg2.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); + cg2.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listBGColor()); #ifndef KMM_DESIGNER // display base accounts in bold - QFont font = KMyMoneyGlobalSettings::listCellFont(); - if(!parent()) + TQFont font = KMyMoneyGlobalSettings::listCellFont(); + if(!tqparent()) font.setBold(true); // strike out closed accounts @@ -757,21 +757,21 @@ void KMyMoneyAccountTreeBaseItem::paintCell(QPainter *p, const QColorGroup & cg, p->setFont(font); #endif //set text color - QColor textColour; + TQColor textColour; if(m_negative == true) { textColour = KMyMoneyGlobalSettings::listNegativeValueColor(); //if the item is marked is marked as negative, all columns will be painted negative } else { textColour = m_columnsColor[column]; //otherwise, respect the color for each column } - cg2.setColor(QColorGroup::Text, textColour); + cg2.setColor(TQColorGroup::Text, textColour); - QListViewItem::paintCell(p, cg2, column, width, align); + TQListViewItem::paintCell(p, cg2, column, width, align); } void KMyMoneyAccountTreeBase::expandCollapseAll(bool expand) { - QListViewItemIterator it(this); - QListViewItem* p; + TQListViewItemIterator it(this); + TQListViewItem* p; while((p = it.current()) != 0) { p->setOpen(expand); ++it; @@ -792,7 +792,7 @@ void KMyMoneyAccountTreeBase::queueSort(void) { if (sortColumn() == balanceColumn() || sortColumn() == valueColumn()) { ++m_queuedSort; - QTimer::singleShot(100, this, SLOT(slotActivateSort())); + TQTimer::singleShot(100, this, TQT_SLOT(slotActivateSort())); } } @@ -808,13 +808,13 @@ void KMyMoneyAccountTreeBaseItem::setNegative(bool isNegative) m_negative = isNegative; } -void KMyMoneyAccountTreeBaseItem::setText( int column, const QString &text, const bool &negative) +void KMyMoneyAccountTreeBaseItem::setText( int column, const TQString &text, const bool &negative) { //if negative set the map to negative color according to KMyMoneySettings if(negative) { m_columnsColor[column] = KMyMoneyGlobalSettings::listNegativeValueColor(); } else { - m_columnsColor[column] = QColorGroup::Text; + m_columnsColor[column] = TQColorGroup::Text; } KListViewItem::setText(column, text); |