summaryrefslogtreecommitdiffstats
path: root/src/gui/lineedit.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/lineedit.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/lineedit.cpp')
-rw-r--r--src/gui/lineedit.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/gui/lineedit.cpp b/src/gui/lineedit.cpp
index 6248880..68a403d 100644
--- a/src/gui/lineedit.cpp
+++ b/src/gui/lineedit.cpp
@@ -17,55 +17,55 @@
#include <kactioncollection.h>
#include <kspell.h>
-#include <qapplication.h>
-#include <qpainter.h>
-#include <qpopupmenu.h>
+#include <tqapplication.h>
+#include <tqpainter.h>
+#include <tqpopupmenu.h>
using Tellico::GUI::LineEdit;
-LineEdit::LineEdit(QWidget* parent_, const char* name_) : KLineEdit(parent_, name_)
+LineEdit::LineEdit(TQWidget* tqparent_, const char* name_) : KLineEdit(tqparent_, name_)
, m_drawHint(false)
, m_allowSpellCheck(false)
, m_enableSpellCheck(true)
, m_spell(0) {
- m_spellAction = KStdAction::spelling(this, SLOT(slotCheckSpelling()), new KActionCollection(this));
+ m_spellAction = KStdAction::spelling(TQT_TQOBJECT(this), TQT_SLOT(slotCheckSpelling()), new KActionCollection(this));
}
void LineEdit::clear() {
KLineEdit::clear();
m_drawHint = true;
- repaint();
+ tqrepaint();
}
-void LineEdit::setText(const QString& text_) {
+void LineEdit::setText(const TQString& text_) {
m_drawHint = text_.isEmpty();
- repaint();
+ tqrepaint();
KLineEdit::setText(text_);
}
-void LineEdit::setHint(const QString& hint_) {
+void LineEdit::setHint(const TQString& hint_) {
m_hint = hint_;
m_drawHint = text().isEmpty();
- repaint();
+ tqrepaint();
}
-void LineEdit::focusInEvent(QFocusEvent* event_) {
+void LineEdit::focusInEvent(TQFocusEvent* event_) {
if(m_drawHint) {
m_drawHint = false;
- repaint();
+ tqrepaint();
}
KLineEdit::focusInEvent(event_);
}
-void LineEdit::focusOutEvent(QFocusEvent* event_) {
+void LineEdit::focusOutEvent(TQFocusEvent* event_) {
if(text().isEmpty()) {
m_drawHint = true;
- repaint();
+ tqrepaint();
}
KLineEdit::focusOutEvent(event_);
}
-void LineEdit::drawContents(QPainter* painter_) {
+void LineEdit::drawContents(TQPainter* painter_) {
// draw the regular line edit first
KLineEdit::drawContents(painter_);
@@ -75,12 +75,12 @@ void LineEdit::drawContents(QPainter* painter_) {
}
// save current pen
- QPen oldPen = painter_->pen();
+ TQPen oldPen = painter_->pen();
// follow lead of kdepim and amarok, use disabled text color
- painter_->setPen(palette().color(QPalette::Disabled, QColorGroup::Text));
+ painter_->setPen(palette().color(TQPalette::Disabled, TQColorGroup::Text));
- QRect rect = contentsRect();
+ TQRect rect = contentsRect();
// again, follow kdepim and amarok lead, and pad by 2 pixels
rect.rLeft() += 2;
painter_->drawText(rect, AlignAuto | AlignVCenter, m_hint);
@@ -89,14 +89,14 @@ void LineEdit::drawContents(QPainter* painter_) {
painter_->setPen(oldPen);
}
-QPopupMenu* LineEdit::createPopupMenu() {
- QPopupMenu* popup = KLineEdit::createPopupMenu();
+TQPopupMenu* LineEdit::createPopupMenu() {
+ TQPopupMenu* popup = KLineEdit::createPopupMenu();
if(!popup) {
return popup;
}
- if(m_allowSpellCheck && echoMode() == QLineEdit::Normal && !isReadOnly()) {
+ if(m_allowSpellCheck && echoMode() == TQLineEdit::Normal && !isReadOnly()) {
popup->insertSeparator();
m_spellAction->plug(popup);
@@ -110,22 +110,22 @@ void LineEdit::slotCheckSpelling() {
delete m_spell;
// re-use the action string to get translations
m_spell = new KSpell(this, m_spellAction->text(),
- this, SLOT(slotSpellCheckReady(KSpell*)), 0, true, true);
-
- connect(m_spell, SIGNAL(death()),
- SLOT(spellCheckerFinished()));
- connect(m_spell, SIGNAL(misspelling( const QString &, const QStringList &, unsigned int)),
- SLOT(spellCheckerMisspelling( const QString &, const QStringList &, unsigned int)));
- connect(m_spell, SIGNAL(corrected(const QString &, const QString &, unsigned int)),
- SLOT(spellCheckerCorrected(const QString &, const QString &, unsigned int)));
+ TQT_TQOBJECT(this), TQT_SLOT(slotSpellCheckReady(KSpell*)), 0, true, true);
+
+ connect(m_spell, TQT_SIGNAL(death()),
+ TQT_SLOT(spellCheckerFinished()));
+ connect(m_spell, TQT_SIGNAL(misspelling( const TQString &, const TQStringList &, unsigned int)),
+ TQT_SLOT(spellCheckerMisspelling( const TQString &, const TQStringList &, unsigned int)));
+ connect(m_spell, TQT_SIGNAL(corrected(const TQString &, const TQString &, unsigned int)),
+ TQT_SLOT(spellCheckerCorrected(const TQString &, const TQString &, unsigned int)));
}
void LineEdit::slotSpellCheckReady(KSpell* spell) {
spell->check(text());
- connect(spell, SIGNAL(done(const QString&)), SLOT(slotSpellCheckDone(const QString&)));
+ connect(spell, TQT_SIGNAL(done(const TQString&)), TQT_SLOT(slotSpellCheckDone(const TQString&)));
}
-void LineEdit::slotSpellCheckDone(const QString& newText) {
+void LineEdit::slotSpellCheckDone(const TQString& newText) {
if(newText != text()) {
setText(newText);
}
@@ -136,11 +136,11 @@ void LineEdit::spellCheckerFinished() {
m_spell = 0;
}
-void LineEdit::spellCheckerMisspelling(const QString &text, const QStringList&, unsigned int pos) {
+void LineEdit::spellCheckerMisspelling(const TQString &text, const TQStringList&, unsigned int pos) {
setSelection(pos, pos + text.length());
}
-void LineEdit::spellCheckerCorrected(const QString& oldWord, const QString& newWord, unsigned int pos) {
+void LineEdit::spellCheckerCorrected(const TQString& oldWord, const TQString& newWord, unsigned int pos) {
if(oldWord != newWord) {
setSelection(pos, pos + oldWord.length());
insert(newWord);