summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/register.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/widgets/register.cpp')
-rw-r--r--kmymoney2/widgets/register.cpp472
1 files changed, 236 insertions, 236 deletions
diff --git a/kmymoney2/widgets/register.cpp b/kmymoney2/widgets/register.cpp
index 974ae23..0494d51 100644
--- a/kmymoney2/widgets/register.cpp
+++ b/kmymoney2/widgets/register.cpp
@@ -20,12 +20,12 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qstring.h>
-#include <qtimer.h>
-#include <qapplication.h>
-#include <qeventloop.h>
-#include <qtooltip.h>
-#include <qimage.h>
+#include <tqstring.h>
+#include <tqtimer.h>
+#include <tqapplication.h>
+#include <tqeventloop.h>
+#include <tqtooltip.h>
+#include <tqimage.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -50,7 +50,7 @@
const int LinesPerMemo = 3;
-static QString sortOrderText[] = {
+static TQString sortOrderText[] = {
I18N_NOOP("Unknown"),
I18N_NOOP("Post date"),
I18N_NOOP("Date entered"),
@@ -100,7 +100,7 @@ static unsigned char fancymarker_bg_image[] = {
0x4E,0x44,0xAE,0x42,0x60,0x82
};
-QPixmap* GroupMarker::m_bg = 0;
+TQPixmap* GroupMarker::m_bg = 0;
int GroupMarker::m_bgRefCnt = 0;
void ItemPtrVector::sort(void)
@@ -124,11 +124,11 @@ void ItemPtrVector::sort(void)
bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2)
{
- const QValueList<TransactionSortField>& sortOrder = i1->parent()->sortOrder();
- QValueList<TransactionSortField>::const_iterator it;
+ const TQValueList<TransactionSortField>& sortOrder = i1->tqparent()->sortOrder();
+ TQValueList<TransactionSortField>::const_iterator it;
int rc = 0;
bool ok1, ok2;
- Q_ULLONG n1, n2;
+ TQ_ULLONG n1, n2;
MyMoneyMoney tmp;
@@ -147,7 +147,7 @@ bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2)
break;
case PayeeSort:
- rc = QString::localeAwareCompare(i1->sortPayee(), i2->sortPayee());
+ rc = TQString::localeAwareCompare(i1->sortPayee(), i2->sortPayee());
break;
case ValueSort:
@@ -180,7 +180,7 @@ bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2)
} else if(!ok1 && ok2) {
rc = 1;
} else
- rc = QString::localeAwareCompare(i1->sortNumber(), i2->sortNumber());
+ rc = TQString::localeAwareCompare(i1->sortNumber(), i2->sortNumber());
break;
case EntryOrderSort:
@@ -192,7 +192,7 @@ bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2)
break;
case CategorySort:
- rc = QString::localeAwareCompare(i1->sortCategory(), i2->sortCategory());
+ rc = TQString::localeAwareCompare(i1->sortCategory(), i2->sortCategory());
break;
case ReconcileStateSort:
@@ -200,7 +200,7 @@ bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2)
break;
case SecuritySort:
- rc = QString::localeAwareCompare(i1->sortSecurity(), i2->sortSecurity());
+ rc = TQString::localeAwareCompare(i1->sortSecurity(), i2->sortSecurity());
break;
default:
@@ -220,17 +220,17 @@ bool ItemPtrVector::item_cmp(RegisterItem* i1, RegisterItem* i2)
return rc < 0;
}
-GroupMarker::GroupMarker(Register *parent, const QString& txt) :
- RegisterItem(parent),
+GroupMarker::GroupMarker(Register *tqparent, const TQString& txt) :
+ RegisterItem(tqparent),
m_txt(txt),
- m_drawCounter(parent->drawCounter()-1), // make sure we get painted the first time around
+ m_drawCounter(tqparent->drawCounter()-1), // make sure we get painted the first time around
m_showDate(false)
{
int h;
if(m_parent) {
h = m_parent->rowHeightHint();
} else {
- QFontMetrics fm( KMyMoneyGlobalSettings::listCellFont() );
+ TQFontMetrics fm( KMyMoneyGlobalSettings::listCellFont() );
h = fm.lineSpacing()+6;
}
@@ -241,14 +241,14 @@ GroupMarker::GroupMarker(Register *parent, const QString& txt) :
// convert the backgroud once
if(m_bg == 0) {
- m_bg = new QPixmap;
+ m_bg = new TQPixmap;
m_bg->loadFromData(fancymarker_bg_image, sizeof(fancymarker_bg_image));
- // for now, we can't simply resize the m_bg member as Qt does not support
- // alpha resizing. So we take the (slow) detour through a QImage object
+ // for now, we can't simply resize the m_bg member as TQt does not support
+ // alpha resizing. So we take the (slow) detour through a TQImage object
// which is ok, since we do this only once.
// m_bg->resize(m_bg->width(), h);
- QImage img(m_bg->convertToImage());
+ TQImage img(m_bg->convertToImage());
img = img.smoothScale(img.width(), h);
m_bg->convertFromImage(img);
}
@@ -265,7 +265,7 @@ GroupMarker::~GroupMarker()
}
}
-void GroupMarker::paintRegisterCell(QPainter* painter, int row, int /* col */, const QRect& _r, bool /*selected*/, const QColorGroup& _cg)
+void GroupMarker::paintRegisterCell(TQPainter* painter, int row, int /* col */, const TQRect& _r, bool /*selected*/, const TQColorGroup& _cg)
{
// avoid painting the marker twice for the same update round
unsigned int drawCounter = m_parent->drawCounter();
@@ -274,7 +274,7 @@ void GroupMarker::paintRegisterCell(QPainter* painter, int row, int /* col */, c
}
m_drawCounter = drawCounter;
- QRect r(_r);
+ TQRect r(_r);
painter->save();
painter->translate(-r.x(), -r.y());
@@ -283,35 +283,35 @@ void GroupMarker::paintRegisterCell(QPainter* painter, int row, int /* col */, c
r.setWidth(m_parent->visibleWidth());
painter->translate(r.x(), r.y());
- QRect cellRect;
+ TQRect cellRect;
cellRect.setX(0);
cellRect.setY(0);
cellRect.setWidth(m_parent->visibleWidth());
cellRect.setHeight(m_parent->rowHeight(row + m_startRow));
// clear out cell rectangle
- QColorGroup cg(_cg);
+ TQColorGroup cg(_cg);
setupColors(cg);
- QBrush backgroundBrush(cg.base());
+ TQBrush backgroundBrush(cg.base());
painter->fillRect(cellRect, backgroundBrush);
painter->setPen(KMyMoneyGlobalSettings::listGridColor());
painter->drawLine(cellRect.x(), cellRect.height()-1, cellRect.width(), cellRect.height()-1);
// now write the text
painter->setPen(cg.text());
- QFont font = painter->font();
+ TQFont font = painter->font();
font.setBold(true);
painter->setFont(font);
- painter->drawText(cellRect, Qt::AlignVCenter | Qt::AlignCenter, m_txt);
+ painter->drawText(cellRect, TQt::AlignVCenter | TQt::AlignCenter, m_txt);
cellRect.setHeight(m_bg->height());
int curWidth = m_bg->width();
// if the background image is too small (not wide enough) we need to increase its width.
if(curWidth < cellRect.width()) {
- QPixmap* newPic = new QPixmap(cellRect.width(), cellRect.height());
+ TQPixmap* newPic = new TQPixmap(cellRect.width(), cellRect.height());
int x = 0;
while(x < cellRect.width()) {
copyBlt(newPic, x, 0, m_bg, 0, 0, curWidth, m_bg->height());
@@ -340,15 +340,15 @@ void GroupMarker::paintRegisterCell(QPainter* painter, int row, int /* col */, c
font.setBold(false);
painter->setFont(font);
- painter->drawText(cellRect, Qt::AlignVCenter | Qt::AlignCenter, KGlobal::locale()->formatDate(sortPostDate(), true));
+ painter->drawText(cellRect, TQt::AlignVCenter | TQt::AlignCenter, KGlobal::locale()->formatDate(sortPostDate(), true));
}
painter->restore();
}
-void GroupMarker::setupColors(QColorGroup& cg)
+void GroupMarker::setupColors(TQColorGroup& cg)
{
- cg.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::groupMarkerColor());
+ cg.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::groupMarkerColor());
}
int GroupMarker::rowHeightHint(void) const
@@ -359,32 +359,32 @@ int GroupMarker::rowHeightHint(void) const
return m_bg->height();
}
-StatementGroupMarker::StatementGroupMarker(Register* parent, CashFlowDirection dir, const QDate& date, const QString& txt) :
- FancyDateGroupMarker(parent, date, txt),
+StatementGroupMarker::StatementGroupMarker(Register* tqparent, CashFlowDirection dir, const TQDate& date, const TQString& txt) :
+ FancyDateGroupMarker(tqparent, date, txt),
m_dir(dir)
{
m_showDate = true;
}
-FancyDateGroupMarker::FancyDateGroupMarker(Register* parent, const QDate& date, const QString& txt) :
- GroupMarker(parent, txt),
+FancyDateGroupMarker::FancyDateGroupMarker(Register* tqparent, const TQDate& date, const TQString& txt) :
+ GroupMarker(tqparent, txt),
m_date(date)
{
}
-FiscalYearGroupMarker::FiscalYearGroupMarker(Register* parent, const QDate& date, const QString& txt) :
- FancyDateGroupMarker(parent, date, txt)
+FiscalYearGroupMarker::FiscalYearGroupMarker(Register* tqparent, const TQDate& date, const TQString& txt) :
+ FancyDateGroupMarker(tqparent, date, txt)
{
}
-void FiscalYearGroupMarker::setupColors(QColorGroup& cg)
+void FiscalYearGroupMarker::setupColors(TQColorGroup& cg)
{
- cg.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::groupMarkerColor());
+ cg.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::groupMarkerColor());
}
-SimpleDateGroupMarker::SimpleDateGroupMarker(Register* parent, const QDate& date, const QString& txt) :
- FancyDateGroupMarker(parent, date, txt)
+SimpleDateGroupMarker::SimpleDateGroupMarker(Register* tqparent, const TQDate& date, const TQString& txt) :
+ FancyDateGroupMarker(tqparent, date, txt)
{
}
@@ -396,9 +396,9 @@ int SimpleDateGroupMarker::rowHeightHint(void) const
return RegisterItem::rowHeightHint() / 2;
}
-void SimpleDateGroupMarker::paintRegisterCell(QPainter* painter, int row, int /*col*/, const QRect& _r, bool /*selected*/, const QColorGroup& _cg)
+void SimpleDateGroupMarker::paintRegisterCell(TQPainter* painter, int row, int /*col*/, const TQRect& _r, bool /*selected*/, const TQColorGroup& _cg)
{
- QRect r(_r);
+ TQRect r(_r);
painter->save();
painter->translate(-r.x(), -r.y());
@@ -407,20 +407,20 @@ void SimpleDateGroupMarker::paintRegisterCell(QPainter* painter, int row, int /*
r.setWidth(m_parent->visibleWidth());
painter->translate(r.x(), r.y());
- QRect cellRect;
+ TQRect cellRect;
cellRect.setX(0);
cellRect.setY(0);
cellRect.setWidth(m_parent->visibleWidth());
cellRect.setHeight(m_parent->rowHeight(row + m_startRow));
// clear out cell rectangle
- QColorGroup cg(_cg);
+ TQColorGroup cg(_cg);
if(m_alternate)
- cg.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listColor());
+ cg.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listColor());
else
- cg.setColor(QColorGroup::Base, KMyMoneyGlobalSettings::listBGColor());
- QBrush backgroundBrush(cg.base());
- // backgroundBrush.setStyle(Qt::DiagCrossPattern);
+ cg.setColor(TQColorGroup::Base, KMyMoneyGlobalSettings::listBGColor());
+ TQBrush backgroundBrush(cg.base());
+ // backgroundBrush.setStyle(TQt::DiagCrossPattern);
backgroundBrush.setStyle(Qt::Dense5Pattern);
backgroundBrush.setColor(KMyMoneyGlobalSettings::listGridColor());
painter->eraseRect(cellRect);
@@ -431,8 +431,8 @@ void SimpleDateGroupMarker::paintRegisterCell(QPainter* painter, int row, int /*
painter->restore();
}
-TypeGroupMarker::TypeGroupMarker(Register* parent, CashFlowDirection dir, MyMoneyAccount::accountTypeE accType) :
- GroupMarker(parent),
+TypeGroupMarker::TypeGroupMarker(Register* tqparent, CashFlowDirection dir, MyMoneyAccount::accountTypeE accType) :
+ GroupMarker(tqparent),
m_dir(dir)
{
switch(dir) {
@@ -454,18 +454,18 @@ TypeGroupMarker::TypeGroupMarker(Register* parent, CashFlowDirection dir, MyMone
}
}
-PayeeGroupMarker::PayeeGroupMarker(Register* parent, const QString& name) :
- GroupMarker(parent, name)
+PayeeGroupMarker::PayeeGroupMarker(Register* tqparent, const TQString& name) :
+ GroupMarker(tqparent, name)
{
}
-CategoryGroupMarker::CategoryGroupMarker(Register* parent, const QString& category) :
- GroupMarker(parent, category)
+CategoryGroupMarker::CategoryGroupMarker(Register* tqparent, const TQString& category) :
+ GroupMarker(tqparent, category)
{
}
-ReconcileGroupMarker::ReconcileGroupMarker(Register* parent, MyMoneySplit::reconcileFlagE state) :
- GroupMarker(parent),
+ReconcileGroupMarker::ReconcileGroupMarker(Register* tqparent, MyMoneySplit::reconcileFlagE state) :
+ GroupMarker(tqparent),
m_state(state)
{
switch(state) {
@@ -487,30 +487,30 @@ ReconcileGroupMarker::ReconcileGroupMarker(Register* parent, MyMoneySplit::recon
}
}
-class RegisterToolTip : public QToolTip
+class RegisterToolTip : public TQToolTip
{
public:
- RegisterToolTip(QWidget* parent, Register* reg);
- void maybeTip(const QPoint& pos);
+ RegisterToolTip(TQWidget* tqparent, Register* reg);
+ void maybeTip(const TQPoint& pos);
virtual ~RegisterToolTip() {}
private:
Register* m_register;
};
-RegisterToolTip::RegisterToolTip(QWidget* parent, Register * reg) :
- QToolTip(parent),
+RegisterToolTip::RegisterToolTip(TQWidget* tqparent, Register * reg) :
+ TQToolTip(tqparent),
m_register(reg)
{
}
-void RegisterToolTip::maybeTip(const QPoint& pos)
+void RegisterToolTip::maybeTip(const TQPoint& pos)
{
// if we update the register, there's no need to show tooltips
if(!m_register->isUpdatesEnabled())
return;
- QPoint cpos = m_register->viewportToContents(pos);
+ TQPoint cpos = m_register->viewportToContents(pos);
// qDebug("RegisterToolTip::mayBeTip(%d,%d)", cpos.x(), cpos.y());
int row = m_register->rowAt(cpos.y());
int col = m_register->columnAt(cpos.x());
@@ -518,25 +518,25 @@ void RegisterToolTip::maybeTip(const QPoint& pos)
if(!item)
return;
- QPoint relPos(cpos.x() - m_register->columnPos(0), cpos.y() - m_register->rowPos(item->startRow()));
+ TQPoint relPos(cpos.x() - m_register->columnPos(0), cpos.y() - m_register->rowPos(item->startRow()));
row = row - item->startRow();
// qDebug("row = %d, col = %d", row, col);
// qDebug("relpos = %d,%d", relPos.x(), relPos.y());
- QString msg;
- QRect rect;
+ TQString msg;
+ TQRect rect;
if(!item->maybeTip(cpos, row, col, rect, msg))
return;
- QPoint tl(rect.topLeft());
- QPoint br(rect.bottomRight());
- QRect r = QRect(m_register->contentsToViewport(tl), m_register->contentsToViewport(br));
+ TQPoint tl(rect.topLeft());
+ TQPoint br(rect.bottomRight());
+ TQRect r = TQRect(m_register->contentsToViewport(tl), m_register->contentsToViewport(br));
tip(r, msg);
return;
}
-Register::Register(QWidget *parent, const char *name ) :
- TransactionEditorContainer(parent, name),
+Register::Register(TQWidget *tqparent, const char *name ) :
+ TransactionEditorContainer(tqparent, name),
m_selectAnchor(0),
m_focusItem(0),
m_firstItem(0),
@@ -550,7 +550,7 @@ Register::Register(QWidget *parent, const char *name ) :
m_listsDirty(false),
m_ignoreNextButtonRelease(false),
m_needInitialColumnResize(false),
- m_buttonState(Qt::ButtonState(0)),
+ m_buttonState(TQt::ButtonState(0)),
m_drawCounter(0)
{
m_tooltip = new RegisterToolTip(viewport(), this);
@@ -587,32 +587,32 @@ Register::Register(QWidget *parent, const char *name ) :
horizontalHeader()->installEventFilter(this);
// never show horizontal scroll bars
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setHScrollBarMode(TQScrollView::AlwaysOff);
- connect(this, SIGNAL(clicked(int, int, int, const QPoint&)), this, SLOT(selectItem(int, int, int, const QPoint&)));
- connect(this, SIGNAL(doubleClicked(int, int, int, const QPoint&)), this, SLOT(slotDoubleClicked(int, int, int, const QPoint&)));
+ connect(this, TQT_SIGNAL(clicked(int, int, int, const TQPoint&)), this, TQT_SLOT(selectItem(int, int, int, const TQPoint&)));
+ connect(this, TQT_SIGNAL(doubleClicked(int, int, int, const TQPoint&)), this, TQT_SLOT(slotDoubleClicked(int, int, int, const TQPoint&)));
// double clicking the header turns on auto column sizing
- connect(horizontalHeader(), SIGNAL(sectionSizeChanged(int)), this, SLOT(slotAutoColumnSizing(int)));
+ connect(horizontalHeader(), TQT_SIGNAL(sectionSizeChanged(int)), this, TQT_SLOT(slotAutoColumnSizing(int)));
//DND
setAcceptDrops(true);
}
// DND
-Transaction* Register::dropTransaction(QPoint cPos) const
+Transaction* Register::dropTransaction(TQPoint cPos) const
{
Transaction* t = 0;
- cPos -= QPoint( verticalHeader()->width(), horizontalHeader()->height() );
+ cPos -= TQPoint( verticalHeader()->width(), horizontalHeader()->height() );
if(cPos.y() >= 0) {
- cPos += QPoint(contentsX(), contentsY());
+ cPos += TQPoint(contentsX(), contentsY());
int row = rowAt(cPos.y());
t = dynamic_cast<Transaction*>(itemAtRow(row));
}
return t;
}
-void Register::dragMoveEvent(QDragMoveEvent* event)
+void Register::dragMoveEvent(TQDragMoveEvent* event)
{
if ( KURLDrag::canDecode(event) ) {
event->ignore();
@@ -623,7 +623,7 @@ void Register::dragMoveEvent(QDragMoveEvent* event)
}
}
-void Register::dropEvent(QDropEvent* event)
+void Register::dropEvent(TQDropEvent* event)
{
qDebug("Register::dropEvent");
if ( KURLDrag::canDecode(event) ) {
@@ -657,7 +657,7 @@ void Register::slotAutoColumnSizing(int section)
// but no account? (ipwizard 2007-11-06)
if(isUpdatesEnabled()) {
int w = visibleWidth();
- QString size;
+ TQString size;
for(int i=0; i < numCols(); ++i) {
if(i)
size += ",";
@@ -665,7 +665,7 @@ void Register::slotAutoColumnSizing(int section)
size += "0";
continue;
}
- size += QString("%1").arg((columnWidth(i) * 100) / w);
+ size += TQString("%1").tqarg((columnWidth(i) * 100) / w);
}
qDebug("size = %s", size.data());
m_account.setValue("kmm-ledger-column-width", size);
@@ -673,34 +673,34 @@ void Register::slotAutoColumnSizing(int section)
#endif
}
-bool Register::eventFilter(QObject* o, QEvent* e)
+bool Register::eventFilter(TQObject* o, TQEvent* e)
{
- if(o == horizontalHeader() && e->type() == QEvent::MouseButtonPress) {
- QMouseEvent *me = dynamic_cast<QMouseEvent*>(e);
+ if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(horizontalHeader()) && e->type() == TQEvent::MouseButtonPress) {
+ TQMouseEvent *me = dynamic_cast<TQMouseEvent*>(e);
if(me->button() == Qt::RightButton) {
emit headerClicked();
}
// eat up left mouse button press for now
return true;
- } else if(o == horizontalHeader() && e->type() == QEvent::Paint) {
+ } else if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(horizontalHeader()) && e->type() == TQEvent::Paint) {
// always show the header in bold (to suppress cell selection)
- QFont f(horizontalHeader()->font());
+ TQFont f(horizontalHeader()->font());
f.setBold(true);
horizontalHeader()->setFont(f);
- } else if(o == this && e->type() == QEvent::KeyPress) {
- QKeyEvent* ke = dynamic_cast<QKeyEvent*>(e);
- if(ke->key() == Qt::Key_Menu) {
+ } else if(TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) && e->type() == TQEvent::KeyPress) {
+ TQKeyEvent* ke = dynamic_cast<TQKeyEvent*>(e);
+ if(ke->key() == TQt::Key_Menu) {
emit openContextMenu();
return true;
}
}
- return QTable::eventFilter(o, e);
+ return TQTable::eventFilter(o, e);
}
-void Register::setupRegister(const MyMoneyAccount& account, const QValueList<Column>& cols)
+void Register::setupRegister(const MyMoneyAccount& account, const TQValueList<Column>& cols)
{
m_account = account;
bool enabled = isUpdatesEnabled();
@@ -712,7 +712,7 @@ void Register::setupRegister(const MyMoneyAccount& account, const QValueList<Col
m_needInitialColumnResize = true;
m_lastCol = static_cast<Column>(0);
- QValueList<Column>::const_iterator it_c;
+ TQValueList<Column>::const_iterator it_c;
for(it_c = cols.begin(); it_c != cols.end(); ++it_c) {
if((*it_c) > MaxColumns)
continue;
@@ -844,13 +844,13 @@ void Register::setupRegister(const MyMoneyAccount& account, bool showAccountColu
bool Register::focusNextPrevChild(bool next)
{
- return QFrame::focusNextPrevChild(next);
+ return TQFrame::focusNextPrevChild(next);
}
-void Register::setSortOrder(const QString& order)
+void Register::setSortOrder(const TQString& order)
{
- QStringList orderList = QStringList::split(",", order);
- QStringList::const_iterator it;
+ TQStringList orderList = TQStringList::split(",", order);
+ TQStringList::const_iterator it;
m_sortOrder.clear();
for(it = orderList.begin(); it != orderList.end(); ++it) {
m_sortOrder << static_cast<TransactionSortField>((*it).toInt());
@@ -869,7 +869,7 @@ void Register::sortItems(void)
RegisterItem* prev = 0;
RegisterItem* item;
m_firstItem = m_lastItem = 0;
- for(QValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
+ for(TQValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
item = m_items[i];
if(!item)
continue;
@@ -929,7 +929,7 @@ void Register::clear(void)
#ifndef KMM_DESIGNER
// recalculate row height hint
- QFontMetrics fm( KMyMoneyGlobalSettings::listCellFont() );
+ TQFontMetrics fm( KMyMoneyGlobalSettings::listCellFont() );
m_rowHeightHint = fm.lineSpacing()+6;
#endif
@@ -998,7 +998,7 @@ void Register::removeItem(RegisterItem* p)
p->setPrevItem(0);
// remove it from the m_items array
- for(QValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
+ for(TQValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
RegisterItem* item = m_items[i];
if(!item)
continue;
@@ -1030,7 +1030,7 @@ void Register::setupItemIndex(int rowCount)
rowCount = 0;
RegisterItem* prev = 0;
m_firstItem = m_lastItem = 0;
- for(QValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
+ for(TQValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
RegisterItem* item = m_items[i];
if(!item)
continue;
@@ -1048,11 +1048,11 @@ void Register::setupItemIndex(int rowCount)
}
}
-void Register::drawContents( QPainter *p, int cx, int cy, int cw, int ch )
+void Register::drawContents( TQPainter *p, int cx, int cy, int cw, int ch )
{
- // the QTable::drawContents() method does not honor the block update flag
+ // the TQTable::drawContents() method does not honor the block update flag
// so we take care of it here
- if ( testWState(WState_Visible|WState_BlockUpdates) != WState_Visible )
+ if ( testWState((TQt::WidgetState)(WState_Visible|WState_BlockUpdates)) != WState_Visible )
return;
if(m_listsDirty) {
@@ -1060,13 +1060,13 @@ void Register::drawContents( QPainter *p, int cx, int cy, int cw, int ch )
}
++m_drawCounter;
- QTable::drawContents(p, cx, cy, cw, ch);
+ TQTable::drawContents(p, cx, cy, cw, ch);
}
void Register::updateAlternate(void) const
{
bool alternate = false;
- for(QValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
+ for(TQValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
RegisterItem* item = m_items[i];
if(!item)
continue;
@@ -1110,7 +1110,7 @@ void Register::updateRegister(bool forceUpdateRowHeight)
int rowCount = 0;
// determine the number of rows we need to display all items
// while going through the list, check for erronous transactions
- for(QValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
+ for(TQValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
RegisterItem* item = m_items[i];
if(!item)
continue;
@@ -1132,7 +1132,7 @@ void Register::updateRegister(bool forceUpdateRowHeight)
bool needUpdateHeaders = (numRows() != rowCount) | forceUpdateRowHeight;
- // setup QTable. Make sure to suppress screen updates for now
+ // setup TQTable. Make sure to suppress screen updates for now
bool updatesEnabled = isUpdatesEnabled();
setUpdatesEnabled(false);
setNumRows(rowCount);
@@ -1163,7 +1163,7 @@ void Register::updateRegister(bool forceUpdateRowHeight)
// force resizeing of the columns if necessary
if(m_needInitialColumnResize) {
- QTimer::singleShot(0, this, SLOT(resize()));
+ TQTimer::singleShot(0, this, TQT_SLOT(resize()));
m_needInitialColumnResize = false;
} else {
updateContents();
@@ -1171,7 +1171,7 @@ void Register::updateRegister(bool forceUpdateRowHeight)
// if the number of rows changed, we might need to resize the register
// to make sure we reflect the current visibility of the scrollbars.
if(needUpdateHeaders)
- QTimer::singleShot(0, this, SLOT(resize()));
+ TQTimer::singleShot(0, this, TQT_SLOT(resize()));
}
}
::timetrace("Done updateing register");
@@ -1185,7 +1185,7 @@ int Register::rowHeightHint(void) const
return m_rowHeightHint;
}
-void Register::paintCell(QPainter* painter, int row, int col, const QRect& r, bool selected, const QColorGroup& cg)
+void Register::paintCell(TQPainter* painter, int row, int col, const TQRect& r, bool selected, const TQColorGroup& cg)
{
// determine the item that we need to paint in the row and call it's paintRegisterCell() method
if((row < 0) || ((unsigned)row > m_itemIndex.size())) {
@@ -1198,22 +1198,22 @@ void Register::paintCell(QPainter* painter, int row, int col, const QRect& r, bo
item->paintRegisterCell(painter, row - item->startRow(), col, r, selected, cg);
}
-void Register::focusInEvent(QFocusEvent* ev)
+void Register::focusInEvent(TQFocusEvent* ev)
{
- QTable::focusInEvent(ev);
+ TQTable::focusInEvent(ev);
if(m_focusItem) {
m_focusItem->setFocus(true, false);
- repaintItems(m_focusItem);
+ tqrepaintItems(m_focusItem);
}
}
-void Register::focusOutEvent(QFocusEvent* ev)
+void Register::focusOutEvent(TQFocusEvent* ev)
{
if(m_focusItem) {
m_focusItem->setFocus(false, false);
- repaintItems(m_focusItem);
+ tqrepaintItems(m_focusItem);
}
- QTable::focusOutEvent(ev);
+ TQTable::focusOutEvent(ev);
}
void Register::resize(void)
@@ -1292,9 +1292,9 @@ void Register::resize(int col)
kMyMoneyEdit* valField = new kMyMoneyEdit;
dateField->setFont(KMyMoneyGlobalSettings::listCellFont());
- setColumnWidth(DateColumn, dateField->minimumSizeHint().width());
+ setColumnWidth(DateColumn, dateField->tqminimumSizeHint().width());
valField->setMinimumWidth(ewidth);
- ewidth = valField->minimumSizeHint().width();
+ ewidth = valField->tqminimumSizeHint().width();
if(swidth > 0) {
swidth = columnWidth(SecurityColumn) + 40;
@@ -1325,7 +1325,7 @@ void Register::resize(int col)
#if 0
// see comment above
} else {
- QStringList colSizes = QStringList::split(",", m_account.value("kmm-ledger-column-width"), true);
+ TQStringList colSizes = TQStringList::split(",", m_account.value("kmm-ledger-column-width"), true);
for(int i; i < colSizes.count(); ++i) {
int colWidth = colSizes[i].toInt();
if(colWidth == 0)
@@ -1353,15 +1353,15 @@ void Register::adjustColumn(int col)
#ifdef KMM_DESIGNER
Q_UNUSED(col)
#else
- QString msg = "%1 adjusting column %2";
- ::timetrace((msg.arg("Start").arg(col)).data());
- QHeader *topHeader = horizontalHeader();
- QFontMetrics cellFontMetrics(KMyMoneyGlobalSettings::listCellFont());
+ TQString msg = "%1 adjusting column %2";
+ ::timetrace((msg.tqarg("Start").tqarg(col)).ascii());
+ TQHeader *topHeader = horizontalHeader();
+ TQFontMetrics cellFontMetrics(KMyMoneyGlobalSettings::listCellFont());
int w = topHeader->fontMetrics().width( topHeader->label( col ) ) + 10;
if ( topHeader->iconSet( col ) )
w += topHeader->iconSet( col )->pixmap().width();
- w = QMAX( w, 20 );
+ w = TQMAX( w, 20 );
int maxWidth = 0;
switch(col) {
@@ -1374,9 +1374,9 @@ void Register::adjustColumn(int col)
// check for date column
if(col == DateColumn) {
- QString txt = KGlobal::locale()->formatDate(QDate(6999,12,29), true);
+ TQString txt = KGlobal::locale()->formatDate(TQDate(6999,12,29), true);
int nw = cellFontMetrics.width(txt+" ");
- w = QMAX( w, nw );
+ w = TQMAX( w, nw );
} else {
// scan through the transactions
@@ -1387,7 +1387,7 @@ void Register::adjustColumn(int col)
Transaction* t = dynamic_cast<Transaction*>(item);
if(t) {
int nw = t->registerColWidth(col, cellFontMetrics);
- w = QMAX( w, nw );
+ w = TQMAX( w, nw );
if(maxWidth) {
if(w > maxWidth) {
w = maxWidth;
@@ -1402,7 +1402,7 @@ void Register::adjustColumn(int col)
#endif
}
-void Register::repaintItems(RegisterItem* first, RegisterItem* last)
+void Register::tqrepaintItems(RegisterItem* first, RegisterItem* last)
{
if(first == 0 && last == 0) {
first = firstItem();
@@ -1415,26 +1415,26 @@ void Register::repaintItems(RegisterItem* first, RegisterItem* last)
if(last == 0)
last = first;
- // qDebug("repaintItems from row %d to row %d", first->startRow(), last->startRow()+last->numRowsRegister()-1);
+ // qDebug("tqrepaintItems from row %d to row %d", first->startRow(), last->startRow()+last->numRowsRegister()-1);
// the following code is based on code I found in
- // QTable::cellGeometry() and QTable::updateCell() (ipwizard)
- QRect cg(0,
+ // TQTable::cellGeometry() and TQTable::updateCell() (ipwizard)
+ TQRect cg(0,
rowPos(first->startRow()),
visibleWidth(),
rowPos(last->startRow()+last->numRowsRegister()-1) - rowPos(first->startRow()) + rowHeight(last->startRow()+last->numRowsRegister()-1));
- QRect r(contentsToViewport(QPoint (cg.x() - 2, cg.y() - 2 )), QSize(cg.width() + 4, cg.height() + 4 ));
+ TQRect r(contentsToViewport(TQPoint (cg.x() - 2, cg.y() - 2 )), TQSize(cg.width() + 4, cg.height() + 4 ));
- QRect tmp = m_lastRepaintRect | r;
+ TQRect tmp = m_lastRepaintRect | r;
if(abs(tmp.height()) > 3000) {
- // make sure that the previously triggered repaint has been done before we
+ // make sure that the previously triggered tqrepaint has been done before we
// trigger the next. Not having this used to cause some trouble when changing
// the focus within a 2000 item ledger from the last to the first item.
- QApplication::eventLoop()->processEvents(QEventLoop::ExcludeUserInput, 10);
+ TQApplication::eventLoop()->processEvents(TQEventLoop::ExcludeUserInput, 10);
}
m_lastRepaintRect = r;
- QApplication::postEvent( viewport(), new QPaintEvent( r, FALSE ) );
+ TQApplication::postEvent( viewport(), new TQPaintEvent( r, FALSE ) );
}
@@ -1477,7 +1477,7 @@ void Register::doSelectItems(int from, int to, bool selected)
// anything changed?
if(firstItem || lastItem)
- repaintItems(firstItem, lastItem);
+ tqrepaintItems(firstItem, lastItem);
}
RegisterItem* Register::itemAtRow(int row) const
@@ -1505,7 +1505,7 @@ void Register::selectedTransactions(SelectedTransactions& list) const
if(m_focusItem && m_focusItem->isSelected() && m_focusItem->isVisible()) {
Transaction* t = dynamic_cast<Transaction*>(m_focusItem);
if(t) {
- QString id;
+ TQString id;
if(t->isScheduled())
id = t->transaction().id();
SelectedTransaction s(t->transaction(), t->split(), id);
@@ -1521,7 +1521,7 @@ void Register::selectedTransactions(SelectedTransactions& list) const
if(item && item->isSelected() && item->isVisible()) {
Transaction* t = dynamic_cast<Transaction*>(item);
if(t) {
- QString id;
+ TQString id;
if(t->isScheduled())
id = t->transaction().id();
SelectedTransaction s(t->transaction(), t->split(), id);
@@ -1531,9 +1531,9 @@ void Register::selectedTransactions(SelectedTransactions& list) const
}
}
-QValueList<RegisterItem*> Register::selectedItems(void) const
+TQValueList<RegisterItem*> Register::selectedItems(void) const
{
- QValueList<RegisterItem*> list;
+ TQValueList<RegisterItem*> list;
RegisterItem* item = m_firstItem;
while(item) {
@@ -1557,7 +1557,7 @@ int Register::selectedItemsCount(void) const
return cnt;
}
-void Register::contentsMouseReleaseEvent( QMouseEvent *e )
+void Register::contentsMouseReleaseEvent( TQMouseEvent *e )
{
if(m_ignoreNextButtonRelease) {
m_ignoreNextButtonRelease = false;
@@ -1565,10 +1565,10 @@ void Register::contentsMouseReleaseEvent( QMouseEvent *e )
}
m_buttonState = e->state();
- QTable::contentsMouseReleaseEvent(e);
+ TQTable::contentsMouseReleaseEvent(e);
}
-void Register::selectItem(int row, int col, int button, const QPoint& /* mousePos */)
+void Register::selectItem(int row, int col, int button, const TQPoint& /* mousePos */)
{
if(row >= 0 && (unsigned)row < m_itemIndex.size()) {
RegisterItem* item = m_itemIndex[row];
@@ -1578,7 +1578,7 @@ void Register::selectItem(int row, int col, int button, const QPoint& /* mousePo
if(item->hasEditorOpen() || !item->isSelectable())
return;
- QString id = item->id();
+ TQString id = item->id();
selectItem(item);
// selectItem() might have changed the pointers, so we
// need to reconstruct it here
@@ -1616,9 +1616,9 @@ bool Register::setFocusItem(RegisterItem* focusItem)
if(focusItem && focusItem->canHaveFocus()) {
if(m_focusItem) {
m_focusItem->setFocus(false);
- // issue a repaint here only if we move the focus
+ // issue a tqrepaint here only if we move the focus
if(m_focusItem != focusItem)
- repaintItems(m_focusItem);
+ tqrepaintItems(m_focusItem);
}
Transaction* item = dynamic_cast<Transaction*>(focusItem);
if(m_focusItem != focusItem && item) {
@@ -1630,7 +1630,7 @@ bool Register::setFocusItem(RegisterItem* focusItem)
if(m_listsDirty)
updateRegister(KMyMoneyGlobalSettings::ledgerLens() | !KMyMoneyGlobalSettings::transactionForm());
ensureItemVisible(m_focusItem);
- repaintItems(m_focusItem);
+ tqrepaintItems(m_focusItem);
return true;
} else
return false;
@@ -1654,15 +1654,15 @@ void Register::selectItem(RegisterItem* item, bool dontChangeSelections)
// kdDebug(2) << "Register::selectItem(" << item << "): type is " << typeid(*item).name() << endl;
- Qt::ButtonState buttonState = m_buttonState;
+ TQt::ButtonState buttonState = m_buttonState;
m_buttonState = Qt::NoButton;
if(m_selectionMode == NoSelection)
return;
if(item->isSelectable()) {
- QString id = item->id();
- QValueList<RegisterItem*> itemList = selectedItems();
+ TQString id = item->id();
+ TQValueList<RegisterItem*> itemList = selectedItems();
bool okToSelect = true;
int cnt = itemList.count();
bool sameEntryType = true;
@@ -1672,7 +1672,7 @@ void Register::selectItem(RegisterItem* item, bool dontChangeSelections)
}
if(buttonState & Qt::LeftButton) {
- if(!(buttonState & (Qt::ShiftButton | Qt::ControlButton))) {
+ if(!(buttonState & (TQt::ShiftButton | TQt::ControlButton))) {
if((cnt != 1) || ((cnt == 1) && !item->isSelected())) {
emit aboutToSelectItem(item, okToSelect);
if(okToSelect) {
@@ -1688,8 +1688,8 @@ void Register::selectItem(RegisterItem* item, bool dontChangeSelections)
}
if(m_selectionMode == Multi) {
- switch(buttonState & (Qt::ShiftButton | Qt::ControlButton)) {
- case Qt::ControlButton:
+ switch(buttonState & (TQt::ShiftButton | TQt::ControlButton)) {
+ case TQt::ControlButton:
okToSelect = sameEntryType;
if(typeid(*item) == typeid(StdTransactionScheduled))
okToSelect = false;
@@ -1703,7 +1703,7 @@ void Register::selectItem(RegisterItem* item, bool dontChangeSelections)
}
break;
- case Qt::ShiftButton:
+ case TQt::ShiftButton:
okToSelect = sameEntryType;
if(typeid(*item) == typeid(StdTransactionScheduled))
okToSelect = false;
@@ -1725,7 +1725,7 @@ void Register::selectItem(RegisterItem* item, bool dontChangeSelections)
//
// a) single transaction is selected
// b) multiple transactions are selected and the one to be selected is not
- if(!(buttonState & (Qt::ShiftButton | Qt::ControlButton))) {
+ if(!(buttonState & (TQt::ShiftButton | TQt::ControlButton))) {
if((cnt > 0) && (!item->isSelected())) {
okToSelect = sameEntryType;
emit aboutToSelectItem(item, okToSelect);
@@ -1766,10 +1766,10 @@ void Register::ensureItemVisible(RegisterItem* item)
return;
m_ensureVisibleItem = item;
- QTimer::singleShot(0, this, SLOT(slotEnsureItemVisible()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotEnsureItemVisible()));
}
-void Register::slotDoubleClicked(int row, int, int, const QPoint&)
+void Register::slotDoubleClicked(int row, int, int, const TQPoint&)
{
if(row >= 0 && (unsigned)row < m_itemIndex.size()) {
RegisterItem* p = m_itemIndex[row];
@@ -1785,8 +1785,8 @@ void Register::slotDoubleClicked(int row, int, int, const QPoint&)
if(m_focusItem->isSelected()) {
// don't emit the signal right away but wait until
- // we come back to the Qt main loop
- QTimer::singleShot(0, this, SIGNAL(editTransaction()));
+ // we come back to the TQt main loop
+ TQTimer::singleShot(0, this, TQT_SIGNAL(editTransaction()));
}
}
}
@@ -1846,7 +1846,7 @@ void Register::slotEnsureItemVisible(void)
}
}
-TransactionSortField KMyMoneyRegister::textToSortOrder(const QString& text)
+TransactionSortField KMyMoneyRegister::textToSortOrder(const TQString& text)
{
for(int idx = 1; idx < static_cast<int>(MaxSortFields); ++idx) {
if(text == i18n(sortOrderText[idx])) {
@@ -1856,22 +1856,22 @@ TransactionSortField KMyMoneyRegister::textToSortOrder(const QString& text)
return UnknownSort;
}
-const QString KMyMoneyRegister::sortOrderToText(TransactionSortField idx)
+const TQString KMyMoneyRegister::sortOrderToText(TransactionSortField idx)
{
if(idx < PostDateSort || idx >= MaxSortFields)
idx = UnknownSort;
return i18n(sortOrderText[idx]);
}
-QString Register::text(int /*row*/, int /*col*/) const
+TQString Register::text(int /*row*/, int /*col*/) const
{
- return QString("a");
+ return TQString("a");
}
-QWidget* Register::cellWidget(int row, int col) const
+TQWidget* Register::cellWidget(int row, int col) const
{
// separeted here in two if()s, because this method is called for each
- // event from QTable::eventFilter and in the most cases it is -1, -1
+ // event from TQTable::eventFilter and in the most cases it is -1, -1
if(row < 0 || col < 0)
return 0;
@@ -1884,24 +1884,24 @@ QWidget* Register::cellWidget(int row, int col) const
if(!m_cellWidgets.count())
return 0;
- QWidget* w = 0;
- QPair<int, int> idx = qMakePair(row, col);
- QMap<QPair<int, int>, QWidget*>::const_iterator it_w;
+ TQWidget* w = 0;
+ TQPair<int, int> idx = tqMakePair(row, col);
+ TQMap<TQPair<int, int>, TQWidget*>::const_iterator it_w;
- it_w = m_cellWidgets.find(idx);
+ it_w = m_cellWidgets.tqfind(idx);
if(it_w != m_cellWidgets.end())
w = *it_w;
return w;
}
-void Register::insertWidget(int row, int col, QWidget* w)
+void Register::insertWidget(int row, int col, TQWidget* w)
{
if(row < 0 || col < 0 || row > numRows() - 1 || col > numCols() - 1) {
qWarning("Register::insertWidget(%d,%d) out of bounds", row, col);
return;
}
- QPair<int, int> idx = qMakePair(row, col);
+ TQPair<int, int> idx = tqMakePair(row, col);
m_cellWidgets[idx] = w;
}
@@ -1912,17 +1912,17 @@ void Register::clearCellWidget(int row, int col)
return;
}
- QPair<int, int> idx = qMakePair(row, col);
- QMap<QPair<int, int>, QWidget*>::iterator it_w;
+ TQPair<int, int> idx = tqMakePair(row, col);
+ TQMap<TQPair<int, int>, TQWidget*>::iterator it_w;
- it_w = m_cellWidgets.find(idx);
+ it_w = m_cellWidgets.tqfind(idx);
if(it_w != m_cellWidgets.end()) {
(*it_w)->deleteLater();
m_cellWidgets.remove(it_w);
}
}
-QWidget* Register::createEditor(int /*row*/, int /*col*/, bool /*initFromCell*/) const
+TQWidget* Register::createEditor(int /*row*/, int /*col*/, bool /*initFromCell*/) const
{
return 0;
}
@@ -1931,28 +1931,28 @@ void Register::setCellContentFromEditor(int /*row*/, int /*col*/)
{
}
-void Register::endEdit(int /*row*/, int /*col*/, bool /*accept*/, bool /*replace*/)
+void Register::endEdit(int /*row*/, int /*col*/, bool /*accept*/, bool /*tqreplace*/)
{
}
-void Register::arrangeEditWidgets(QMap<QString, QWidget*>& editWidgets, KMyMoneyRegister::Transaction* t)
+void Register::arrangeEditWidgets(TQMap<TQString, TQWidget*>& editWidgets, KMyMoneyRegister::Transaction* t)
{
t->arrangeWidgetsInRegister(editWidgets);
ensureItemVisible(t);
// updateContents();
}
-void Register::tabOrder(QWidgetList& tabOrderWidgets, KMyMoneyRegister::Transaction* t) const
+void Register::tabOrder(TQWidgetList& tabOrderWidgets, KMyMoneyRegister::Transaction* t) const
{
t->tabOrderInRegister(tabOrderWidgets);
}
-void Register::removeEditWidgets(QMap<QString, QWidget*>& editWidgets)
+void Register::removeEditWidgets(TQMap<TQString, TQWidget*>& editWidgets)
{
// remove pointers from map
- QMap<QString, QWidget*>::iterator it;
+ TQMap<TQString, TQWidget*>::iterator it;
for(it = editWidgets.begin(); it != editWidgets.end(); ) {
- if((*it)->parentWidget() == this) {
+ if((*it)->tqparentWidget() == this) {
editWidgets.remove(it);
it = editWidgets.begin();
} else
@@ -1980,20 +1980,20 @@ void Register::slotToggleErronousTransactions(void)
KMyMoneyRegister::RegisterItem* p = m_firstErronous;
while(p && p->prevItem() != m_lastErronous) {
if(p->isErronous())
- repaintItems(p);
+ tqrepaintItems(p);
p = p->nextItem();
}
// restart timer
- QTimer::singleShot(500, this, SLOT(slotToggleErronousTransactions()));
+ TQTimer::singleShot(500, this, TQT_SLOT(slotToggleErronousTransactions()));
}
-RegisterItem* Register::itemById(const QString& id) const
+RegisterItem* Register::itemById(const TQString& id) const
{
if(id.isEmpty())
return m_lastItem;
- for(QValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
+ for(TQValueVector<RegisterItem*>::size_type i = 0; i < m_items.size(); ++i) {
RegisterItem* item = m_items[i];
if(!item)
continue;
@@ -2097,7 +2097,7 @@ void Register::scrollPage(int key, ButtonState state)
int height = 0;
switch(key) {
- case Qt::Key_PageUp:
+ case TQt::Key_PageUp:
while(height < visibleHeight() && item->prevItem()) {
do {
item = item->prevItem();
@@ -2106,7 +2106,7 @@ void Register::scrollPage(int key, ButtonState state)
} while((!item->isSelectable() || !item->isVisible()) && item->prevItem());
}
break;
- case Qt::Key_PageDown:
+ case TQt::Key_PageDown:
while(height < visibleHeight() && item->nextItem()) {
do {
if(item->isVisible())
@@ -2116,7 +2116,7 @@ void Register::scrollPage(int key, ButtonState state)
}
break;
- case Qt::Key_Up:
+ case TQt::Key_Up:
if(item->prevItem()) {
do {
item = item->prevItem();
@@ -2124,7 +2124,7 @@ void Register::scrollPage(int key, ButtonState state)
}
break;
- case Qt::Key_Down:
+ case TQt::Key_Down:
if(item->nextItem()) {
do {
item = item->nextItem();
@@ -2132,13 +2132,13 @@ void Register::scrollPage(int key, ButtonState state)
}
break;
- case Qt::Key_Home:
+ case TQt::Key_Home:
item = m_firstItem;
while((!item->isSelectable() || !item->isVisible()) && item->nextItem())
item = item->nextItem();
break;
- case Qt::Key_End:
+ case TQt::Key_End:
item = m_lastItem;
while((!item->isSelectable() || !item->isVisible()) && item->prevItem())
item = item->prevItem();
@@ -2159,7 +2159,7 @@ void Register::scrollPage(int key, ButtonState state)
setFocusItem(item);
if(item->isSelectable()) {
- handleItemChange(oldFocusItem, state & Qt::ShiftButton, state & Qt::ControlButton);
+ handleItemChange(oldFocusItem, state & TQt::ShiftButton, state & TQt::ControlButton);
// tell the world about the changes in selection
SelectedTransactions list(this);
emit selectionChanged(list);
@@ -2169,45 +2169,45 @@ void Register::scrollPage(int key, ButtonState state)
selectItem(item);
}
-void Register::keyPressEvent(QKeyEvent* ev)
+void Register::keyPressEvent(TQKeyEvent* ev)
{
switch(ev->key()) {
- case Qt::Key_Space:
+ case TQt::Key_Space:
if(m_selectionMode != NoSelection) {
// get the state out of the event ...
m_buttonState = ev->state();
// ... and pretend that we have pressed the left mouse button ;)
- m_buttonState = static_cast<Qt::ButtonState>(m_buttonState | Qt::LeftButton);
+ m_buttonState = static_cast<TQt::ButtonState>(m_buttonState | Qt::LeftButton);
selectItem(m_focusItem);
}
break;
- case Qt::Key_PageUp:
- case Qt::Key_PageDown:
- case Qt::Key_Home:
- case Qt::Key_End:
- case Qt::Key_Down:
- case Qt::Key_Up:
+ case TQt::Key_PageUp:
+ case TQt::Key_PageDown:
+ case TQt::Key_Home:
+ case TQt::Key_End:
+ case TQt::Key_Down:
+ case TQt::Key_Up:
scrollPage(ev->key(), ev->state());
break;
default:
- QTable::keyPressEvent(ev);
+ TQTable::keyPressEvent(ev);
break;
}
}
-Transaction* Register::transactionFactory(Register *parent, const MyMoneyTransaction& transaction, const MyMoneySplit& split, int uniqueId)
+Transaction* Register::transactionFactory(Register *tqparent, const MyMoneyTransaction& transaction, const MyMoneySplit& split, int uniqueId)
{
Transaction* t = 0;
MyMoneySplit s = split;
- if(parent->account() == MyMoneyAccount()) {
- t = new KMyMoneyRegister::StdTransaction(parent, transaction, s, uniqueId);
+ if(tqparent->account() == MyMoneyAccount()) {
+ t = new KMyMoneyRegister::StdTransaction(tqparent, transaction, s, uniqueId);
return t;
}
- switch(parent->account().accountType()) {
+ switch(tqparent->account().accountType()) {
case MyMoneyAccount::Checkings:
case MyMoneyAccount::Savings:
case MyMoneyAccount::Cash:
@@ -2221,29 +2221,29 @@ Transaction* Register::transactionFactory(Register *parent, const MyMoneyTransac
case MyMoneyAccount::AssetLoan:
case MyMoneyAccount::Equity:
if(s.accountId().isEmpty())
- s.setAccountId(parent->account().id());
+ s.setAccountId(tqparent->account().id());
if(s.isMatched())
- t = new KMyMoneyRegister::StdTransactionMatched(parent, transaction, s, uniqueId);
+ t = new KMyMoneyRegister::StdTransactionMatched(tqparent, transaction, s, uniqueId);
else if(transaction.isImported())
- t = new KMyMoneyRegister::StdTransactionDownloaded(parent, transaction, s, uniqueId);
+ t = new KMyMoneyRegister::StdTransactionDownloaded(tqparent, transaction, s, uniqueId);
else
- t = new KMyMoneyRegister::StdTransaction(parent, transaction, s, uniqueId);
+ t = new KMyMoneyRegister::StdTransaction(tqparent, transaction, s, uniqueId);
break;
case MyMoneyAccount::Investment:
if(s.isMatched())
- t = new KMyMoneyRegister::InvestTransaction/* Matched */(parent, transaction, s, uniqueId);
+ t = new KMyMoneyRegister::InvestTransaction/* Matched */(tqparent, transaction, s, uniqueId);
else if(transaction.isImported())
- t = new KMyMoneyRegister::InvestTransactionDownloaded(parent, transaction, s, uniqueId);
+ t = new KMyMoneyRegister::InvestTransactionDownloaded(tqparent, transaction, s, uniqueId);
else
- t = new KMyMoneyRegister::InvestTransaction(parent, transaction, s, uniqueId);
+ t = new KMyMoneyRegister::InvestTransaction(tqparent, transaction, s, uniqueId);
break;
case MyMoneyAccount::CertificateDep:
case MyMoneyAccount::MoneyMarket:
case MyMoneyAccount::Stock:
default:
- qDebug("Register::transactionFactory: invalid accountTypeE %d", parent->account().accountType());
+ qDebug("Register::transactionFactory: invalid accountTypeE %d", tqparent->account().accountType());
break;
}
return t;
@@ -2251,25 +2251,25 @@ Transaction* Register::transactionFactory(Register *parent, const MyMoneyTransac
void Register::addGroupMarkers(void)
{
- QMap<QString, int> list;
- QMap<QString, int>::const_iterator it;
+ TQMap<TQString, int> list;
+ TQMap<TQString, int>::const_iterator it;
KMyMoneyRegister::RegisterItem* p = firstItem();
KMyMoneyRegister::Transaction* t;
- QString name;
- QDate today;
- QDate yesterday, thisWeek, lastWeek;
- QDate thisMonth, lastMonth;
- QDate thisYear;
+ TQString name;
+ TQDate today;
+ TQDate yesterday, thisWeek, lastWeek;
+ TQDate thisMonth, lastMonth;
+ TQDate thisYear;
int weekStartOfs;
switch(primarySortKey()) {
case KMyMoneyRegister::PostDateSort:
case KMyMoneyRegister::EntryDateSort:
- today = QDate::currentDate();
+ today = TQDate::tqcurrentDate();
thisMonth.setYMD(today.year(), today.month(), 1);
lastMonth = thisMonth.addMonths(-1);
yesterday = today.addDays(-1);
- // a = QDate::dayOfWeek() todays weekday (1 = Monday, 7 = Sunday)
+ // a = TQDate::dayOfWeek() todays weekday (1 = Monday, 7 = Sunday)
// b = KLocale::weekStartDay() first day of week (1 = Monday, 7 = Sunday)
weekStartOfs = today.dayOfWeek() - KGlobal::locale()->weekStartDay();
if(weekStartOfs < 0) {
@@ -2278,7 +2278,7 @@ void Register::addGroupMarkers(void)
thisWeek = today.addDays(-weekStartOfs);
lastWeek = thisWeek.addDays(-7);
thisYear.setYMD(today.year(), 1, 1);
- if(KMyMoneyGlobalSettings::startDate().date() != QDate(1900,1,1))
+ if(KMyMoneyGlobalSettings::startDate().date() != TQDate(1900,1,1))
new KMyMoneyRegister::FancyDateGroupMarker(this, KMyMoneyGlobalSettings::startDate().date(), i18n("Prior transactions possibly filtered"));
if(KMyMoneyGlobalSettings::showFancyMarker()) {
@@ -2290,8 +2290,8 @@ void Register::addGroupMarkers(void)
MyMoneyMoney balance(m_account.value("lastStatementBalance"));
if(m_account.accountGroup() == MyMoneyAccount::Liability)
balance = -balance;
- QString txt = i18n("Online Statement Balance: %1").arg(balance.formatMoney(m_account.fraction()));
- new KMyMoneyRegister::StatementGroupMarker(this, KMyMoneyRegister::Deposit, QDate::fromString(m_account.value("lastImportedTransactionDate"), Qt::ISODate), txt);
+ TQString txt = i18n("Online Statement Balance: %1").tqarg(balance.formatMoney(m_account.fraction()));
+ new KMyMoneyRegister::StatementGroupMarker(this, KMyMoneyRegister::Deposit, TQDate::fromString(m_account.value("lastImportedTransactionDate"), Qt::ISODate), txt);
}
new KMyMoneyRegister::FancyDateGroupMarker(this, thisYear, i18n("This year"));
@@ -2309,11 +2309,11 @@ void Register::addGroupMarkers(void)
new KMyMoneyRegister::SimpleDateGroupMarker(this, today.addDays(1), i18n("Future transactions"));
}
if(KMyMoneyGlobalSettings::showFiscalMarker()) {
- QDate currentFiscalYear(QDate::currentDate().year(), KMyMoneyGlobalSettings::firstFiscalMonth(), KMyMoneyGlobalSettings::firstFiscalDay());
+ TQDate currentFiscalYear(TQDate::tqcurrentDate().year(), KMyMoneyGlobalSettings::firstFiscalMonth(), KMyMoneyGlobalSettings::firstFiscalDay());
- if(QDate::currentDate() < currentFiscalYear)
+ if(TQDate::tqcurrentDate() < currentFiscalYear)
currentFiscalYear = currentFiscalYear.addYears(-1);
- QDate previousFiscalYear = currentFiscalYear.addYears(-1);
+ TQDate previousFiscalYear = currentFiscalYear.addYears(-1);
new KMyMoneyRegister::FiscalYearGroupMarker(this, currentFiscalYear, i18n("Current fiscal year"));
new KMyMoneyRegister::FiscalYearGroupMarker(this, currentFiscalYear.addYears(-1), i18n("Previous fiscal year"));
new KMyMoneyRegister::FiscalYearGroupMarker(this, currentFiscalYear.addYears(1), i18n("Next fiscal year"));