summaryrefslogtreecommitdiffstats
path: root/src/gui/stringmapdialog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-02 06:40:27 +0000
commit2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch)
tree18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/gui/stringmapdialog.cpp
parent1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff)
downloadtellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz
tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip
TQt4 port tellico
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/stringmapdialog.cpp')
-rw-r--r--src/gui/stringmapdialog.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/gui/stringmapdialog.cpp b/src/gui/stringmapdialog.cpp
index 4a5374f..c542fe5 100644
--- a/src/gui/stringmapdialog.cpp
+++ b/src/gui/stringmapdialog.cpp
@@ -19,33 +19,33 @@
#include <kbuttonbox.h>
#include <kiconloader.h>
-#include <qlayout.h>
-#include <qheader.h>
-#include <qhbox.h>
-#include <qwhatsthis.h>
-#include <qpushbutton.h>
+#include <tqlayout.h>
+#include <tqheader.h>
+#include <tqhbox.h>
+#include <tqwhatsthis.h>
+#include <tqpushbutton.h>
using Tellico::StringMapDialog;
-StringMapDialog::StringMapDialog(const QMap<QString, QString>& map_, QWidget* parent_, const char* name_/*=0*/, bool modal_/*=false*/)
- : KDialogBase(parent_, name_, modal_, QString::null, Ok|Cancel) {
- QWidget* page = new QWidget(this);
- QVBoxLayout* l = new QVBoxLayout(page, 0, KDialog::spacingHint());
+StringMapDialog::StringMapDialog(const TQMap<TQString, TQString>& map_, TQWidget* tqparent_, const char* name_/*=0*/, bool modal_/*=false*/)
+ : KDialogBase(tqparent_, name_, modal_, TQString(), Ok|Cancel) {
+ TQWidget* page = new TQWidget(this);
+ TQVBoxLayout* l = new TQVBoxLayout(page, 0, KDialog::spacingHint());
m_listView = new KListView(page);
m_listView->setAllColumnsShowFocus(true);
m_listView->setShowSortIndicator(true);
- m_listView->addColumn(QString::null);
- m_listView->addColumn(QString::null);
+ m_listView->addColumn(TQString());
+ m_listView->addColumn(TQString());
m_listView->header()->hide(); // hide header since neither column has a label initially
- m_listView->setColumnWidthMode(0, QListView::Maximum);
- m_listView->setColumnWidthMode(1, QListView::Maximum);
- m_listView->setResizeMode(QListView::AllColumns);
- connect(m_listView, SIGNAL(currentChanged(QListViewItem*)), SLOT(slotUpdate(QListViewItem*)));
- connect(m_listView, SIGNAL(clicked(QListViewItem*)), SLOT(slotUpdate(QListViewItem*)));
+ m_listView->setColumnWidthMode(0, TQListView::Maximum);
+ m_listView->setColumnWidthMode(1, TQListView::Maximum);
+ m_listView->setResizeMode(TQListView::AllColumns);
+ connect(m_listView, TQT_SIGNAL(currentChanged(TQListViewItem*)), TQT_SLOT(slotUpdate(TQListViewItem*)));
+ connect(m_listView, TQT_SIGNAL(clicked(TQListViewItem*)), TQT_SLOT(slotUpdate(TQListViewItem*)));
l->addWidget(m_listView);
- QHBox* box = new QHBox(page);
+ TQHBox* box = new TQHBox(page);
box->setMargin(4);
box->setSpacing(KDialog::spacingHint());
@@ -54,16 +54,16 @@ StringMapDialog::StringMapDialog(const QMap<QString, QString>& map_, QWidget* pa
m_edit2 = new KLineEdit(box);
KButtonBox* bb = new KButtonBox(box);
bb->addStretch();
- QPushButton* btn = bb->addButton(i18n("&Set"), this, SLOT(slotAdd()));
- btn->setIconSet(BarIcon(QString::fromLatin1("filenew"), KIcon::SizeSmall));
- btn = bb->addButton(i18n("&Delete"), this, SLOT(slotDelete()));
- btn->setIconSet(BarIcon(QString::fromLatin1("editdelete"), KIcon::SizeSmall));
+ TQPushButton* btn = bb->addButton(i18n("&Set"), TQT_TQOBJECT(this), TQT_SLOT(slotAdd()));
+ btn->setIconSet(BarIcon(TQString::tqfromLatin1("filenew"), KIcon::SizeSmall));
+ btn = bb->addButton(i18n("&Delete"), TQT_TQOBJECT(this), TQT_SLOT(slotDelete()));
+ btn->setIconSet(BarIcon(TQString::tqfromLatin1("editdelete"), KIcon::SizeSmall));
l->addWidget(box);
l->addStretch(1);
setMainWidget(page);
- for(QMap<QString, QString>::ConstIterator it = map_.begin(); it != map_.end(); ++it) {
+ for(TQMap<TQString, TQString>::ConstIterator it = map_.begin(); it != map_.end(); ++it) {
if(!it.data().isEmpty()) {
(void) new KListViewItem(m_listView, it.key(), it.data());
}
@@ -74,12 +74,12 @@ StringMapDialog::StringMapDialog(const QMap<QString, QString>& map_, QWidget* pa
}
void StringMapDialog::slotAdd() {
- QString s1 = m_edit1->text();
- QString s2 = m_edit2->text();
+ TQString s1 = m_edit1->text();
+ TQString s2 = m_edit2->text();
if(s1.isEmpty() && s2.isEmpty()) {
return;
}
- QListViewItem* item = m_listView->currentItem();
+ TQListViewItem* item = m_listView->currentItem();
if(item && s1 == item->text(0)) { // only update values if same key
item->setText(1, s2);
} else {
@@ -97,7 +97,7 @@ void StringMapDialog::slotDelete() {
m_listView->setSelected(m_listView->currentItem(), true);
}
-void StringMapDialog::slotUpdate(QListViewItem* item_) {
+void StringMapDialog::slotUpdate(TQListViewItem* item_) {
if(item_) {
m_edit1->setText(item_->text(0));
m_edit2->setText(item_->text(1));
@@ -108,15 +108,15 @@ void StringMapDialog::slotUpdate(QListViewItem* item_) {
}
}
-void StringMapDialog::setLabels(const QString& label1_, const QString& label2_) {
+void StringMapDialog::setLabels(const TQString& label1_, const TQString& label2_) {
m_listView->header()->setLabel(0, label1_);
m_listView->header()->setLabel(1, label2_);
m_listView->header()->show();
}
-QMap<QString, QString> StringMapDialog::stringMap() {
- QMap<QString, QString> map;
- for(QListViewItem* item = m_listView->firstChild(); item; item = item->nextSibling()) {
+TQMap<TQString, TQString> StringMapDialog::stringMap() {
+ TQMap<TQString, TQString> map;
+ for(TQListViewItem* item = m_listView->firstChild(); item; item = item->nextSibling()) {
map.insert(item->text(0), item->text(1));
}
return map;