From fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 5 Jul 2011 06:00:29 +0000 Subject: 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 --- kmymoney2/widgets/kmymoneyselector.h | 109 ++++++++++++++++++----------------- 1 file changed, 55 insertions(+), 54 deletions(-) (limited to 'kmymoney2/widgets/kmymoneyselector.h') diff --git a/kmymoney2/widgets/kmymoneyselector.h b/kmymoney2/widgets/kmymoneyselector.h index 2b389d6..c55ac47 100644 --- a/kmymoney2/widgets/kmymoneyselector.h +++ b/kmymoney2/widgets/kmymoneyselector.h @@ -21,9 +21,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -class QHBoxLayout; +#include +#include +class TQHBoxLayout; // ---------------------------------------------------------------------------- // KDE Includes @@ -50,34 +50,35 @@ class KListView; * out of the set of displayed items. Selection is performed * by marking the item in the view. */ -class KMyMoneySelector : public QWidget +class KMyMoneySelector : public TQWidget { Q_OBJECT + TQ_OBJECT public: - KMyMoneySelector(QWidget *parent=0, const char *name=0, QWidget::WFlags flags = 0); + KMyMoneySelector(TQWidget *tqparent=0, const char *name=0, TQWidget::WFlags flags = 0); virtual ~KMyMoneySelector(); /** * This method sets the mode of operation of this widget. - * Supported values are @p QListView::Single and @p QListView::Multi. + * Supported values are @p TQListView::Single and @p TQListView::Multi. * - * @param mode @p QListView::Single selects single selection mode and - * @p QListView::Multi selects multi selection mode + * @param mode @p TQListView::Single selects single selection mode and + * @p TQListView::Multi selects multi selection mode * - * @note When the widget is created, it defaults to QListView::Single. + * @note When the widget is created, it defaults to TQListView::Single. * Any items loaded into the widget will be cleared if the mode changes. * Changing the selection mode also changes the type of the items * created through newItem(). You should therefor set the selection mode * before you create items. */ - void setSelectionMode(const QListView::SelectionMode mode); + void setSelectionMode(const TQListView::SelectionMode mode); /** * returns the selection mode of the widget. * * @sa setSelectionMode() */ - QListView::SelectionMode selectionMode(void) const { return m_selMode; } + TQListView::SelectionMode selectionMode(void) const { return m_selMode; } /** * This method returns the list of selected item ids. If @@ -86,7 +87,7 @@ public: * * @param list reference to id list */ - void selectedItems(QStringList& list) const; + void selectedItems(TQStringList& list) const; /** * Convenience method for above method. Requires more resources. @@ -94,7 +95,7 @@ public: * * @todo Deprecated after 1.0 */ - QStringList selectedItems(void) const; + TQStringList selectedItems(void) const; /** * This method returns the list of all item ids. @@ -102,7 +103,7 @@ public: * * @param list reference to id list */ - void itemList(QStringList& list) const; + void itemList(TQStringList& list) const; /** * Convenience method for above method. Requires more resources. @@ -110,7 +111,7 @@ public: * * @todo Deprecated after 1.0 */ - QStringList itemList(void) const; + TQStringList itemList(void) const; /** * This method returns an information if all items @@ -133,7 +134,7 @@ public: * @p true checked * @p false not checked (default) */ - void setSelected(const QString& id, const bool state = false); + void setSelected(const TQString& id, const bool state = false); /** * Return a pointer to the KListView object @@ -157,7 +158,7 @@ public: * @param itemList of item ids to apply @p state to * @param state select items if @p true, deselect otherwise */ - void selectItems(const QStringList& itemList, const bool state); + void selectItems(const TQStringList& itemList, const bool state); /** * Protect an entry from selection. Protection is controlled by @@ -167,7 +168,7 @@ public: * @param protect if true, the entry specified by @p accId cannot be * selected. If false, it can be selected. Defaults to @p true. */ - void protectItem(const QString& itemId, const bool protect = true); + void protectItem(const TQString& itemId, const bool protect = true); /** * This method modifies the width of the widget to match its optimal size @@ -178,25 +179,25 @@ public: /** * This method removes an item with a given id from the list. * - * @param id QString containing id of item to be removed + * @param id TQString containing id of item to be removed */ - void removeItem(const QString& id); + void removeItem(const TQString& id); /** * This method creates a new top level KMyMoneyCheckListItem object in the list view. * The type can be influenced with the @a type argument. It defaults - * to QCheckListItem::RadioButtonController. If @a id is empty, the item is not - * selectable. It will be shown 'opened' (see QListViewItem::setOpen()) + * to TQCheckListItem::RadioButtonController. If @a id is empty, the item is not + * selectable. It will be shown 'opened' (see TQListViewItem::setOpen()) * * @return pointer to newly created object */ - QListViewItem* newItem(const QString& name, const QString& key = QString(), const QString& id = QString(), QCheckListItem::Type type = QCheckListItem::RadioButtonController); + TQListViewItem* newItem(const TQString& name, const TQString& key = TQString(), const TQString& id = TQString(), TQCheckListItem::Type type = TQCheckListItem::RadioButtonController); /** * Same as above, but create the item following the item pointed to by @c after. * If @c after is 0, then behave as previous method */ - QListViewItem* newItem(const QString& name, QListViewItem* after, const QString& key = QString(), const QString& id = QString(), QCheckListItem::Type type = QCheckListItem::RadioButtonController); + TQListViewItem* newItem(const TQString& name, TQListViewItem* after, const TQString& key = TQString(), const TQString& id = TQString(), TQCheckListItem::Type type = TQCheckListItem::RadioButtonController); /** * This method creates a new selectable object depending on the @@ -205,20 +206,20 @@ public: * * @note The new item will be the first one in the selection * - * @param parent pointer to parent item + * @param tqparent pointer to tqparent item * @param name the displayed name * @param key String to be used for completion. If empty defaults to @a name * @param id the id used to identify the objects * * @return pointer to newly created object */ - QListViewItem* newItem(QListViewItem* parent, const QString& name, const QString& key, const QString& id); + TQListViewItem* newItem(TQListViewItem* tqparent, const TQString& name, const TQString& key, const TQString& id); /** * This method creates a new selectable object depending on the * selection mode. This is either a KListViewItem for single * selection mode or a KMyMoneyCheckListItem for multi selection mode. - * In contrast to the above method, the parent is always the view. + * In contrast to the above method, the tqparent is always the view. * * @note The new item will be the first one in the selection * @@ -228,47 +229,47 @@ public: * * @return pointer to newly created object */ - QListViewItem* newTopItem(const QString& name, const QString& key, const QString& id); + TQListViewItem* newTopItem(const TQString& name, const TQString& key, const TQString& id); /** * This method checks if a given @a item matches the given regular expression @a exp. * * @param exp const reference to a regular expression object - * @param item pointer to QListViewItem + * @param item pointer to TQListViewItem * * @retval true item matches * @retval false item does not match */ - virtual bool match(const QRegExp& exp, QListViewItem* item) const; + virtual bool match(const TQRegExp& exp, TQListViewItem* item) const; /** * This method delays the call for m_listView->ensureItemVisible(item) * for about 10ms. This seems to be necessary when the widget is not (yet) * visible on the screen after creation. * - * @param item pointer to QListViewItem that should be made visible + * @param item pointer to TQListViewItem that should be made visible * * @sa slotShowSelected() */ - void ensureItemVisible(const QListViewItem *item); + void ensureItemVisible(const TQListViewItem *item); /** - * This method returns a pointer to the QListViewItem with the id @a id. + * This method returns a pointer to the TQListViewItem with the id @a id. * If such an item is not contained in the list, @a 0 will be returned. * - * @param id id to be used to find a QListViewItem pointer for + * @param id id to be used to find a TQListViewItem pointer for */ - QListViewItem* item(const QString& id) const; + TQListViewItem* item(const TQString& id) const; /** - * This method returns, if any of the items in the selector contains + * This method returns, if any of the items in the selector tqcontains * the text @a txt. * * @param txt const reference to string to be looked for * @retval true exact match found * @retval false no match found */ - virtual bool contains(const QString& txt) const; + virtual bool tqcontains(const TQString& txt) const; /** * Clears all items of the selector and the associated listview. @@ -296,7 +297,7 @@ public slots: signals: void stateChanged(void); - void itemSelected(const QString& id); + void itemSelected(const TQString& id); protected: /** @@ -305,14 +306,14 @@ protected: * @param list list of selected ids * @param item pointer to item to start with */ - void selectedItems(QStringList& list, QListViewItem* item) const; + void selectedItems(TQStringList& list, TQListViewItem* item) const; /** * Helper method for allItemsSelected() to traverse the tree. * * @param item pointer to item to start with */ - bool allItemsSelected(const QListViewItem *item) const; + bool allItemsSelected(const TQListViewItem *item) const; /** * This is a helper method for selectAllItems(). @@ -320,7 +321,7 @@ protected: * @param item pointer to item to start with * @param state selection state (@a true = selected, @a false = not selected) */ - void selectAllSubItems(QListViewItem* item, const bool state); + void selectAllSubItems(TQListViewItem* item, const bool state); /** * This is a helper method for selectItems(). @@ -329,25 +330,25 @@ protected: * @param itemList list of ids to be selected * @param state selection state (@a true = selected, @a false = not selected) */ - void selectSubItems(QListViewItem* item, const QStringList& itemList, const bool state); + void selectSubItems(TQListViewItem* item, const TQStringList& itemList, const bool state); public slots: /** * Hide all listview items that do not match the regular expression @a exp. * This method returns the number of visible items * - * @param exp const reference to QRegExp that an item must match to stay visible + * @param exp const reference to TQRegExp that an item must match to stay visible * * @return number of visible items */ - int slotMakeCompletion(const QRegExp& exp); + int slotMakeCompletion(const TQRegExp& exp); /** * This is an overloaded member function, provided for convenience. It behaves essentially like the above function. * - * @param txt contains the pattern for a QRegExp + * @param txt contains the pattern for a TQRegExp */ - int slotMakeCompletion(const QString& txt); + int slotMakeCompletion(const TQString& txt); protected slots: @@ -356,14 +357,14 @@ protected slots: * calls m_listView->ensureItemVisible() for the last selected item * in this widget. * - * @sa ensureItemVisible(), setSelected(const QString&) + * @sa ensureItemVisible(), setSelected(const TQString&) */ void slotShowSelected(void); /** * This slot is connected to the KListView executed signal */ - void slotItemSelected(QListViewItem *it_v); + void slotItemSelected(TQListViewItem *it_v); /** * This slot processes the right mouse button press on a list view item. @@ -371,17 +372,17 @@ protected slots: * @param it_v pointer to list view item that was pressed * @param p the position where the mouse was pressed */ - void slotListRightMouse(QListViewItem* it_v, const QPoint& p, int /* col */); + void slotListRightMouse(TQListViewItem* it_v, const TQPoint& p, int /* col */); protected: KListView* m_listView; - QStringList m_itemList; - QString m_baseName; - QListView::SelectionMode m_selMode; - QHBoxLayout* m_layout; + TQStringList m_itemList; + TQString m_baseName; + TQListView::SelectionMode m_selMode; + TQHBoxLayout* m_layout; private: - const QListViewItem* m_visibleItem; + const TQListViewItem* m_visibleItem; }; #endif -- cgit v1.2.3