summaryrefslogtreecommitdiffstats
path: root/kmymoney2/widgets/kmymoneyselector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/widgets/kmymoneyselector.cpp')
-rw-r--r--kmymoney2/widgets/kmymoneyselector.cpp294
1 files changed, 147 insertions, 147 deletions
diff --git a/kmymoney2/widgets/kmymoneyselector.cpp b/kmymoney2/widgets/kmymoneyselector.cpp
index 6ae07ca..5e16bf1 100644
--- a/kmymoney2/widgets/kmymoneyselector.cpp
+++ b/kmymoney2/widgets/kmymoneyselector.cpp
@@ -18,11 +18,11 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qlayout.h>
-#include <qheader.h>
-#include <qtimer.h>
-#include <qstyle.h>
-#include <qregexp.h>
+#include <tqlayout.h>
+#include <tqheader.h>
+#include <tqtimer.h>
+#include <tqstyle.h>
+#include <tqregexp.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -36,25 +36,25 @@
#include "../kmymoneyglobalsettings.h"
-KMyMoneySelector::KMyMoneySelector(QWidget *parent, const char *name, QWidget::WFlags flags) :
- QWidget(parent, name, flags)
+KMyMoneySelector::KMyMoneySelector(TQWidget *tqparent, const char *name, TQWidget::WFlags flags) :
+ TQWidget(tqparent, name, flags)
{
- m_selMode = QListView::Single;
+ m_selMode = TQListView::Single;
m_listView = new KListView(this);
// don't show horizontal scroll bar
- m_listView->setHScrollBarMode(QScrollView::AlwaysOff);
+ m_listView->setHScrollBarMode(TQScrollView::AlwaysOff);
m_listView->setSorting(-1);
- if(parent) {
- setFocusProxy(parent->focusProxy());
- m_listView->setFocusProxy(parent->focusProxy());
+ if(tqparent) {
+ setFocusProxy(tqparent->focusProxy());
+ m_listView->setFocusProxy(tqparent->focusProxy());
}
m_listView->setAllColumnsShowFocus(true);
- m_layout = new QHBoxLayout( this, 0, 6);
+ m_layout = new TQHBoxLayout( this, 0, 6);
m_listView->addColumn( "Hidden" );
m_listView->header()->hide();
@@ -64,10 +64,10 @@ KMyMoneySelector::KMyMoneySelector(QWidget *parent, const char *name, QWidget::W
m_layout->addWidget( m_listView );
// force init
- m_selMode = QListView::Multi;
- setSelectionMode(QListView::Single);
+ m_selMode = TQListView::Multi;
+ setSelectionMode(TQListView::Single);
- connect(m_listView, SIGNAL(rightButtonPressed(QListViewItem* , const QPoint&, int)), this, SLOT(slotListRightMouse(QListViewItem*, const QPoint&, int)));
+ connect(m_listView, TQT_SIGNAL(rightButtonPressed(TQListViewItem* , const TQPoint&, int)), this, TQT_SLOT(slotListRightMouse(TQListViewItem*, const TQPoint&, int)));
}
KMyMoneySelector::~KMyMoneySelector()
@@ -80,28 +80,28 @@ void KMyMoneySelector::clear(void)
m_visibleItem = 0;
}
-void KMyMoneySelector::setSelectionMode(const QListView::SelectionMode mode)
+void KMyMoneySelector::setSelectionMode(const TQListView::SelectionMode mode)
{
if(m_selMode != mode) {
m_selMode = mode;
clear();
// make sure, it's either Multi or Single
- if(mode != QListView::Multi) {
- m_selMode = QListView::Single;
- connect(m_listView, SIGNAL(selectionChanged(void)), this, SIGNAL(stateChanged(void)));
- connect(m_listView, SIGNAL(executed(QListViewItem*)), this, SLOT(slotItemSelected(QListViewItem*)));
+ if(mode != TQListView::Multi) {
+ m_selMode = TQListView::Single;
+ connect(m_listView, TQT_SIGNAL(selectionChanged(void)), this, TQT_SIGNAL(stateChanged(void)));
+ connect(m_listView, TQT_SIGNAL(executed(TQListViewItem*)), this, TQT_SLOT(slotItemSelected(TQListViewItem*)));
} else {
- disconnect(m_listView, SIGNAL(selectionChanged(void)), this, SIGNAL(stateChanged(void)));
- disconnect(m_listView, SIGNAL(executed(QListViewItem*)), this, SLOT(slotItemSelected(QListViewItem*)));
+ disconnect(m_listView, TQT_SIGNAL(selectionChanged(void)), this, TQT_SIGNAL(stateChanged(void)));
+ disconnect(m_listView, TQT_SIGNAL(executed(TQListViewItem*)), this, TQT_SLOT(slotItemSelected(TQListViewItem*)));
}
}
- QWidget::update();
+ TQWidget::update();
}
-void KMyMoneySelector::slotItemSelected(QListViewItem *item)
+void KMyMoneySelector::slotItemSelected(TQListViewItem *item)
{
- if(m_selMode == QListView::Single) {
+ if(m_selMode == TQListView::Single) {
KMyMoneyListViewItem* l_item = dynamic_cast<KMyMoneyListViewItem*>(item);
if(l_item && l_item->isSelectable()) {
emit itemSelected(l_item->id());
@@ -109,9 +109,9 @@ void KMyMoneySelector::slotItemSelected(QListViewItem *item)
}
}
-QListViewItem* KMyMoneySelector::newItem(const QString& name, QListViewItem* after, const QString& key, const QString& id, QCheckListItem::Type type)
+TQListViewItem* KMyMoneySelector::newItem(const TQString& name, TQListViewItem* after, const TQString& key, const TQString& id, TQCheckListItem::Type type)
{
- QListViewItem* item;
+ TQListViewItem* item;
if(after)
item = new KMyMoneyCheckListItem(m_listView, after, name, key, id, type);
else
@@ -122,49 +122,49 @@ QListViewItem* KMyMoneySelector::newItem(const QString& name, QListViewItem* aft
return item;
}
-QListViewItem* KMyMoneySelector::newItem(const QString& name, const QString& key, const QString& id, QCheckListItem::Type type)
+TQListViewItem* KMyMoneySelector::newItem(const TQString& name, const TQString& key, const TQString& id, TQCheckListItem::Type type)
{
return newItem(name, 0, key, id, type);
}
-QListViewItem* KMyMoneySelector::newTopItem(const QString& name, const QString& key, const QString& id)
+TQListViewItem* KMyMoneySelector::newTopItem(const TQString& name, const TQString& key, const TQString& id)
{
- QListViewItem* p;
+ TQListViewItem* p;
- if(m_selMode == QListView::Multi) {
+ if(m_selMode == TQListView::Multi) {
KMyMoneyCheckListItem* q = new KMyMoneyCheckListItem(m_listView, name, key, id);
- connect(q, SIGNAL(stateChanged(bool)), this, SIGNAL(stateChanged(void)));
- p = static_cast<QListViewItem*> (q);
+ connect(q, TQT_SIGNAL(stateChanged(bool)), this, TQT_SIGNAL(stateChanged(void)));
+ p = static_cast<TQListViewItem*> (q);
} else {
KMyMoneyListViewItem* q = new KMyMoneyListViewItem(m_listView, name, key, id);
- p = static_cast<QListViewItem*> (q);
+ p = static_cast<TQListViewItem*> (q);
}
return p;
}
-QListViewItem* KMyMoneySelector::newItem(QListViewItem* parent, const QString& name, const QString& key, const QString& id)
+TQListViewItem* KMyMoneySelector::newItem(TQListViewItem* tqparent, const TQString& name, const TQString& key, const TQString& id)
{
- QListViewItem* p;
+ TQListViewItem* p;
- if(m_selMode == QListView::Multi) {
- KMyMoneyCheckListItem* q = new KMyMoneyCheckListItem(parent, name, key, id);
- connect(q, SIGNAL(stateChanged(bool)), this, SIGNAL(stateChanged(void)));
- p = static_cast<QListViewItem*> (q);
+ if(m_selMode == TQListView::Multi) {
+ KMyMoneyCheckListItem* q = new KMyMoneyCheckListItem(tqparent, name, key, id);
+ connect(q, TQT_SIGNAL(stateChanged(bool)), this, TQT_SIGNAL(stateChanged(void)));
+ p = static_cast<TQListViewItem*> (q);
} else {
- KMyMoneyListViewItem* q = new KMyMoneyListViewItem(parent, name, key, id);
- p = static_cast<QListViewItem*> (q);
+ KMyMoneyListViewItem* q = new KMyMoneyListViewItem(tqparent, name, key, id);
+ p = static_cast<TQListViewItem*> (q);
}
return p;
}
-void KMyMoneySelector::protectItem(const QString& itemId, const bool protect)
+void KMyMoneySelector::protectItem(const TQString& itemId, const bool protect)
{
- QListViewItemIterator it(m_listView, QListViewItemIterator::Selectable);
- QListViewItem* it_v;
+ TQListViewItemIterator it(m_listView, TQListViewItemIterator::Selectable);
+ TQListViewItem* it_v;
KMyMoneyListViewItem* it_l;
KMyMoneyCheckListItem* it_c;
@@ -189,10 +189,10 @@ void KMyMoneySelector::protectItem(const QString& itemId, const bool protect)
}
}
-QListViewItem* KMyMoneySelector::item(const QString& id) const
+TQListViewItem* KMyMoneySelector::item(const TQString& id) const
{
- QListViewItemIterator it(m_listView, QListViewItemIterator::Selectable);
- QListViewItem* it_v;
+ TQListViewItemIterator it(m_listView, TQListViewItemIterator::Selectable);
+ TQListViewItem* it_v;
KMyMoneyListViewItem* it_l;
KMyMoneyCheckListItem* it_c;
@@ -213,17 +213,17 @@ QListViewItem* KMyMoneySelector::item(const QString& id) const
int KMyMoneySelector::optimizedWidth(void) const
{
- QListViewItemIterator it(m_listView, QListViewItemIterator::Selectable);
- QListViewItem* it_v;
+ TQListViewItemIterator it(m_listView, TQListViewItemIterator::Selectable);
+ TQListViewItem* it_v;
KMyMoneyListViewItem* it_l;
KMyMoneyCheckListItem* it_c;
// scan items
int w = 0;
#ifndef KMM_DESIGNER
- QFontMetrics fm( KMyMoneyGlobalSettings::listCellFont());
+ TQFontMetrics fm( KMyMoneyGlobalSettings::listCellFont());
#else
- QFontMetrics fm( font() );
+ TQFontMetrics fm( font() );
#endif
while((it_v = it.current()) != 0) {
it_l = dynamic_cast<KMyMoneyListViewItem*>(it_v);
@@ -254,15 +254,15 @@ void KMyMoneySelector::setOptimizedWidth(void)
bool KMyMoneySelector::allItemsSelected(void) const
{
- QListViewItem* it_v;
+ TQListViewItem* it_v;
- if(m_selMode == QListView::Single)
+ if(m_selMode == TQListView::Single)
return false;
for(it_v = m_listView->firstChild(); it_v != 0; it_v = it_v->nextSibling()) {
if(it_v->rtti() == 1) {
- QCheckListItem* it_c = dynamic_cast<QCheckListItem*>(it_v);
- if(it_c->type() == QCheckListItem::CheckBox) {
+ TQCheckListItem* it_c = dynamic_cast<TQCheckListItem*>(it_v);
+ if(it_c->type() == TQCheckListItem::CheckBox) {
if(!(it_c->isOn() && allItemsSelected(it_v)))
return false;
} else {
@@ -274,13 +274,13 @@ bool KMyMoneySelector::allItemsSelected(void) const
return true;
}
-bool KMyMoneySelector::allItemsSelected(const QListViewItem *item) const
+bool KMyMoneySelector::allItemsSelected(const TQListViewItem *item) const
{
- QListViewItem* it_v;
+ TQListViewItem* it_v;
for(it_v = item->firstChild(); it_v != 0; it_v = it_v->nextSibling()) {
if(it_v->rtti() == 1) {
- QCheckListItem* it_c = static_cast<QCheckListItem*>(it_v);
+ TQCheckListItem* it_c = static_cast<TQCheckListItem*>(it_v);
if(!(it_c->isOn() && allItemsSelected(it_v)))
return false;
}
@@ -288,16 +288,16 @@ bool KMyMoneySelector::allItemsSelected(const QListViewItem *item) const
return true;
}
-void KMyMoneySelector::removeItem(const QString& id)
+void KMyMoneySelector::removeItem(const TQString& id)
{
- QListViewItem* it_v;
- QListViewItemIterator it;
+ TQListViewItem* it_v;
+ TQListViewItemIterator it;
- it = QListViewItemIterator(m_listView);
+ it = TQListViewItemIterator(m_listView);
while((it_v = it.current()) != 0) {
if(it_v->rtti() == 1) {
KMyMoneyCheckListItem* it_c = dynamic_cast<KMyMoneyCheckListItem*>(it_v);
- if(it_c->type() == QCheckListItem::CheckBox) {
+ if(it_c->type() == TQCheckListItem::CheckBox) {
if(id == it_c->id()) {
if(it_c->firstChild()) {
it_c->setSelectable(false);
@@ -319,8 +319,8 @@ void KMyMoneySelector::removeItem(const QString& id)
it++;
}
- // get rid of top items that just lost the last children (e.g. Favorites)
- it = QListViewItemIterator(m_listView, QListViewItemIterator::NotSelectable);
+ // get rid of top items that just lost the last tqchildren (e.g. Favorites)
+ it = TQListViewItemIterator(m_listView, TQListViewItemIterator::NotSelectable);
while((it_v = it.current()) != 0) {
if(it_v->rtti() == 1) {
KMyMoneyCheckListItem* it_c = dynamic_cast<KMyMoneyCheckListItem*>(it_v);
@@ -336,12 +336,12 @@ void KMyMoneySelector::removeItem(const QString& id)
void KMyMoneySelector::selectAllItems(const bool state)
{
- QListViewItem* it_v;
+ TQListViewItem* it_v;
for(it_v = m_listView->firstChild(); it_v != 0; it_v = it_v->nextSibling()) {
if(it_v->rtti() == 1) {
- QCheckListItem* it_c = dynamic_cast<QCheckListItem*>(it_v);
- if(it_c->type() == QCheckListItem::CheckBox) {
+ TQCheckListItem* it_c = dynamic_cast<TQCheckListItem*>(it_v);
+ if(it_c->type() == TQCheckListItem::CheckBox) {
it_c->setOn(state);
}
selectAllSubItems(it_v, state);
@@ -350,14 +350,14 @@ void KMyMoneySelector::selectAllItems(const bool state)
emit stateChanged();
}
-void KMyMoneySelector::selectItems(const QStringList& itemList, const bool state)
+void KMyMoneySelector::selectItems(const TQStringList& itemList, const bool state)
{
- QListViewItem* it_v;
+ TQListViewItem* it_v;
for(it_v = m_listView->firstChild(); it_v != 0; it_v = it_v->nextSibling()) {
if(it_v->rtti() == 1) {
KMyMoneyCheckListItem* it_c = dynamic_cast<KMyMoneyCheckListItem*>(it_v);
- if(it_c->type() == QCheckListItem::CheckBox && itemList.contains(it_c->id())) {
+ if(it_c->type() == TQCheckListItem::CheckBox && itemList.tqcontains(it_c->id())) {
it_c->setOn(state);
}
selectSubItems(it_v, itemList, state);
@@ -366,14 +366,14 @@ void KMyMoneySelector::selectItems(const QStringList& itemList, const bool state
emit stateChanged();
}
-void KMyMoneySelector::selectSubItems(QListViewItem* item, const QStringList& itemList, const bool state)
+void KMyMoneySelector::selectSubItems(TQListViewItem* item, const TQStringList& itemList, const bool state)
{
- QListViewItem* it_v;
+ TQListViewItem* it_v;
for(it_v = item->firstChild(); it_v != 0; it_v = it_v->nextSibling()) {
if(it_v->rtti() == 1) {
KMyMoneyCheckListItem* it_c = dynamic_cast<KMyMoneyCheckListItem*>(it_v);
- if(it_c->type() == QCheckListItem::CheckBox && itemList.contains(it_c->id())) {
+ if(it_c->type() == TQCheckListItem::CheckBox && itemList.tqcontains(it_c->id())) {
it_c->setOn(state);
}
selectSubItems(it_v, itemList, state);
@@ -381,14 +381,14 @@ void KMyMoneySelector::selectSubItems(QListViewItem* item, const QStringList& it
}
}
-void KMyMoneySelector::selectAllSubItems(QListViewItem* item, const bool state)
+void KMyMoneySelector::selectAllSubItems(TQListViewItem* item, const bool state)
{
- QListViewItem* it_v;
+ TQListViewItem* it_v;
for(it_v = item->firstChild(); it_v != 0; it_v = it_v->nextSibling()) {
if(it_v->rtti() == 1) {
- QCheckListItem* it_c = dynamic_cast<QCheckListItem*>(it_v);
- if(it_c->type() == QCheckListItem::CheckBox) {
+ TQCheckListItem* it_c = dynamic_cast<TQCheckListItem*>(it_v);
+ if(it_c->type() == TQCheckListItem::CheckBox) {
it_c->setOn(state);
}
selectAllSubItems(it_v, state);
@@ -396,12 +396,12 @@ void KMyMoneySelector::selectAllSubItems(QListViewItem* item, const bool state)
}
}
-void KMyMoneySelector::selectedItems(QStringList& list) const
+void KMyMoneySelector::selectedItems(TQStringList& list) const
{
- QListViewItem* it_v;
+ TQListViewItem* it_v;
list.clear();
- if(m_selMode == QListView::Single) {
+ if(m_selMode == TQListView::Single) {
KMyMoneyListViewItem* it_c = dynamic_cast<KMyMoneyListViewItem*>(m_listView->selectedItem());
if(it_c != 0)
list << it_c->id();
@@ -410,7 +410,7 @@ void KMyMoneySelector::selectedItems(QStringList& list) const
for(it_v = m_listView->firstChild(); it_v != 0; it_v = it_v->nextSibling()) {
if(it_v->rtti() == 1) {
KMyMoneyCheckListItem* it_c = dynamic_cast<KMyMoneyCheckListItem*>(it_v);
- if(it_c->type() == QCheckListItem::CheckBox) {
+ if(it_c->type() == TQCheckListItem::CheckBox) {
if(it_c->isOn())
list << (*it_c).id();
}
@@ -420,14 +420,14 @@ void KMyMoneySelector::selectedItems(QStringList& list) const
}
}
-void KMyMoneySelector::selectedItems(QStringList& list, QListViewItem* item) const
+void KMyMoneySelector::selectedItems(TQStringList& list, TQListViewItem* item) const
{
- QListViewItem* it_v;
+ TQListViewItem* it_v;
for(it_v = item->firstChild(); it_v != 0; it_v = it_v->nextSibling()) {
if(it_v->rtti() == 1) {
KMyMoneyCheckListItem* it_c = dynamic_cast<KMyMoneyCheckListItem*>(it_v);
- if(it_c->type() == QCheckListItem::CheckBox) {
+ if(it_c->type() == TQCheckListItem::CheckBox) {
if(it_c->isOn())
list << (*it_c).id();
selectedItems(list, it_v);
@@ -436,17 +436,17 @@ void KMyMoneySelector::selectedItems(QStringList& list, QListViewItem* item) con
}
}
-void KMyMoneySelector::itemList(QStringList& list) const
+void KMyMoneySelector::itemList(TQStringList& list) const
{
- QListViewItemIterator it;
- QListViewItem* it_v;
+ TQListViewItemIterator it;
+ TQListViewItem* it_v;
- it = QListViewItemIterator(m_listView, QListViewItemIterator::Selectable);
+ it = TQListViewItemIterator(m_listView, TQListViewItemIterator::Selectable);
while((it_v = it.current()) != 0) {
{
if(it_v->rtti() == 1) {
KMyMoneyCheckListItem* it_c = dynamic_cast<KMyMoneyCheckListItem*>(it_v);
- if(it_c->type() == QCheckListItem::CheckBox) {
+ if(it_c->type() == TQCheckListItem::CheckBox) {
list << it_c->id();
}
} else if(it_v->rtti() == 0) {
@@ -458,18 +458,18 @@ void KMyMoneySelector::itemList(QStringList& list) const
}
}
-void KMyMoneySelector::setSelected(const QString& id, const bool state)
+void KMyMoneySelector::setSelected(const TQString& id, const bool state)
{
- QListViewItemIterator it;
- QListViewItem* it_v;
- QListViewItem* it_visible = 0;
+ TQListViewItemIterator it;
+ TQListViewItem* it_v;
+ TQListViewItem* it_visible = 0;
- it = QListViewItemIterator(m_listView, QListViewItemIterator::Selectable);
+ it = TQListViewItemIterator(m_listView, TQListViewItemIterator::Selectable);
while((it_v = it.current()) != 0) {
if(it_v->rtti() == 1) {
KMyMoneyCheckListItem* it_c = dynamic_cast<KMyMoneyCheckListItem*>(it_v);
Q_CHECK_PTR(it_c);
- if(it_c->type() == QCheckListItem::CheckBox) {
+ if(it_c->type() == TQCheckListItem::CheckBox) {
if(it_c->id() == id) {
it_c->setOn(state);
m_listView->setSelected(it_v, true);
@@ -496,18 +496,18 @@ void KMyMoneySelector::setSelected(const QString& id, const bool state)
ensureItemVisible(it_visible);
}
-void KMyMoneySelector::ensureItemVisible(const QListViewItem *it_v)
+void KMyMoneySelector::ensureItemVisible(const TQListViewItem *it_v)
{
// for some reason, I could only use the ensureItemVisible() method
- // of QListView successfully, after the widget was drawn on the screen.
+ // of TQListView successfully, after the widget was drawn on the screen.
// If called before it had no effect (if the item was not visible).
//
// The solution was to store the item we wanted to see in a local var
- // and call QListView::ensureItemVisible() about 10ms later in
+ // and call TQListView::ensureItemVisible() about 10ms later in
// the slot slotShowSelected. (ipwizard, 12/29/2003)
m_visibleItem = it_v;
- QTimer::singleShot(100, this, SLOT(slotShowSelected()));
+ TQTimer::singleShot(100, this, TQT_SLOT(slotShowSelected()));
}
void KMyMoneySelector::slotShowSelected(void)
@@ -516,61 +516,61 @@ void KMyMoneySelector::slotShowSelected(void)
m_listView->ensureItemVisible(m_visibleItem);
}
-int KMyMoneySelector::slotMakeCompletion(const QString& _txt)
+int KMyMoneySelector::slotMakeCompletion(const TQString& _txt)
{
- QString txt(QRegExp::escape(_txt));
+ TQString txt(TQRegExp::escape(_txt));
if(KMyMoneyGlobalSettings::stringMatchFromStart() && this->isA("KMyMoneySelector") )
txt.prepend('^');
- return slotMakeCompletion(QRegExp(txt, false));
+ return slotMakeCompletion(TQRegExp(txt, false));
}
-bool KMyMoneySelector::match(const QRegExp& exp, QListViewItem* item) const
+bool KMyMoneySelector::match(const TQRegExp& exp, TQListViewItem* item) const
{
return exp.search(item->text(0)) != -1;
}
-int KMyMoneySelector::slotMakeCompletion(const QRegExp& exp)
+int KMyMoneySelector::slotMakeCompletion(const TQRegExp& exp)
{
- QListViewItemIterator it(m_listView, QListViewItemIterator::Selectable);
+ TQListViewItemIterator it(m_listView, TQListViewItemIterator::Selectable);
- QListViewItem* it_v;
+ TQListViewItem* it_v;
// The logic used here seems to be awkward. The problem is, that
- // QListViewItem::setVisible works recursively on all it's children
- // and grand-children.
+ // TQListViewItem::setVisible works recursively on all it's tqchildren
+ // and grand-tqchildren.
//
// The way out of this is as follows: Make all items visible.
// Then go through the list again and perform the checks.
- // If an item does not have any children (last leaf in the tree view)
- // perform the check. Then check recursively on the parent of this
- // leaf that it has no visible children. If that is the case, make the
- // parent invisible and continue this check with it's parent.
+ // If an item does not have any tqchildren (last leaf in the tree view)
+ // perform the check. Then check recursively on the tqparent of this
+ // leaf that it has no visible tqchildren. If that is the case, make the
+ // tqparent invisible and continue this check with it's tqparent.
while((it_v = it.current()) != 0) {
it_v->setVisible(true);
++it;
}
- QListViewItem* firstMatch = 0;
+ TQListViewItem* firstMatch = 0;
if(!exp.pattern().isEmpty()) {
- it = QListViewItemIterator(m_listView, QListViewItemIterator::Selectable);
+ it = TQListViewItemIterator(m_listView, TQListViewItemIterator::Selectable);
while((it_v = it.current()) != 0) {
if(it_v->firstChild() == 0) {
if(!match(exp, it_v)) {
// this is a node which does not contain the
- // text and does not have children. So we can
- // safely hide it. Then we check, if the parent
- // has more children which are still visible. If
- // none are found, the parent node is hidden also. We
+ // text and does not have tqchildren. So we can
+ // safely hide it. Then we check, if the tqparent
+ // has more tqchildren which are still visible. If
+ // none are found, the tqparent node is hidden also. We
// continue until the top of the tree or until we
- // find a node that still has visible children.
+ // find a node that still has visible tqchildren.
bool hide = true;
while(hide) {
it_v->setVisible(false);
- it_v = it_v->parent();
+ it_v = it_v->tqparent();
if(it_v && it_v->isSelectable()) {
hide = !match(exp, it_v);
- QListViewItem* child = it_v->firstChild();
+ TQListViewItem* child = it_v->firstChild();
for(; child && hide; child = child->nextSibling()) {
if(child->isVisible())
hide = false;
@@ -587,15 +587,15 @@ int KMyMoneySelector::slotMakeCompletion(const QRegExp& exp)
if(!firstMatch) {
firstMatch = it_v;
}
- // a node with children contains the text. We want
+ // a node with tqchildren contains the text. We want
// to display all child nodes in this case, so we need
// to advance the iterator to the next sibling of the
// current node. This could well be the sibling of a
- // parent or grandparent node.
- QListViewItem* curr = it_v;
- QListViewItem* item;
+ // tqparent or grandtqparent node.
+ TQListViewItem* curr = it_v;
+ TQListViewItem* item;
while((item = curr->nextSibling()) == 0) {
- curr = curr->parent();
+ curr = curr->tqparent();
if(curr == 0)
break;
if(match(exp, curr))
@@ -606,7 +606,7 @@ int KMyMoneySelector::slotMakeCompletion(const QRegExp& exp)
} while(it.current() && it.current() != item);
} else {
- // It's a node with children that does not match. We don't
+ // It's a node with tqchildren that does not match. We don't
// change it's status here.
++it;
}
@@ -615,7 +615,7 @@ int KMyMoneySelector::slotMakeCompletion(const QRegExp& exp)
// make the first match the one that is selected
// if we have no match, make sure none is selected
- if(m_selMode == QListView::Single) {
+ if(m_selMode == TQListView::Single) {
if(firstMatch) {
m_listView->setSelected(firstMatch, true);
ensureItemVisible(firstMatch);
@@ -626,7 +626,7 @@ int KMyMoneySelector::slotMakeCompletion(const QRegExp& exp)
// Get the number of visible nodes for the return code
int cnt = 0;
- it = QListViewItemIterator(m_listView, QListViewItemIterator::Selectable | QListViewItemIterator::Visible);
+ it = TQListViewItemIterator(m_listView, TQListViewItemIterator::Selectable | TQListViewItemIterator::Visible);
while((it_v = it.current()) != 0) {
cnt++;
it++;
@@ -634,10 +634,10 @@ int KMyMoneySelector::slotMakeCompletion(const QRegExp& exp)
return cnt;
}
-bool KMyMoneySelector::contains(const QString& txt) const
+bool KMyMoneySelector::tqcontains(const TQString& txt) const
{
- QListViewItemIterator it(m_listView, QListViewItemIterator::Selectable);
- QListViewItem* it_v;
+ TQListViewItemIterator it(m_listView, TQListViewItemIterator::Selectable);
+ TQListViewItem* it_v;
while((it_v = it.current()) != 0) {
if(it_v->rtti() == 1) {
KMyMoneyCheckListItem* it_c = dynamic_cast<KMyMoneyCheckListItem*>(it_v);
@@ -655,13 +655,13 @@ bool KMyMoneySelector::contains(const QString& txt) const
return false;
}
-void KMyMoneySelector::slotListRightMouse(QListViewItem* it_v, const QPoint& pos, int /* col */)
+void KMyMoneySelector::slotListRightMouse(TQListViewItem* it_v, const TQPoint& pos, int /* col */)
{
if(it_v && (it_v->rtti() == 1)) {
KMyMoneyCheckListItem* it_c = static_cast<KMyMoneyCheckListItem*>(it_v);
- if(it_c->type() == QCheckListItem::CheckBox) {
- // the following is copied from QCheckListItem::activate() et al
- int boxsize = m_listView->style().pixelMetric(QStyle::PM_CheckListButtonSize, m_listView);
+ if(it_c->type() == TQCheckListItem::CheckBox) {
+ // the following is copied from TQCheckListItem::activate() et al
+ int boxsize = m_listView->tqstyle().tqpixelMetric(TQStyle::PM_CheckListButtonSize, m_listView);
int align = m_listView->columnAlignment( 0 );
int marg = m_listView->itemMargin();
int y = 0;
@@ -671,12 +671,12 @@ void KMyMoneySelector::slotListRightMouse(QListViewItem* it_v, const QPoint& pos
else
y = (m_listView->fontMetrics().height() + 2 + marg - boxsize) / 2;
- QRect r( 0, y, boxsize-3, boxsize-3 );
+ TQRect r( 0, y, boxsize-3, boxsize-3 );
// columns might have been swapped
r.moveBy( m_listView->header()->sectionPos( 0 ), 0 );
- QPoint topLeft = m_listView->itemRect(it_v).topLeft(); //### inefficient?
- QPoint p = m_listView->mapFromGlobal( pos ) - topLeft;
+ TQPoint topLeft = m_listView->tqitemRect(it_v).topLeft(); //### inefficient?
+ TQPoint p = m_listView->mapFromGlobal( pos ) - topLeft;
int xdepth = m_listView->treeStepSize() * (it_v->depth() + (m_listView->rootIsDecorated() ? 1 : 0))
+ m_listView->itemMargin();
@@ -684,7 +684,7 @@ void KMyMoneySelector::slotListRightMouse(QListViewItem* it_v, const QPoint& pos
p.rx() -= xdepth;
// copy ends around here
- if ( r.contains( p ) ) {
+ if ( r.tqcontains( p ) ) {
// we get down here, if we have a right click onto the checkbox
selectAllSubItems(it_c, it_c->isOn());
}
@@ -692,16 +692,16 @@ void KMyMoneySelector::slotListRightMouse(QListViewItem* it_v, const QPoint& pos
}
}
-QStringList KMyMoneySelector::selectedItems(void) const
+TQStringList KMyMoneySelector::selectedItems(void) const
{
- QStringList list;
+ TQStringList list;
selectedItems(list);
return list;
}
-QStringList KMyMoneySelector::itemList(void) const
+TQStringList KMyMoneySelector::itemList(void) const
{
- QStringList list;
+ TQStringList list;
itemList(list);
return list;
}