summaryrefslogtreecommitdiffstats
path: root/src/modules/objects/class_wrapper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/objects/class_wrapper.cpp')
-rw-r--r--src/modules/objects/class_wrapper.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/modules/objects/class_wrapper.cpp b/src/modules/objects/class_wrapper.cpp
index 02ff632c..87d2e0c4 100644
--- a/src/modules/objects/class_wrapper.cpp
+++ b/src/modules/objects/class_wrapper.cpp
@@ -29,10 +29,10 @@
#include "kvi_iconmanager.h"
#include "class_widget.h"
-#include <qwidget.h>
+#include <tqwidget.h>
#ifndef COMPILE_USE_QT4
- #include <qobjectlist.h>
- #include <qwidgetlist.h>
+ #include <tqobjectlist.h>
+ #include <tqwidgetlist.h>
#endif
#include "kvi_app.h"
#include "kvi_frame.h"
@@ -47,7 +47,7 @@
@type:
class
@short:
- Provides a wrapper class that hooks to an existing Qt graphic object modifying it.
+ Provides a wrapper class that hooks to an existing TQt graphic object modifying it.
@inherits:
[class]object[/class]
[class]widget[/class]
@@ -58,21 +58,21 @@
in fact, could hook every widget, you can modify the property or you can be inserted other widget as child of this...[br]
in short you have absolute liberty. [br]
The power of this class is fantastic, because it allows the change at "run time" of almost all the elements of the Kvirc.[br]
- But to use this class in optimal way and to exploit its power, you have to know the Qt.... so you won't have limits [br]
- The KVIrc Qt widgets are arranged in trees (just as the objects).[br]
+ But to use this class in optimal way and to exploit its power, you have to know the TQt.... so you won't have limits [br]
+ The KVIrc TQt widgets are arranged in trees (just as the objects).[br]
The difference is that there are more toplevel widgets (and so more than one tree).[br]
- You can use [fnc]$objects.dump()[/fnc] to take a look at the KVIrc Qt objects tree.[br]
+ You can use [fnc]$objects.dump()[/fnc] to take a look at the KVIrc TQt objects tree.[br]
Here is a part of the tree:[br][br]
Ptr 14332520: top level object: kvirc_frame, class KviFrame, visible, rect = -4, -4, 1024, 708
- Ptr 17296024: object: qt_top_dock, class QDockArea
+ Ptr 17296024: object: qt_top_dock, class TQDockArea
Ptr 14882136: object: qt_custom_toolbar, class KviCustomToolBar
- Ptr 18143368: object: qt_dockwidget_internal, class QDockWindowTitleBar
+ Ptr 18143368: object: qt_dockwidget_internal, class TQDockWindowTitleBar
[br][br]
Every listed widget has a "name", a "class" and a set of properties.[br]
The first entry in this example is a KVIrc server window, class "KviFrame" and name "kvirc_frame":
it is a toplevel widget.[br]
The "qt_top_dock", "qt_custom_toolbar" and the "qt_dockwidget_internal" are
- direct children of that widget.[br]
+ direct tqchildren of that widget.[br]
To indicate a specific widget we will use the "class::name" form.[br]
So to indicate the main KVIrc frame you will use "KviFrame::kvirc_main_frame".
Look at this example:[br]
@@ -93,7 +93,7 @@
Now %A. will be point to the wrapped object, therefore we could modify its property or to consider it as if it were an object created by us in scripting. [br]
Obviously, deleting the created object (for example %A) you don't will delete the object of Kvirc (in this case the statusbar). [br]
Another example could be this:[br]
- %A=$new(wrapper,0,test,KviFrame::kvirc_frame,QToolButton::kvirc.identityoptions)[br]
+ %A=$new(wrapper,0,test,KviFrame::kvirc_frame,TQToolButton::kvirc.identityoptions)[br]
%A->$setProperty(usesBigPixmap,0)[br]
In this fool example with the function $setProperty, we has setted the property usesBigPixmap to False, making to become the small icons of the ToolBar.[br]
[br]
@@ -122,17 +122,17 @@ bool KviKvsObject_wrapper::init(KviKvsRunTimeContext * pContext,KviKvsVariantLis
if( !pParams ) return false;
debug ("ci sono i parametri");
- QWidget *pWidget = 0;
+ TQWidget *pWidget = 0;
int i=0;
while(i!=pParams->count())
{
- QString szClass;
- QString szName;
- QString s=0;
+ TQString szClass;
+ TQString szName;
+ TQString s=0;
pParams->at(i)->asString(s);
if (!s.isEmpty())
{
- int idx = s.find("::");
+ int idx = s.tqfind("::");
if( idx != -1 ) {
szClass = s.left(idx);
szName = s.right(s.length() - idx - 2);
@@ -144,7 +144,7 @@ bool KviKvsObject_wrapper::init(KviKvsRunTimeContext * pContext,KviKvsVariantLis
debug ("szName %s",szName.latin1());
debug ("s %s",s.latin1());
- if(KviQString::equalCI(szClass,"WinId"))
+ if(KviTQString::equalCI(szClass,"WinId"))
{
if(pWidget)
{
@@ -156,10 +156,10 @@ bool KviKvsObject_wrapper::init(KviKvsRunTimeContext * pContext,KviKvsVariantLis
} else {
if(pWidget) {
pWidget = findWidgetToWrap(
- !szClass.isEmpty() ? szClass : KviQString::empty, !szName.isEmpty() ? szName : KviQString::empty, pWidget
+ !szClass.isEmpty() ? szClass : KviTQString::empty, !szName.isEmpty() ? szName : KviTQString::empty, pWidget
);
} else {
- pWidget = findTopLevelWidgetToWrap(szClass.isEmpty() ? szClass : KviQString::empty, !szName.isEmpty() ? szName : KviQString::empty);
+ pWidget = findTopLevelWidgetToWrap(szClass.isEmpty() ? szClass : KviTQString::empty, !szName.isEmpty() ? szName : KviTQString::empty);
}
}
if( !pWidget )
@@ -176,52 +176,52 @@ bool KviKvsObject_wrapper::init(KviKvsRunTimeContext * pContext,KviKvsVariantLis
pContext->warning(__tr2qs("Failed to find the widget to wrap"));
return false;
}
- setObject(pWidget,false);
+ setObject(TQT_TQOBJECT(pWidget),false);
return true;
}
-QWidget *KviKvsObject_wrapper::findTopLevelWidgetToWrap(const QString szClass, const QString szName)
+TQWidget *KviKvsObject_wrapper::findTopLevelWidgetToWrap(const TQString szClass, const TQString szName)
{
#ifdef COMPILE_USE_QT4
- QWidgetList list = g_pApp->topLevelWidgets();
+ TQWidgetList list = g_pApp->tqtopLevelWidgets();
if( !list.count() ) return 0;
for(int idx=0;idx<list.count();idx++)
{
bool bNameMatch = false;
bool bClassMatch = false;
if( !szName.isEmpty() )
- bNameMatch = KviQString::equalCI(list.at(idx)->name(), szName);
+ bNameMatch = KviTQString::equalCI(list.at(idx)->name(), szName);
else
bNameMatch = true;
if( !szClass.isEmpty())
- bClassMatch = KviQString::equalCI(list.at(idx)->className(), szClass);
+ bClassMatch = KviTQString::equalCI(list.at(idx)->className(), szClass);
else
bClassMatch = true;
if( bNameMatch && bClassMatch ) {
- QWidget *w = list.at(idx);
+ TQWidget *w = list.at(idx);
return w;
}
}
return 0;
#else
- QWidgetList *list = g_pApp->topLevelWidgets();
+ TQWidgetList *list = g_pApp->tqtopLevelWidgets();
if( !list ) return 0;
- QWidgetListIt it(*list);
+ TQWidgetListIt it(*list);
while( it.current() ) {
bool bNameMatch = false;
bool bClassMatch = false;
if( szName )
- bNameMatch = KviQString::equalCI(it.current()->name(), szName);
+ bNameMatch = KviTQString::equalCI(it.current()->name(), szName);
else
bNameMatch = true;
if( szClass )
- bClassMatch = KviQString::equalCI(it.current()->className(), szClass);
+ bClassMatch = KviTQString::equalCI(it.current()->className(), szClass);
else
bClassMatch = true;
if( bNameMatch && bClassMatch ) {
- QWidget *w = it.current();
+ TQWidget *w = it.current();
delete list;
return w;
}
@@ -233,15 +233,15 @@ QWidget *KviKvsObject_wrapper::findTopLevelWidgetToWrap(const QString szClass, c
#endif
}
-QWidget *KviKvsObject_wrapper::findWidgetToWrap(const char *szClass, const char *szName, QWidget *childOf)
+TQWidget *KviKvsObject_wrapper::findWidgetToWrap(const char *szClass, const char *szName, TQWidget *childOf)
{
#ifdef COMPILE_USE_QT4
- QObjectList list = childOf->queryList(szClass ? szClass : 0, szName ? szName : 0, false, true);
+ TQObjectList list = childOf->queryList(szClass ? szClass : 0, szName ? szName : 0, false, true);
if( !list.count() ) return 0;
for(int idx=0;idx<list.count();idx++)
{
if( list.at(idx)->isWidgetType() ) {
- QWidget *w = (QWidget *)list.at(idx);
+ TQWidget *w = (TQWidget *)list.at(idx);
return w;
}
@@ -249,13 +249,13 @@ QWidget *KviKvsObject_wrapper::findWidgetToWrap(const char *szClass, const char
return 0;
#else
- QObjectList *list = childOf->queryList(szClass ? szClass : 0, szName ? szName : 0, false, true);
+ TQObjectList *list = childOf->queryList(szClass ? szClass : 0, szName ? szName : 0, false, true);
if( !list ) return 0;
- QObjectListIt it(*list);
+ TQObjectListIt it(*list);
while( it.current() ) {
if( it.current()->isWidgetType() ) {
- QWidget *w = (QWidget *) it.current();
+ TQWidget *w = (TQWidget *) it.current();
delete list;
return w;
}