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/kmymoneypriceview.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/kmymoneypriceview.cpp')
-rw-r--r-- | kmymoney2/widgets/kmymoneypriceview.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/kmymoney2/widgets/kmymoneypriceview.cpp b/kmymoney2/widgets/kmymoneypriceview.cpp index 1b884d2..d1b5c85 100644 --- a/kmymoney2/widgets/kmymoneypriceview.cpp +++ b/kmymoney2/widgets/kmymoneypriceview.cpp @@ -23,11 +23,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qheader.h> -#include <qcursor.h> -#include <qtimer.h> -#include <qcheckbox.h> -#include <qgroupbox.h> +#include <tqheader.h> +#include <tqcursor.h> +#include <tqtimer.h> +#include <tqcheckbox.h> +#include <tqgroupbox.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -62,7 +62,7 @@ #define SOURCE_COL 4 KMyMoneyPriceItem::KMyMoneyPriceItem(KListView *view, const MyMoneyPrice& pr) : - KMyMoneyListViewItem(view, QString(), QString(), QString()), + KMyMoneyListViewItem(view, TQString(), TQString(), TQString()), m_pr(pr) { MyMoneySecurity from, to; @@ -74,7 +74,7 @@ KMyMoneyPriceItem::KMyMoneyPriceItem(KListView *view, const MyMoneyPrice& pr) : m_pr = MyMoneyFile::instance()->price(m_pr.from(), m_pr.to(), m_pr.date()); if(m_pr.isValid()) { - QString priceBase = m_pr.to(); + TQString priceBase = m_pr.to(); from = MyMoneyFile::instance()->security(m_pr.from()); to = MyMoneyFile::instance()->security(m_pr.to()); if(!to.isCurrency()) { @@ -91,7 +91,7 @@ KMyMoneyPriceItem::KMyMoneyPriceItem(KListView *view, const MyMoneyPrice& pr) : } } -int KMyMoneyPriceItem::compare(QListViewItem* i, int col, bool ascending) const +int KMyMoneyPriceItem::compare(TQListViewItem* i, int col, bool ascending) const { KMyMoneyPriceItem* item = static_cast<KMyMoneyPriceItem*>(i); int rc = 0; @@ -105,21 +105,21 @@ int KMyMoneyPriceItem::compare(QListViewItem* i, int col, bool ascending) const break; case PRICE_COL: // value - if(m_pr.rate(QString()) > item->m_pr.rate(QString())) + if(m_pr.rate(TQString()) > item->m_pr.rate(TQString())) rc = 1; - else if(m_pr.rate(QString()) < item->m_pr.rate(QString())) + else if(m_pr.rate(TQString()) < item->m_pr.rate(TQString())) rc = -1; break; default: - rc = QListViewItem::compare(i, col, ascending); + rc = TQListViewItem::compare(i, col, ascending); break; } return rc; } -KMyMoneyPriceView::KMyMoneyPriceView(QWidget *parent, const char *name ) : - KListView(parent,name), +KMyMoneyPriceView::KMyMoneyPriceView(TQWidget *tqparent, const char *name ) : + KListView(tqparent,name), m_contextMenu(0), m_showAll(false) { @@ -130,8 +130,8 @@ KMyMoneyPriceView::KMyMoneyPriceView(QWidget *parent, const char *name ) : addColumn(i18n("Source")); setAllColumnsShowFocus(true); setMultiSelection(false); - setColumnWidthMode(0, QListView::Maximum); - setColumnWidthMode(1, QListView::Maximum); + setColumnWidthMode(0, TQListView::Maximum); + setColumnWidthMode(1, TQListView::Maximum); setShowSortIndicator(true); setSorting(COMMODITY_COL); @@ -143,24 +143,24 @@ KMyMoneyPriceView::KMyMoneyPriceView(QWidget *parent, const char *name ) : m_contextMenu->insertTitle(i18n("Price Options")); m_contextMenu->insertItem(kiconloader->loadIcon("filenew", KIcon::Small), i18n("New..."), - this, SIGNAL(newPrice())); + this, TQT_SIGNAL(newPrice())); m_contextMenu->insertItem(kiconloader->loadIcon("edit", KIcon::Small), i18n("Edit..."), - this, SIGNAL(editPrice())); + this, TQT_SIGNAL(editPrice())); m_contextMenu->insertItem(kiconloader->loadIcon("connect_creating", KIcon::Small), i18n("Online Price Update..."), - this, SIGNAL(onlinePriceUpdate())); + this, TQT_SIGNAL(onlinePriceUpdate())); m_contextMenu->insertItem(kiconloader->loadIcon("delete", KIcon::Small), i18n("Delete..."), - this, SIGNAL(deletePrice())); + this, TQT_SIGNAL(deletePrice())); - connect(this, SIGNAL(rightButtonClicked(QListViewItem* , const QPoint&, int)), - this, SLOT(slotListClicked(QListViewItem*, const QPoint&, int))); + connect(this, TQT_SIGNAL(rightButtonClicked(TQListViewItem* , const TQPoint&, int)), + this, TQT_SLOT(slotListClicked(TQListViewItem*, const TQPoint&, int))); - // connect(MyMoneyFile::instance(), SIGNAL(dataChanged()), this, SLOT(slotReloadWidget())); + // connect(MyMoneyFile::instance(), TQT_SIGNAL(dataChanged()), this, TQT_SLOT(slotReloadWidget())); // slotReloadWidget(); @@ -169,7 +169,7 @@ KMyMoneyPriceView::KMyMoneyPriceView(QWidget *parent, const char *name ) : // way to solve this problem is to postpone the setup of the size // to the time when the widget is on the screen. resize(width()-1, height()-1); - QTimer::singleShot(50, this, SLOT(slotTimerDone())); + TQTimer::singleShot(50, this, TQT_SLOT(slotTimerDone())); } KMyMoneyPriceView::~KMyMoneyPriceView() @@ -209,7 +209,7 @@ void KMyMoneyPriceView::slotReloadWidget(void) } #endif -void KMyMoneyPriceView::resizeEvent(QResizeEvent* e) +void KMyMoneyPriceView::resizeEvent(TQResizeEvent* e) { int w = visibleWidth()/5; @@ -223,7 +223,7 @@ void KMyMoneyPriceView::resizeEvent(QResizeEvent* e) KListView::resizeEvent(e); } -void KMyMoneyPriceView::slotListClicked(QListViewItem* item, const QPoint&, int) +void KMyMoneyPriceView::slotListClicked(TQListViewItem* item, const TQPoint&, int) { int editId = m_contextMenu->idAt(2); int updateId = m_contextMenu->idAt(3); @@ -248,7 +248,7 @@ void KMyMoneyPriceView::slotListClicked(QListViewItem* item, const QPoint&, int) else m_contextMenu->setItemEnabled(updateId, false ); - m_contextMenu->exec(QCursor::pos()); + m_contextMenu->exec(TQCursor::pos()); } #if 0 @@ -269,7 +269,7 @@ void KMyMoneyPriceView::slotNewPrice(void) m_priceHistory->setSelected(p, true); // If the user cancels the following operation, we delete the new item // and re-select any previously selected one - if(slotEditPrice() == QDialog::Rejected) { + if(slotEditPrice() == TQDialog::Rejected) { delete p; if(item) m_priceHistory->setSelected(item, true); @@ -279,7 +279,7 @@ void KMyMoneyPriceView::slotNewPrice(void) int KMyMoneyPriceView::slotEditPrice(void) { - int rc = QDialog::Rejected; + int rc = TQDialog::Rejected; kMyMoneyPriceItem* item = dynamic_cast<kMyMoneyPriceItem*>(m_priceHistory->selectedItem()); if(item) { MyMoneySecurity from(MyMoneyFile::instance()->security(item->price().from())); @@ -333,7 +333,7 @@ void KMyMoneyPriceView::slotOnlinePriceUpdate(void) if(item) { KEquityPriceUpdateDlg dlg(this, (item->text(COMMODITY_COL)+" "+item->text(CURRENCY_COL)).utf8()); - if(dlg.exec() == QDialog::Accepted) + if(dlg.exec() == TQDialog::Accepted) dlg.storePrices(); } } |