summaryrefslogtreecommitdiffstats
path: root/kradio3/src/include/gui_list_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'kradio3/src/include/gui_list_helper.h')
-rw-r--r--kradio3/src/include/gui_list_helper.h52
1 files changed, 26 insertions, 26 deletions
diff --git a/kradio3/src/include/gui_list_helper.h b/kradio3/src/include/gui_list_helper.h
index 6524043..3cf2d25 100644
--- a/kradio3/src/include/gui_list_helper.h
+++ b/kradio3/src/include/gui_list_helper.h
@@ -18,8 +18,8 @@
#ifndef _KRADIO_LIBKRADIO_GUI_GUI_LIST_HELPER_H_
#define _KRADIO_LIBKRADIO_GUI_GUI_LIST_HELPER_H_
-#include <qmap.h>
-#include <qvaluelist.h>
+#include <tqmap.h>
+#include <tqvaluelist.h>
template <class TLIST> class GUISimpleListHelper
@@ -28,27 +28,27 @@ public:
GUISimpleListHelper(TLIST *list) : m_List(list) {}
~GUISimpleListHelper() {}
- void setData(const QValueList<QString> &data);
- QString getCurrentText() const { return m_List->currentText(); }
- void setCurrentText(const QString &s) { m_List->setCurrentItem(m_revData.contains(s) ? m_revData[s] : 0); }
+ void setData(const TQValueList<TQString> &data);
+ TQString getCurrentText() const { return m_List->currentText(); }
+ void setCurrentText(const TQString &s) { m_List->setCurrentItem(m_revData.tqcontains(s) ? m_revData[s] : 0); }
int count() const { return m_revData.count(); }
- bool contains(const QString &id) const { return m_revData.contains(id); }
+ bool tqcontains(const TQString &id) const { return m_revData.tqcontains(id); }
protected:
TLIST *m_List;
- QMap<QString, int> m_revData;
+ TQMap<TQString, int> m_revData;
};
template <class TLIST>
-void GUISimpleListHelper<TLIST>::setData(const QValueList<QString> &data)
+void GUISimpleListHelper<TLIST>::setData(const TQValueList<TQString> &data)
{
m_List->clear();
m_revData.clear();
- QValueListConstIterator<QString> it = data.begin();
- QValueListConstIterator<QString> end = data.end();
+ TQValueListConstIterator<TQString> it = data.begin();
+ TQValueListConstIterator<TQString> end = data.end();
for (int i = 0; it != end; ++it, ++i) {
m_revData[*it] = i;
m_List->insertItem(*it);
@@ -69,32 +69,32 @@ public:
enum SORT_KEY { SORT_BY_ID, SORT_BY_DESCR };
GUIListHelper(TLIST *list, SORT_KEY skey);
- GUIListHelper(TLIST *list, const QMap<TID, QString> &data, SORT_KEY skey);
+ GUIListHelper(TLIST *list, const TQMap<TID, TQString> &data, SORT_KEY skey);
~GUIListHelper();
- void setData(const QMap<TID, QString> &data);
+ void setData(const TQMap<TID, TQString> &data);
void setCurrentItem(const TID &) const;
const TID &getCurrentItem() const;
int count() const { return m_Index2ID.count(); }
- bool contains(const TID &id) const { return m_ID2Index.contains(id); }
+ bool tqcontains(const TID &id) const { return m_ID2Index.tqcontains(id); }
protected:
SORT_KEY m_skey;
TLIST *m_List;
- QMap<int, TID> m_Index2ID;
- QMap<TID, int> m_ID2Index;
- QMap<TID, QString> m_ID2Description;
+ TQMap<int, TID> m_Index2ID;
+ TQMap<TID, int> m_ID2Index;
+ TQMap<TID, TQString> m_ID2Description;
struct THelpData {
TID id;
- QString descr;
+ TQString descr;
SORT_KEY skey;
THelpData() : id(), descr(), skey(SORT_BY_ID) {}
- THelpData(TID _id, const QString &_descr, SORT_KEY _skey)
+ THelpData(TID _id, const TQString &_descr, SORT_KEY _skey)
: id(_id),
descr(_descr),
skey(_skey)
@@ -115,7 +115,7 @@ GUIListHelper<TLIST, TID>::GUIListHelper(TLIST *list, SORT_KEY skey)
template <class TLIST, class TID>
-GUIListHelper<TLIST, TID>::GUIListHelper(TLIST *list, const QMap<TID, QString> &data, SORT_KEY skey)
+GUIListHelper<TLIST, TID>::GUIListHelper(TLIST *list, const TQMap<TID, TQString> &data, SORT_KEY skey)
: m_skey(skey),
m_List(list)
{
@@ -130,14 +130,14 @@ GUIListHelper<TLIST, TID>::~GUIListHelper()
template <class TLIST, class TID>
-void GUIListHelper<TLIST, TID>::setData (const QMap<TID, QString> &data)
+void GUIListHelper<TLIST, TID>::setData (const TQMap<TID, TQString> &data)
{
m_List->clear();
m_ID2Description = data;
- QValueList<THelpData> help_list;
- QMapConstIterator<TID, QString> end = data.end();
- for (QMapConstIterator<TID, QString> it = data.begin(); it != end; ++it) {
+ TQValueList<THelpData> help_list;
+ TQMapConstIterator<TID, TQString> end = data.end();
+ for (TQMapConstIterator<TID, TQString> it = data.begin(); it != end; ++it) {
help_list.push_back(THelpData(it.key(), *it, m_skey));
}
qHeapSort(help_list);
@@ -146,8 +146,8 @@ void GUIListHelper<TLIST, TID>::setData (const QMap<TID, QString> &data)
m_ID2Index.clear();
int idx = 0;
- QValueListIterator<THelpData> end_hlp = help_list.end();
- for (QValueListIterator<THelpData> it = help_list.begin(); it != end_hlp; ++it, ++idx) {
+ TQValueListIterator<THelpData> end_hlp = help_list.end();
+ for (TQValueListIterator<THelpData> it = help_list.begin(); it != end_hlp; ++it, ++idx) {
m_Index2ID.insert(idx, (*it).id);
m_ID2Index.insert((*it).id, idx);
m_List->insertItem((*it).descr);
@@ -158,7 +158,7 @@ void GUIListHelper<TLIST, TID>::setData (const QMap<TID, QString> &data)
template <class TLIST, class TID>
void GUIListHelper<TLIST, TID>::setCurrentItem(const TID &id) const
{
- if (m_ID2Index.contains(id))
+ if (m_ID2Index.tqcontains(id))
m_List->setCurrentItem(m_ID2Index[id]);
else
m_List->setCurrentItem(0);