diff options
Diffstat (limited to 'src/modules/objects/class_widget.cpp')
-rw-r--r-- | src/modules/objects/class_widget.cpp | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/src/modules/objects/class_widget.cpp b/src/modules/objects/class_widget.cpp index ea8720b8..de92fc98 100644 --- a/src/modules/objects/class_widget.cpp +++ b/src/modules/objects/class_widget.cpp @@ -42,12 +42,7 @@ #include "class_widget.h" #include "class_pixmap.h" -#ifdef COMPILE_USE_QT4 - #include <TQKeyEvent> - #include <TQDesktopWidget> -#else #include <tqwidgetlist.h> -#endif #include <tqwidget.h> #include <tqtooltip.h> @@ -68,27 +63,7 @@ const char * const widgettypes_tbl[] = { "Maximize", "NoAutoErase" }; -#ifdef COMPILE_USE_QT4 -const TQt::WidgetAttribute widgetattributes_cod[]= { - TQt::WA_OpaquePaintEvent, - TQt::WA_NoSystemBackground, - TQt::WA_PaintOnScreen, - TQt::WA_NoMousePropagation, -}; - -const char * const widgetattributes_tbl[] = { - "opaquePaintEvent", - "noSystemBackground", - "paintOnScreen", - "noMousePropagation", -}; -#define widgetattributes_num (sizeof(widgetattributes_tbl) / sizeof(widgetattributes_tbl[0])) - - -const TQt::WindowType widgettypes_cod[] = { -#else const int widgettypes_cod[] = { -#endif TQt::WType_TopLevel, TQt::WType_Dialog, TQt::WType_Popup, @@ -103,20 +78,11 @@ const int widgettypes_cod[] = { }; -#ifdef COMPILE_USE_QT4 - #define TQT_WIDGET_TABFOCUS TQ_TabFocus #define TQT_WIDGET_CLICKFOCUS TQ_ClickFocus #define TQT_WIDGET_STRONGFOCUS TQ_StrongFocus #define TQT_WIDGET_NOFOCUS TQ_NoFocus -#else - #define TQT_WIDGET_TABFOCUS TQ_TabFocus - #define TQT_WIDGET_CLICKFOCUS TQ_ClickFocus - #define TQT_WIDGET_STRONGFOCUS TQ_StrongFocus - #define TQT_WIDGET_NOFOCUS TQ_NoFocus -#endif - #define widgettypes_num (sizeof(widgettypes_tbl) / sizeof(widgettypes_tbl[0])) @@ -335,11 +301,6 @@ const int widgettypes_cod[] = { This function is called immediately after this widget has been moved. If you call "[cmd]return[/cmd] $true" you will stop the internal processing of this event. The default implementation does nothing. - !fn: <tip:string> $maybeTipEvent(<x_tip_pos:integer>,<y_tip_pos:integer>)[QT4 only] - This event handler is called when a eventualy tip is going to be show. - You can be reimplement this event and set a dynamic tool tip by using "[cmd]return[/cmd] <tooltip_string>". - If a tooltip has setted with [classfnc]$setTooltip[/classfnc] the dynamic tooltip will be ignored. - The default implementation does nothing. !fn: $paintEvent() This event handler can be reimplemented to repaint all or part of the widget. It's needed by the Painter class. @@ -601,11 +562,6 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_widget,"widget","object") KVSO_REGISTER_HANDLER(KviKvsObject_widget,"foregroundColor",function_foregroundColor) KVSO_REGISTER_HANDLER(KviKvsObject_widget,"setMask",function_setMask) - // QT4 only -#ifdef COMPILE_USE_QT4 - KVSO_REGISTER_HANDLER(KviKvsObject_widget,"setAttribute",function_setAttribute) -#endif - // events KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KviKvsObject_widget,"mousePressEvent") KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KviKvsObject_widget,"mouseReleaseEvent") @@ -622,9 +578,6 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_widget,"widget","object") KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KviKvsObject_widget,"moveEvent") KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KviKvsObject_widget,"paintEvent") KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KviKvsObject_widget,"keyPressEvent") -#ifdef COMPILE_USE_QT4 - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KviKvsObject_widget,"maybeTipEvent") -#endif KVSO_END_REGISTERCLASS(KviKvsObject_widget) @@ -654,20 +607,6 @@ bool KviKvsObject_widget::eventFilter(TQObject *o,TQEvent *e) switch(e->type()) { - #ifdef COMPILE_USE_QT4 - case TQEvent::ToolTip: - { - TQHelpEvent *helpEvent = static_cast<TQHelpEvent *>(e); - TQPoint point=helpEvent->pos(); - TQString szTooltip; - KviKvsVariant *tipret=new KviKvsVariant(szTooltip); - KviKvsVariantList params(new KviKvsVariant((kvs_int_t)point.x()),new KviKvsVariant((kvs_int_t)point.y())); - callFunction(this,"maybeTipEvent",tipret,¶ms); - tipret->asString(szTooltip); - TQToolTip::showText(helpEvent->globalPos(),szTooltip); - break; - } - #endif case TQEvent::Paint: { TQRect rect=((TQPaintEvent *)e)->rect(); @@ -1537,11 +1476,7 @@ bool KviKvsObject_widget::function_setWFlags(KviKvsObjectFunctionCall *c) KVSO_PARAMETER("widget_flags",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,wflags) KVSO_PARAMETERS_END(c) if (!widget()) return true; - #ifdef COMPILE_USE_QT4 - TQt::WindowFlags flag,sum=0; - #else int flag,sum=0; - #endif for ( TQStringList::Iterator it = wflags.begin(); it != wflags.end(); ++it ) { @@ -1561,11 +1496,7 @@ bool KviKvsObject_widget::function_setWFlags(KviKvsObjectFunctionCall *c) } -#ifdef COMPILE_USE_QT4 - widget()->setWindowFlags(sum); -#else widget()->reparent(widget()->parentWidget(),sum,TQPoint(widget()->x(),widget()->y())); -#endif return true; } @@ -1707,39 +1638,10 @@ bool KviKvsObject_widget::function_setMask(KviKvsObjectFunctionCall *c) return true; } TQPixmap * pm=((KviKvsObject_pixmap *)obj)->getPixmap(); -#ifdef COMPILE_USE_QT4 - TQBitmap mask(pm->mask()); -#else TQBitmap mask(*pm->mask()); -#endif if (mask.isNull()) c->warning(__tr2qs("Null mask")); widget()->setMask(mask); return true; } -#ifdef COMPILE_USE_QT4 -bool KviKvsObject_widget::function_setAttribute(KviKvsObjectFunctionCall *c) -{ - TQString attribute; - bool bFlag; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget_atribute",KVS_PT_STRING,0,attribute) - KVSO_PARAMETER("bool_flag",KVS_PT_BOOLEAN,0,bFlag) - KVSO_PARAMETERS_END(c) - if (!widget()) return true; - bool found=false; - unsigned int j = 0; - for(; j < widgetattributes_num; j++) - { - if(KviTQString::equalCI(attribute, widgetattributes_tbl[j])) - { - found=true; - break; - } - } - if(found)widget()->setAttribute(widgetattributes_cod[j],bFlag); - else c->warning(__tr2qs("Unknown widget attribute '%Q'"),&attribute); - return true; -} -#endif #include "m_class_widget.moc" |