summaryrefslogtreecommitdiffstats
path: root/kommander/widgets/textedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/widgets/textedit.cpp')
-rw-r--r--kommander/widgets/textedit.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/kommander/widgets/textedit.cpp b/kommander/widgets/textedit.cpp
index b59e0513..72f8c754 100644
--- a/kommander/widgets/textedit.cpp
+++ b/kommander/widgets/textedit.cpp
@@ -16,10 +16,10 @@
***************************************************************************/
/* QT INCLUDES */
-#include <qlayout.h>
-#include <qlineedit.h>
-#include <qstringlist.h>
-#include <qevent.h>
+#include <tqlayout.h>
+#include <tqlineedit.h>
+#include <tqstringlist.h>
+#include <tqevent.h>
/* OTHER INCLUDES */
#include <specials.h>
@@ -42,33 +42,33 @@ enum Functions {
LastFunction
};
-TextEdit::TextEdit(QWidget * a_parent, const char *a_name):KTextEdit(a_parent, a_name),
-KommanderWidget((QObject *) this)
+TextEdit::TextEdit(TQWidget * a_parent, const char *a_name):KTextEdit(a_parent, a_name),
+KommanderWidget((TQObject *) this)
{
- QStringList states;
+ TQStringList states;
states << "default";
setStates(states);
setDisplayStates(states);
- connect(this, SIGNAL(textChanged()), this, SLOT(setTextChanged()));
+ connect(this, TQT_SIGNAL(textChanged()), this, TQT_SLOT(setTextChanged()));
KommanderPlugin::setDefaultGroup(Group::DCOP);
- KommanderPlugin::registerFunction(TE_setModified, "setModified(QString widget, bool Modified)", i18n("Set widget modified status."), 1);
- KommanderPlugin::registerFunction(TE_selectText, "selectText(QString widget, int paraFrom, int indexFrom, int paraTo, int indexTo)", i18n("Select a block of text using the paragraph number and character index of the line. You can use the cursorPositionChanged(int, int) signal to get this data in real time into a script."), 5);
- KommanderPlugin::registerFunction(TE_findText, "findText(QString widget, QString Text, bool Case-Sensitive, bool Forward)", i18n("Search for text from the cursor or a specified position. You can specifiy case sensitive search and forward or backward."), 5);
-// KommanderPlugin::registerFunction(TE_findText, "findText(QString widget, QString Text, bool Case-Sensitive, bool Forward, int Paragraph, int Index)", i18n("Search for text from the cursor or a specified position. You can specifiy case sensitive search and forward or backward."), 5, 7);
- KommanderPlugin::registerFunction(TE_paragraphs, "paragraphs(QString widget)", i18n("Get the number of paragraphs in the widget."), 1);
- KommanderPlugin::registerFunction(TE_length, "length(QString widget)", i18n("Get the total length of all text."), 1);
-// KommanderPlugin::registerFunction(TE_getCursorPosition, "getCursorPosition(QString widget)", i18n("Get the cursor postion in the form of paragraph and postion integers."), 1);
- KommanderPlugin::registerFunction(TE_paragraphLength, "paragraphLength(QString widget, int Paragraph)", i18n("Get the length of the paragraph."), 2);
- KommanderPlugin::registerFunction(TE_linesOfParagraph, "linesOfParagraph(QString widget, int Paragraph)", i18n("Get the number of lines in the paragraph."), 2);
- KommanderPlugin::registerFunction(TE_VAsuperScript, "setSuperScript(QString widget)", i18n("Use to set superscript."), 1);
- KommanderPlugin::registerFunction(TE_VAnormalScript, "setNormalScript(QString widget)", i18n("Use to revert from superscript to normal script."), 1);
+ KommanderPlugin::registerFunction(TE_setModified, "setModified(TQString widget, bool Modified)", i18n("Set widget modified status."), 1);
+ KommanderPlugin::registerFunction(TE_selectText, "selectText(TQString widget, int paraFrom, int indexFrom, int paraTo, int indexTo)", i18n("Select a block of text using the paragraph number and character index of the line. You can use the cursorPositionChanged(int, int) signal to get this data in real time into a script."), 5);
+ KommanderPlugin::registerFunction(TE_findText, "findText(TQString widget, TQString Text, bool Case-Sensitive, bool Forward)", i18n("Search for text from the cursor or a specified position. You can specifiy case sensitive search and forward or backward."), 5);
+// KommanderPlugin::registerFunction(TE_findText, "findText(TQString widget, TQString Text, bool Case-Sensitive, bool Forward, int Paragraph, int Index)", i18n("Search for text from the cursor or a specified position. You can specifiy case sensitive search and forward or backward."), 5, 7);
+ KommanderPlugin::registerFunction(TE_paragraphs, "paragraphs(TQString widget)", i18n("Get the number of paragraphs in the widget."), 1);
+ KommanderPlugin::registerFunction(TE_length, "length(TQString widget)", i18n("Get the total length of all text."), 1);
+// KommanderPlugin::registerFunction(TE_getCursorPosition, "getCursorPosition(TQString widget)", i18n("Get the cursor postion in the form of paragraph and postion integers."), 1);
+ KommanderPlugin::registerFunction(TE_paragraphLength, "paragraphLength(TQString widget, int Paragraph)", i18n("Get the length of the paragraph."), 2);
+ KommanderPlugin::registerFunction(TE_linesOfParagraph, "linesOfParagraph(TQString widget, int Paragraph)", i18n("Get the number of lines in the paragraph."), 2);
+ KommanderPlugin::registerFunction(TE_VAsuperScript, "setSuperScript(TQString widget)", i18n("Use to set superscript."), 1);
+ KommanderPlugin::registerFunction(TE_VAnormalScript, "setNormalScript(TQString widget)", i18n("Use to revert from superscript to normal script."), 1);
}
-QString TextEdit::currentState() const
+TQString TextEdit::currentState() const
{
- return QString("default");
+ return TQString("default");
}
TextEdit::~TextEdit()
@@ -80,22 +80,22 @@ bool TextEdit::isKommanderWidget() const
return true;
}
-QStringList TextEdit::associatedText() const
+TQStringList TextEdit::associatedText() const
{
return KommanderWidget::associatedText();
}
-void TextEdit::setAssociatedText(const QStringList & a_at)
+void TextEdit::setAssociatedText(const TQStringList & a_at)
{
KommanderWidget::setAssociatedText(a_at);
}
-void TextEdit::setPopulationText(const QString & a_text)
+void TextEdit::setPopulationText(const TQString & a_text)
{
KommanderWidget::setPopulationText(a_text);
}
-QString TextEdit::populationText() const
+TQString TextEdit::populationText() const
{
return KommanderWidget::populationText();
}
@@ -105,7 +105,7 @@ void TextEdit::populate()
setWidgetText(KommanderWidget::evalAssociatedText(populationText()));
}
-void TextEdit::setWidgetText(const QString & a_text)
+void TextEdit::setWidgetText(const TQString & a_text)
{
setText(a_text);
emit widgetTextChanged(text());
@@ -116,28 +116,28 @@ void TextEdit::setTextChanged()
emit widgetTextChanged(text());
}
-void TextEdit::focusOutEvent( QFocusEvent * e)
+void TextEdit::focusOutEvent( TQFocusEvent * e)
{
- QTextEdit::focusOutEvent(e);
+ TQTextEdit::focusOutEvent(e);
emit lostFocus();
}
-void TextEdit::focusInEvent( QFocusEvent * e)
+void TextEdit::focusInEvent( TQFocusEvent * e)
{
- QTextEdit::focusInEvent(e);
+ TQTextEdit::focusInEvent(e);
emit gotFocus();
}
-void TextEdit::showEvent(QShowEvent * e)
+void TextEdit::showEvent(TQShowEvent * e)
{
- QTextEdit::showEvent(e);
+ TQTextEdit::showEvent(e);
emit widgetOpened();
}
-void TextEdit::contextMenuEvent( QContextMenuEvent * e )
+void TextEdit::contextMenuEvent( TQContextMenuEvent * e )
{
e->accept();
- QPoint p = e->globalPos();
+ TQPoint p = e->globalPos();
emit contextMenuRequested(p.x(), p.y());
}
@@ -146,7 +146,7 @@ bool TextEdit::isFunctionSupported(int f)
return f == DCOP::text || f == DCOP::setText || f == DCOP::selection || f == DCOP::setSelection || f == DCOP::clear || f == DCOP::setEditable || f == DCOP::geometry || f == DCOP::hasFocus || f == DCOP::getBackgroundColor || f == DCOP::setBackgroundColor || f == DCOP::isModified || (f >= FirstFunction && f <= LastFunction);
}
-QString TextEdit::handleDCOP(int function, const QStringList& args)
+TQString TextEdit::handleDCOP(int function, const TQStringList& args)
{
switch (function) {
case DCOP::text:
@@ -160,7 +160,7 @@ QString TextEdit::handleDCOP(int function, const QStringList& args)
insert(args[0]);
break;
case DCOP::clear:
- setWidgetText(QString());
+ setWidgetText(TQString());
break;
case DCOP::setEditable:
setReadOnly(args[0] == "false" || args[0] == "0");
@@ -170,7 +170,7 @@ QString TextEdit::handleDCOP(int function, const QStringList& args)
break;
case DCOP::setBackgroundColor:
{
- QColor color;
+ TQColor color;
color.setNamedColor(args[0]);
this->setPaletteBackgroundColor(color);
break;
@@ -182,47 +182,47 @@ QString TextEdit::handleDCOP(int function, const QStringList& args)
this->setModified(args[0].toInt());
break;
case TE_selectText:
- QTextEdit::setSelection(args[0].toInt(), args[1].toInt(), args[2].toInt(), args[3].toInt());
+ TQTextEdit::setSelection(args[0].toInt(), args[1].toInt(), args[2].toInt(), args[3].toInt());
break;
case TE_length:
- return QString::number(QTextEdit::length() );
+ return TQString::number(TQTextEdit::length() );
break;
/*case TE_getCursorPosition:
- return QString::number(QTextEdit::getCursorPosition() );
+ return TQString::number(TQTextEdit::getCursorPosition() );
break;*/
case TE_paragraphLength:
- return QString::number(QTextEdit::paragraphLength(args[0].toInt() ) );
+ return TQString::number(TQTextEdit::paragraphLength(args[0].toInt() ) );
break;
case TE_linesOfParagraph:
- return QString::number(QTextEdit::linesOfParagraph(args[0].toInt() ) );
+ return TQString::number(TQTextEdit::linesOfParagraph(args[0].toInt() ) );
break;
case TE_findText:
{
// int para = args[3].toInt();
// int idx = args[4].toInt();
-// return QString::number(QTextEdit::find(args[0], args[1].toUInt(), false, args[2].toUInt(), para, idx ));
- return QString::number(QTextEdit::find(args[0], args[1].toUInt(), false ));
+// return TQString::number(TQTextEdit::find(args[0], args[1].toUInt(), false, args[2].toUInt(), para, idx ));
+ return TQString::number(TQTextEdit::find(args[0], args[1].toUInt(), false ));
break;
}
case TE_VAsuperScript:
break;
- QTextEdit::setVerticalAlignment(AlignSuperScript);
+ TQTextEdit::setVerticalAlignment(AlignSuperScript);
case TE_VAnormalScript:
- QTextEdit::setVerticalAlignment(AlignNormal);
+ TQTextEdit::setVerticalAlignment(AlignNormal);
break;
case DCOP::geometry:
{
- QString geo = QString::number(this->x())+" "+QString::number(this->y())+" "+QString::number(this->width())+" "+QString::number(this->height());
+ TQString geo = TQString::number(this->x())+" "+TQString::number(this->y())+" "+TQString::number(this->width())+" "+TQString::number(this->height());
return geo;
break;
}
case DCOP::hasFocus:
- return QString::number(this->hasFocus());
+ return TQString::number(this->hasFocus());
break;
default:
return KommanderWidget::handleDCOP(function, args);
}
- return QString();
+ return TQString();
}