summaryrefslogtreecommitdiffstats
path: root/doc/kommander/extending.docbook
diff options
context:
space:
mode:
Diffstat (limited to 'doc/kommander/extending.docbook')
-rw-r--r--doc/kommander/extending.docbook52
1 files changed, 26 insertions, 26 deletions
diff --git a/doc/kommander/extending.docbook b/doc/kommander/extending.docbook
index f4323828..8c5fce1c 100644
--- a/doc/kommander/extending.docbook
+++ b/doc/kommander/extending.docbook
@@ -61,33 +61,33 @@ dialog, we get something like this in the generated header file:
class QShowEvent;
class KomLineEdit : public KLineEdit, public KommanderWidget
{
- Q_OBJECT
+ TQ_OBJECT
- TQ_PROPERTY(QString populationText READ populationText WRITE setPopulationText DESIGNABLE false)
+ TQ_PROPERTY(TQString populationText READ populationText WRITE setPopulationText DESIGNABLE false)
TQ_PROPERTY(QStringList associations READ associatedText WRITE setAssociatedText DESIGNABLE false)
TQ_PROPERTY(bool KommanderWidget READ isKommanderWidget)
public:
- KomLineEdit(QWidget *a_parent, const char *a_name);
+ KomLineEdit(TQWidget *a_parent, const char *a_name);
~KomLineEdit();
- virtual QString widgetText() const;
+ virtual TQString widgetText() const;
virtual bool isKommanderWidget() const;
virtual void setAssociatedText(const QStringList&);
virtual QStringList associatedText() const;
- virtual QString currentState() const;
+ virtual TQString currentState() const;
- virtual QString populationText() const;
- virtual void setPopulationText(const QString&);
+ virtual TQString populationText() const;
+ virtual void setPopulationText(const TQString&);
public slots:
- virtual void setWidgetText(const QString &);
+ virtual void setWidgetText(const TQString &);
virtual void populate();
protected:
void showEvent( QShowEvent *e );
signals:
void widgetOpened();
- void widgetTextChanged(const QString &);
+ void widgetTextChanged(const TQString &);
};
</screen>
<para>Most of this is just template code that you don't need to worry about.
@@ -99,7 +99,7 @@ widget we wish to integrate with &kommander;, and secondly from KommanderWidget.
There are a few parts in the cpp file that are important to each particular widget.
</para>
<screen>
-KomLineEdit::KomLineEdit(QWidget *a_parent, const char *a_name)
+KomLineEdit::KomLineEdit(TQWidget *a_parent, const char *a_name)
: KLineEdit(a_parent, a_name), KommanderWidget(this)
{
QStringList states;
@@ -115,9 +115,9 @@ that had different kinds of states, such as a check box, you might
set three states <emphasis>unchecked</emphasis>, <emphasis>semichecked</emphasis> and <emphasis>checked</emphasis> here.
</para>
<screen>
-QString KomLineEdit::currentState() const
+TQString KomLineEdit::currentState() const
{
- return QString("default");
+ return TQString("default");
}</screen>
<para>We set the states in the constructor above, and this just
returns the current state of the widget. For our widget
@@ -126,12 +126,12 @@ that checks what state your widget is currently in and
return the appropriate string here.
</para>
<screen>
-QString KomLineEdit::widgetText() const
+TQString KomLineEdit::widgetText() const
{
return KLineEdit::text();
}
-void KomLineEdit::setWidgetText(const QString &amp;a_text)
+void KomLineEdit::setWidgetText(const TQString &amp;a_text)
{
KLineEdit::setText(a_text);
emit widgetTextChanged(a_text);
@@ -139,7 +139,7 @@ void KomLineEdit::setWidgetText(const QString &amp;a_text)
</screen>
<para>These are the two most important methods, where the bulk of the
functional code goes.
-<emphasis>QString KomLineEdit::widgetText() const</emphasis> method returns the widget text of the
+<emphasis>TQString KomLineEdit::widgetText() const</emphasis> method returns the widget text of the
widget (the text that the <emphasis>@widgetText</emphasis> special is expanded to in text
associations). For our widget, the widget text is simply the text inside
the line edit, so we just return that. Similarly when setting the widget text,
@@ -162,17 +162,17 @@ enum Functions {
Function2,
LastFunction
};
-KomLineEdit::KomLineEdit(QWidget *a_parent, const char *a_name)
+KomLineEdit::KomLineEdit(TQWidget *a_parent, const char *a_name)
: KLineEdit(a_parent, a_name), KommanderWidget(this)
{
... //code like described above
KommanderPlugin::setDefaultGroup(Group::DCOP);
- KommanderPlugin::registerFunction(Function1, "function1(QString widget, QString arg1, int arg2)", i18n("Call function1 with two arguments, second is optional."), 2, 3);
- KommanderPlugin::registerFunction(function2, "function2(QString widget)", i18n("Get a QString as a result of function2."), 1);
+ KommanderPlugin::registerFunction(Function1, "function1(TQString widget, TQString arg1, int arg2)", i18n("Call function1 with two arguments, second is optional."), 2, 3);
+ KommanderPlugin::registerFunction(function2, "function2(TQString widget)", i18n("Get a TQString as a result of function2."), 1);
}
</screen>
<para>This registers two functions: <emphasis>function1 and function2</emphasis>. The number assigned to the functions (here <emphasis>1160</emphasis> and <emphasis>1161</emphasis>) must be unique, not used in any other plugin or
-inside &kommander;. <emphasis>function1</emphasis> takes two arguments, one is optional, <emphasis>function2</emphasis> takes no argument and returns a string. The <emphasis>QString widget</emphasis> argument in the signatures notes that this functions work on a widget, like: <emphasis>KomLineEdit.function1("foo", 1)</emphasis>.
+inside &kommander;. <emphasis>function1</emphasis> takes two arguments, one is optional, <emphasis>function2</emphasis> takes no argument and returns a string. The <emphasis>TQString widget</emphasis> argument in the signatures notes that this functions work on a widget, like: <emphasis>KomLineEdit.function1("foo", 1)</emphasis>.
</para>
<para>To teach &kommander; that the widget supports these functions, add a method like this:
</para>
@@ -187,7 +187,7 @@ function.
The function code should be handled inside the handleDCOP method:
</para>
<screen>
-QString KomLineEdit::handleDCOP(int function, const QStringList&amp; args)
+TQString KomLineEdit::handleDCOP(int function, const QStringList&amp; args)
{
switch (function)
{
@@ -203,7 +203,7 @@ QString KomLineEdit::handleDCOP(int function, const QStringList&amp; args)
default:
return KommanderWidget::handleDCOP(function, args);
}
- return QString::null;
+ return TQString::null;
}
</screen>
<para>There are cases when the widget should appear differently in the editor than in
@@ -226,7 +226,7 @@ derive from QLabel, and use this in the constructor:
functions, like in the <emphasis>execute</emphasis> function. Here is an example from the AboutDialog widget:
</para>
<screen>
-QString AboutDialog::handleDCOP(int function, const QStringList&amp; args)
+TQString AboutDialog::handleDCOP(int function, const QStringList&amp; args)
{
switch (function) {
...
@@ -287,7 +287,7 @@ class MyKomPlugin : public KommanderPlugin
{
public:
MyKomPlugin();
- virtual QWidget *create( const QString &amp;className, QWidget *parent = 0, const char *name = 0 );
+ virtual TQWidget *create( const TQString &amp;className, TQWidget *parent = 0, const char *name = 0 );
};
</screen>
<para>
@@ -313,7 +313,7 @@ etc.
Regarding the icon, the above example loads a medium sized icon called <emphasis>iconname</emphasis> from the standard &kde; icon location.
</para>
<screen>
-QWidget *MyKomPlugin::create( const QString &amp;className, QWidget *parent, const char *name )
+TQWidget *MyKomPlugin::create( const TQString &amp;className, TQWidget *parent, const char *name )
{
if( className == "KomLineEdit" )
return new KomLineEdit( parent, name );
@@ -410,8 +410,8 @@ You need to add to the <emphasis>editor/widgetfactory.cpp</emphasis> as well:
...
#include "mywidget.h"
...
-QWidget *WidgetFactory::createWidget( const QString &amp;className, QWidget *parent, const char *name, bool init,
- const QRect *r, Qt::Orientation orient )
+TQWidget *WidgetFactory::createWidget( const TQString &amp;className, TQWidget *parent, const char *name, bool init,
+ const QRect *r, TQt::Orientation orient )
{
...
else if (className == "MyWidgetName")