diff options
Diffstat (limited to 'lib/koproperty/editors/symbolcombo.cpp')
-rw-r--r-- | lib/koproperty/editors/symbolcombo.cpp | 52 |
1 files changed, 24 insertions, 28 deletions
diff --git a/lib/koproperty/editors/symbolcombo.cpp b/lib/koproperty/editors/symbolcombo.cpp index ee0056bd..289badbb 100644 --- a/lib/koproperty/editors/symbolcombo.cpp +++ b/lib/koproperty/editors/symbolcombo.cpp @@ -18,11 +18,11 @@ * Boston, MA 02110-1301, USA. */ -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qvariant.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqvariant.h> #include <kcharselect.h> #include <klocale.h> @@ -32,51 +32,47 @@ using namespace KoProperty; -SymbolCombo::SymbolCombo(Property *property, QWidget *parent, const char *name) - : Widget(property, parent, name) +SymbolCombo::SymbolCombo(Property *property, TQWidget *tqparent, const char *name) + : Widget(property, tqparent, name) { setHasBorders(false); - QHBoxLayout *l = new QHBoxLayout(this); + TQHBoxLayout *l = new TQHBoxLayout(this); - m_edit = new QLineEdit(this); + m_edit = new TQLineEdit(this); m_edit->setLineWidth(0); m_edit->setReadOnly(true); - m_edit->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + m_edit->tqsetSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Expanding); m_edit->setMinimumHeight(5); m_edit->setMaxLength(1); l->addWidget(m_edit); - m_select = new QPushButton("...", this); - m_select->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::MinimumExpanding); + m_select = new TQPushButton("...", this); + m_select->tqsetSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::MinimumExpanding); m_select->setMinimumHeight(5); l->addWidget(m_select); - connect(m_select, SIGNAL(clicked()), this, SLOT(selectChar())); - connect(m_edit, SIGNAL(textChanged(const QString&)), this, SLOT(slotValueChanged(const QString&))); + connect(m_select, TQT_SIGNAL(clicked()), this, TQT_SLOT(selectChar())); + connect(m_edit, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotValueChanged(const TQString&))); } SymbolCombo::~SymbolCombo() {} -QVariant +TQVariant SymbolCombo::value() const { if (!(m_edit->text().isNull())) - return m_edit->text().at(0).unicode(); + return m_edit->text().tqat(0).tqunicode(); else return 0; } void -SymbolCombo::setValue(const QVariant &value, bool emitChange) +SymbolCombo::setValue(const TQVariant &value, bool emitChange) { -#if QT_VERSION >= 0x030100 if (!(value.isNull())) -#else - if (value.canCast(QVariant::Int)) -#endif { m_edit->blockSignals(true); - m_edit->setText(QChar(value.toInt())); + m_edit->setText(TQChar(value.toInt())); m_edit->blockSignals(false); if (emitChange) emit valueChanged(this); @@ -84,17 +80,17 @@ SymbolCombo::setValue(const QVariant &value, bool emitChange) } void -SymbolCombo::drawViewer(QPainter *p, const QColorGroup &cg, const QRect &r, const QVariant &value) +SymbolCombo::drawViewer(TQPainter *p, const TQColorGroup &cg, const TQRect &r, const TQVariant &value) { // p->eraseRect(r); -// p->drawText(r, Qt::AlignLeft | Qt::AlignVCenter | Qt::SingleLine, QChar(value.toInt())); - Widget::drawViewer(p, cg, r, QString( QChar(value.toInt()) )); +// p->drawText(r, TQt::AlignLeft | TQt::AlignVCenter | TQt::SingleLine, TQChar(value.toInt())); + Widget::drawViewer(p, cg, r, TQString( TQChar(value.toInt()) )); } void SymbolCombo::selectChar() { - KDialogBase dialog(this->topLevelWidget(), "charselect_dialog", true, i18n("Select Char"), + KDialogBase dialog(this->tqtopLevelWidget(), "charselect_dialog", true, i18n("Select Char"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, false); KCharSelect *select = new KCharSelect(&dialog, "select_char"); @@ -103,12 +99,12 @@ SymbolCombo::selectChar() if (!(m_edit->text().isNull())) select->setChar(m_edit->text().at(0)); - if (dialog.exec() == QDialog::Accepted) + if (dialog.exec() == TQDialog::Accepted) m_edit->setText(select->chr()); } void -SymbolCombo::slotValueChanged(const QString&) +SymbolCombo::slotValueChanged(const TQString&) { emit valueChanged(this); } |