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/register.h | |
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/register.h')
-rw-r--r-- | kmymoney2/widgets/register.h | 183 |
1 files changed, 92 insertions, 91 deletions
diff --git a/kmymoney2/widgets/register.h b/kmymoney2/widgets/register.h index d9d2627..bc59ff6 100644 --- a/kmymoney2/widgets/register.h +++ b/kmymoney2/widgets/register.h @@ -28,13 +28,13 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qtable.h> -#include <qvaluelist.h> -#include <qvaluevector.h> -#include <qwidgetlist.h> -#include <qmap.h> -#include <qpair.h> -#include <qevent.h> +#include <tqtable.h> +#include <tqvaluelist.h> +#include <tqvaluevector.h> +#include <tqwidgetlist.h> +#include <tqmap.h> +#include <tqpair.h> +#include <tqevent.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -81,27 +81,27 @@ class Register; class RegisterItem; class ItemPtrVector; -const QString sortOrderToText(TransactionSortField idx); -TransactionSortField textToSortOrder(const QString& text); +const TQString sortOrderToText(TransactionSortField idx); +TransactionSortField textToSortOrder(const TQString& text); -class QWidgetContainer : public QMap<QString, QWidget*> +class TQWidgetContainer : public TQMap<TQString, TQWidget*> { public: - QWidgetContainer() {} + TQWidgetContainer() {} - QWidget* haveWidget(const QString& name) const { - QWidgetContainer::const_iterator it_w; - it_w = find(name); + TQWidget* haveWidget(const TQString& name) const { + TQWidgetContainer::const_iterator it_w; + it_w = tqfind(name); if(it_w != end()) return *it_w; return 0; } void removeOrphans(void) { - QWidgetContainer::iterator it_w; + TQWidgetContainer::iterator it_w; for(it_w = begin(); it_w != end(); ) { - if((*it_w) && (*it_w)->parent()) + if((*it_w) && (*it_w)->tqparent()) ++it_w; else { delete (*it_w); @@ -116,10 +116,10 @@ public: class GroupMarker : public RegisterItem { public: - GroupMarker(Register* parent, const QString& txt = QString()); + GroupMarker(Register* tqparent, const TQString& txt = TQString()); ~GroupMarker(); - void setText(const QString& txt) { m_txt = txt; } - const QString& text(void) const { return m_txt; } + void setText(const TQString& txt) { m_txt = txt; } + const TQString& text(void) const { return m_txt; } bool isSelectable(void) const { return false; } bool canHaveFocus(void) const { return false; } int numRows(void) const { return 1; } @@ -128,23 +128,23 @@ public: bool isErronous(void) const { return false; } - void paintRegisterCell(QPainter* painter, int row, int col, const QRect& r, bool selected, const QColorGroup& cg); - void paintFormCell(QPainter* /* painter */, int /* row */, int /* col */, const QRect& /* r */, bool /* selected */, const QColorGroup& /* cg */) {} + void paintRegisterCell(TQPainter* painter, int row, int col, const TQRect& r, bool selected, const TQColorGroup& cg); + void paintFormCell(TQPainter* /* painter */, int /* row */, int /* col */, const TQRect& /* r */, bool /* selected */, const TQColorGroup& /* cg */) {} int rowHeightHint(void) const; - bool matches(const QString&) const { return true; } + bool matches(const TQString&) const { return true; } virtual int sortSamePostDate(void) const { return 0; } protected: - void setupColors(QColorGroup& cg); + void setupColors(TQColorGroup& cg); protected: - QString m_txt; + TQString m_txt; unsigned int m_drawCounter; bool m_showDate; - static QPixmap* m_bg; + static TQPixmap* m_bg; static int m_bgRefCnt; }; @@ -152,19 +152,19 @@ protected: class FancyDateGroupMarker : public GroupMarker { public: - FancyDateGroupMarker(Register* parent, const QDate& date, const QString& txt); + FancyDateGroupMarker(Register* tqparent, const TQDate& date, const TQString& txt); - virtual const QDate& sortPostDate(void) const { return m_date; } - virtual const QDate& sortEntryDate(void) const { return m_date; } + virtual const TQDate& sortPostDate(void) const { return m_date; } + virtual const TQDate& sortEntryDate(void) const { return m_date; } virtual const char* className(void) { return "FancyDateGroupMarker"; } private: - QDate m_date; + TQDate m_date; }; class StatementGroupMarker : public FancyDateGroupMarker { public: - StatementGroupMarker(Register* parent, CashFlowDirection dir, const QDate& date, const QString& txt ); + StatementGroupMarker(Register* tqparent, CashFlowDirection dir, const TQDate& date, const TQString& txt ); CashFlowDirection sortType(void) const { return m_dir; } virtual int sortSamePostDate(void) const { return 3; } private: @@ -174,8 +174,8 @@ private: class SimpleDateGroupMarker : public FancyDateGroupMarker { public: - SimpleDateGroupMarker(Register* parent, const QDate& date, const QString& txt); - void paintRegisterCell(QPainter* painter, int row, int col, const QRect& r, bool selected, const QColorGroup& cg); + SimpleDateGroupMarker(Register* tqparent, const TQDate& date, const TQString& txt); + void paintRegisterCell(TQPainter* painter, int row, int col, const TQRect& r, bool selected, const TQColorGroup& cg); int rowHeightHint(void) const; virtual const char* className(void) { return "SimpleDateGroupMarker"; } }; @@ -183,7 +183,7 @@ public: class TypeGroupMarker : public GroupMarker { public: - TypeGroupMarker(Register* parent, CashFlowDirection dir, MyMoneyAccount::accountTypeE accType); + TypeGroupMarker(Register* tqparent, CashFlowDirection dir, MyMoneyAccount::accountTypeE accType); CashFlowDirection sortType(void) const { return m_dir; } private: CashFlowDirection m_dir; @@ -192,27 +192,27 @@ private: class FiscalYearGroupMarker : public FancyDateGroupMarker { public: - FiscalYearGroupMarker(Register* parent, const QDate& date, const QString& txt); + FiscalYearGroupMarker(Register* tqparent, const TQDate& date, const TQString& txt); virtual const char* className(void) { return "FiscalYearGroupMarker"; } virtual int sortSamePostDate(void) const { return 1; } protected: - void setupColors(QColorGroup& cg); + void setupColors(TQColorGroup& cg); }; class PayeeGroupMarker : public GroupMarker { public: - PayeeGroupMarker(Register* parent, const QString& name); - const QString& sortPayee(void) const { return m_txt; } + PayeeGroupMarker(Register* tqparent, const TQString& name); + const TQString& sortPayee(void) const { return m_txt; } }; class CategoryGroupMarker : public GroupMarker { public: - CategoryGroupMarker(Register* parent, const QString& category); - const QString& sortCategory(void) const { return m_txt; } - const QString& sortSecurity(void) const { return m_txt; } + CategoryGroupMarker(Register* tqparent, const TQString& category); + const TQString& sortCategory(void) const { return m_txt; } + const TQString& sortSecurity(void) const { return m_txt; } virtual const char* className(void) { return "CategoryGroupMarker"; } }; @@ -220,14 +220,14 @@ public: class ReconcileGroupMarker : public GroupMarker { public: - ReconcileGroupMarker(Register* parent, MyMoneySplit::reconcileFlagE state); + ReconcileGroupMarker(Register* tqparent, MyMoneySplit::reconcileFlagE state); virtual MyMoneySplit::reconcileFlagE sortReconcileState(void) const { return m_state; } private: MyMoneySplit::reconcileFlagE m_state; }; -class ItemPtrVector : public QValueVector<RegisterItem *> +class ItemPtrVector : public TQValueVector<RegisterItem *> { public: ItemPtrVector() {} @@ -245,16 +245,17 @@ protected: class Register : public TransactionEditorContainer { Q_OBJECT + TQ_OBJECT - // friend class QHeader; - // friend class QTableHeader; + // friend class TQHeader; + // friend class TQTableHeader; // friend class RegisterItem; friend class Transaction; friend class StdTransaction; friend class InvestTransaction; public: - Register(QWidget *parent = 0, const char *name = 0); + Register(TQWidget *tqparent = 0, const char *name = 0); virtual ~Register(); /** @@ -276,39 +277,39 @@ public: * This method returns a list of pointers to all selected items * in the register * - * @retval QValueList<RegisterItem*> + * @retval TQValueList<RegisterItem*> */ - QValueList<RegisterItem*> selectedItems(void) const; + TQValueList<RegisterItem*> selectedItems(void) const; /** * Construct a list of all currently selected transactions in the register. * If the current item carrying the focus (see focusItem() ) is selected * it will be the first one contained in the list. * - * @param list reference to QValueList receiving the SelectedTransaction()'s + * @param list reference to TQValueList receiving the SelectedTransaction()'s */ void selectedTransactions(SelectedTransactions& list) const; - QString text(int row, int col) const; - QWidget* createEditor(int row, int col, bool initFromCell) const; + TQString text(int row, int col) const; + TQWidget* createEditor(int row, int col, bool initFromCell) const; void setCellContentFromEditor(int row, int col); - QWidget* cellWidget(int row, int col) const; - void endEdit(int row, int col, bool accept, bool replace); - void paintCell(QPainter* painter, int row, int col, const QRect& r, bool selected, const QColorGroup& cg); + TQWidget* cellWidget(int row, int col) const; + void endEdit(int row, int col, bool accept, bool tqreplace); + void paintCell(TQPainter* painter, int row, int col, const TQRect& r, bool selected, const TQColorGroup& cg); void resizeData(int) {} - QTableItem* item(int, int) { return 0; } - void setItem(int, int, QTableItem*) {} + TQTableItem* item(int, int) { return 0; } + void setItem(int, int, TQTableItem*) {} void clearCell(int, int) {} void clearCellWidget(int, int); /** - * Override the QTable member function to avoid display of focus + * Override the TQTable member function to avoid display of focus */ - void paintFocus(QPainter*, const QRect& ) {} + void paintFocus(TQPainter*, const TQRect& ) {} /** - * Override the QTable member function to avoid functionality + * Override the TQTable member function to avoid functionality */ void updateCell(int /* row */, int /* col */) {} @@ -374,10 +375,10 @@ public: * Show the columns contained in @a cols for @a account. @a account * can be left empty ( MyMoneyAccount() ) e.g. for the search dialog. */ - void setupRegister(const MyMoneyAccount& account, const QValueList<Column>& cols); + void setupRegister(const MyMoneyAccount& account, const TQValueList<Column>& cols); - void setSortOrder(const QString& order); - const QValueList<TransactionSortField>& sortOrder(void) const { return m_sortOrder; } + void setSortOrder(const TQString& order); + const TQValueList<TransactionSortField>& sortOrder(void) const { return m_sortOrder; } TransactionSortField primarySortKey(void) const; void sortItems(void); @@ -403,9 +404,9 @@ public: void ensureItemVisible(RegisterItem* item); - void arrangeEditWidgets(QMap<QString, QWidget*>& editWidgets, Transaction* t); - void removeEditWidgets(QMap<QString, QWidget*>& editWidgets); - void tabOrder(QWidgetList& tabOrderWidgets, KMyMoneyRegister::Transaction* t) const; + void arrangeEditWidgets(TQMap<TQString, TQWidget*>& editWidgets, Transaction* t); + void removeEditWidgets(TQMap<TQString, TQWidget*>& editWidgets); + void tabOrder(TQWidgetList& tabOrderWidgets, KMyMoneyRegister::Transaction* t) const; int rowHeightHint(void) const; @@ -417,18 +418,18 @@ public: * This method creates a specifc transaction according to the * transaction passed in @a transaction. * - * @param parent pointer to register where the created object should be added + * @param tqparent pointer to register where the created object should be added * @param transaction the transaction which should be used to create the object * @param split the split of the transaction which should be used to create the object * @param uniqueId an int that will be used to construct the id of the item * * @return pointer to created object (0 upon failure) */ - static Transaction* transactionFactory(Register *parent, const MyMoneyTransaction& transaction, const MyMoneySplit& split, int uniqueId); + static Transaction* transactionFactory(Register *tqparent, const MyMoneyTransaction& transaction, const MyMoneySplit& split, int uniqueId); const MyMoneyAccount& account(void) const { return m_account; } - void repaintItems(RegisterItem* first = 0, RegisterItem* last = 0); + void tqrepaintItems(RegisterItem* first = 0, RegisterItem* last = 0); unsigned int drawCounter(void) const { return m_drawCounter; } @@ -447,25 +448,25 @@ public: void setLedgerLensForced(bool forced=true) { m_ledgerLensForced = forced; } /** - * Sets the selection mode to @a mode. Supported modes are QTable::Single and - * QTable::Multi. QTable::Multi is the default when the object is created. + * Sets the selection mode to @a mode. Supported modes are TQTable::Single and + * TQTable::Multi. TQTable::Multi is the default when the object is created. */ void setSelectionMode(SelectionMode mode) { m_selectionMode = mode; } protected: - void drawContents(QPainter *p, int cx, int cy, int cw, int ch); + void drawContents(TQPainter *p, int cx, int cy, int cw, int ch); - void contentsMouseReleaseEvent( QMouseEvent *e ); + void contentsMouseReleaseEvent( TQMouseEvent *e ); void unselectItems(int from = -1, int to = -1) { doSelectItems(from, to, false); } void selectItems(int from, int to) { doSelectItems(from, to, true); } void doSelectItems(int from, int to, bool selected); int selectedItemsCount(void) const; - void focusOutEvent(QFocusEvent*); - void focusInEvent(QFocusEvent*); - void keyPressEvent(QKeyEvent*); + void focusOutEvent(TQFocusEvent*); + void focusInEvent(TQFocusEvent*); + void keyPressEvent(TQKeyEvent*); int rowToIndex(int row) const; void setupItemIndex(int rowCount); @@ -475,9 +476,9 @@ protected: * further down or up in the ledger from the previous focus item. * The height to scroll is determined by visibleHeight() * - * @param key Qt::Page_Up or Qt::Page_Down depending on the direction to scroll - * @param state state of Qt::ShiftButton, Qt::ControlButton, Qt::AltButton and - * Qt::MetaButton. + * @param key TQt::Page_Up or TQt::Page_Down depending on the direction to scroll + * @param state state of TQt::ShiftButton, TQt::ControlButton, TQt::AltButton and + * TQt::MetaButton. */ void scrollPage(int key, ButtonState state); @@ -489,32 +490,32 @@ protected: * @param id id of the item to be searched * @return pointer to RegisterItem or 0 if not found */ - RegisterItem* itemById(const QString& id) const; + RegisterItem* itemById(const TQString& id) const; - void insertWidget(int row, int col, QWidget* w); + void insertWidget(int row, int col, TQWidget* w); /** - * Override logic and use standard QFrame behaviour + * Override logic and use standard TQFrame behaviour */ bool focusNextPrevChild(bool next); - bool eventFilter(QObject* o, QEvent* e); + bool eventFilter(TQObject* o, TQEvent* e); void handleItemChange(RegisterItem* old, bool shift, bool control); void selectRange(RegisterItem* from, RegisterItem* to, bool invert, bool includeFirst, bool clearSel); // DND - void dragMoveEvent(QDragMoveEvent* event); - void dropEvent(QDropEvent* event); - Transaction* dropTransaction(QPoint cPos) const; + void dragMoveEvent(TQDragMoveEvent* event); + void dropEvent(TQDropEvent* event); + Transaction* dropTransaction(TQPoint cPos) const; protected slots: void resize(void); - void selectItem(int row, int col, int button, const QPoint & mousePos ); + void selectItem(int row, int col, int button, const TQPoint & mousePos ); void slotEnsureItemVisible(void); - void slotDoubleClicked(int, int, int, const QPoint&); + void slotDoubleClicked(int, int, int, const TQPoint&); void slotToggleErronousTransactions(void); void slotAutoColumnSizing(int section); @@ -569,7 +570,7 @@ signals: protected: ItemPtrVector m_items; - QValueVector<RegisterItem*> m_itemIndex; + TQValueVector<RegisterItem*> m_itemIndex; RegisterItem* m_selectAnchor; RegisterItem* m_focusItem; RegisterItem* m_ensureVisibleItem; @@ -590,12 +591,12 @@ private: bool m_listsDirty; bool m_ignoreNextButtonRelease; bool m_needInitialColumnResize; - Qt::ButtonState m_buttonState; + TQt::ButtonState m_buttonState; Column m_lastCol; - QValueList<TransactionSortField> m_sortOrder; - QMap<QPair<int, int>, QWidget*> m_cellWidgets; + TQValueList<TransactionSortField> m_sortOrder; + TQMap<TQPair<int, int>, TQWidget*> m_cellWidgets; RegisterToolTip* m_tooltip; - QRect m_lastRepaintRect; + TQRect m_lastRepaintRect; unsigned int m_drawCounter; }; |