summaryrefslogtreecommitdiffstats
path: root/lib/koproperty/editors/combobox.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/koproperty/editors/combobox.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/koproperty/editors/combobox.cpp')
-rw-r--r--lib/koproperty/editors/combobox.cpp62
1 files changed, 31 insertions, 31 deletions
diff --git a/lib/koproperty/editors/combobox.cpp b/lib/koproperty/editors/combobox.cpp
index 64563dcb..f1206f2d 100644
--- a/lib/koproperty/editors/combobox.cpp
+++ b/lib/koproperty/editors/combobox.cpp
@@ -19,10 +19,10 @@
*/
#include "combobox.h"
-#include <qlayout.h>
-#include <qmap.h>
-#include <qvariant.h>
-#include <qpainter.h>
+#include <tqlayout.h>
+#include <tqmap.h>
+#include <tqvariant.h>
+#include <tqpainter.h>
#include <kcombobox.h>
#include <kdebug.h>
@@ -31,18 +31,18 @@
using namespace KoProperty;
-ComboBox::ComboBox(Property *property, QWidget *parent, const char *name)
- : Widget(property, parent, name)
+ComboBox::ComboBox(Property *property, TQWidget *tqparent, const char *name)
+ : Widget(property, tqparent, name)
, m_setValueEnabled(true)
{
- QHBoxLayout *l = new QHBoxLayout(this, 0, 0);
+ TQHBoxLayout *l = new TQHBoxLayout(this, 0, 0);
m_edit = new KComboBox(this);
- m_edit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ m_edit->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding);
m_edit->setMinimumHeight(5);
l->addWidget(m_edit);
m_edit->setEditable(false);
- m_edit->setInsertionPolicy(QComboBox::NoInsertion);
+ m_edit->setInsertionPolicy(TQComboBox::NoInsertion);
m_edit->setMinimumSize(10, 0); // to allow the combo to be resized to a small size
m_edit->setAutoCompletion(true);
m_edit->setContextMenuEnabled(false);
@@ -53,31 +53,31 @@ ComboBox::ComboBox(Property *property, QWidget *parent, const char *name)
//not needed for combo setLeavesTheSpaceForRevertButton(true);
setFocusWidget(m_edit);
- connect(m_edit, SIGNAL(activated(int)), this, SLOT(slotValueChanged(int)));
+ connect(m_edit, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotValueChanged(int)));
}
ComboBox::~ComboBox()
{
}
-QVariant
+TQVariant
ComboBox::value() const
{
if (!property()->listData()) {
kopropertywarn << "ComboBox::value(): propery listData not available!" << endl;
- return QVariant();
+ return TQVariant();
}
const int idx = m_edit->currentItem();
if (idx<0 || idx>=(int)property()->listData()->keys.count())
- return QVariant();
- return QVariant( property()->listData()->keys[idx] );
-// if(property()->listData() && property()->listData()->contains(m_edit->currentText()))
+ return TQVariant();
+ return TQVariant( property()->listData()->keys[idx] );
+// if(property()->listData() && property()->listData()->tqcontains(m_edit->currentText()))
// return (*(property()->valueList()))[m_edit->currentText()];
-// return QVariant();
+// return TQVariant();
}
void
-ComboBox::setValue(const QVariant &value, bool emitChange)
+ComboBox::setValue(const TQVariant &value, bool emitChange)
{
if (!property() || !property()->listData()) {
kopropertywarn << "ComboBox::value(): propery listData not available!" << endl;
@@ -85,7 +85,7 @@ ComboBox::setValue(const QVariant &value, bool emitChange)
}
if (!m_setValueEnabled)
return;
- int idx = property()->listData()->keys.findIndex( value );
+ int idx = property()->listData()->keys.tqfindIndex( value );
if (idx>=0 && idx<m_edit->count()) {
m_edit->setCurrentItem(idx);
}
@@ -94,7 +94,7 @@ ComboBox::setValue(const QVariant &value, bool emitChange)
kopropertywarn << "ComboBox::setValue(): NO SUCH KEY '" << value.toString()
<< "' (property '" << property()->name() << "')" << endl;
} else {
- QStringList list;
+ TQStringList list;
for (int i=0; i<m_edit->count(); i++)
list += m_edit->text(i);
kopropertywarn << "ComboBox::setValue(): NO SUCH INDEX WITHIN COMBOBOX: " << idx
@@ -102,7 +102,7 @@ ComboBox::setValue(const QVariant &value, bool emitChange)
<< "' (property '" << property()->name() << "')\nActual combobox contents: "
<< list << endl;
}
- m_edit->setCurrentText(QString::null);
+ m_edit->setCurrentText(TQString());
}
if(value.isNull())
@@ -116,18 +116,18 @@ ComboBox::setValue(const QVariant &value, bool emitChange)
}
void
-ComboBox::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value)
+ComboBox::drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value)
{
- QString txt;
+ TQString txt;
if (property()->listData()) {
- const int idx = property()->listData()->keys.findIndex( value );
+ const int idx = property()->listData()->keys.tqfindIndex( value );
if (idx>=0)
txt = property()->listData()->names[ idx ];
}
Widget::drawViewer(p, cg, r, txt); //keyForValue(value));
// p->eraseRect(r);
-// p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, keyForValue(value));
+// p->drawText(r, TQt::AlignLeft | TQt::AlignVCenter | TQt::SingleLine, keyForValue(value));
}
void
@@ -175,23 +175,23 @@ ComboBox::setReadOnlyInternal(bool readOnly)
}
-/*QString
-ComboBox::keyForValue(const QVariant &value)
+/*TQString
+ComboBox::keyForValue(const TQVariant &value)
{
- const QMap<QString, QVariant> *list = property()->valueList();
+ const TQMap<TQString, TQVariant> *list = property()->valueList();
Property::ListData *list = property()->listData();
if (!list)
- return QString::null;
+ return TQString();
int idx = listData->keys.findIndex( value );
- QMap<QString, QVariant>::ConstIterator endIt = list->constEnd();
- for(QMap<QString, QVariant>::ConstIterator it = list->constBegin(); it != endIt; ++it) {
+ TQMap<TQString, TQVariant>::ConstIterator endIt = list->constEnd();
+ for(TQMap<TQString, TQVariant>::ConstIterator it = list->constBegin(); it != endIt; ++it) {
if(it.data() == value)
return it.key();
}
- return QString::null;
+ return TQString();
}*/