diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-08-24 21:28:39 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-08-31 10:03:10 +0900 |
commit | 030a2248f3630fd0404df98beffc78b5b5ca4c31 (patch) | |
tree | 75d55e7e177ca48e69d59f74181ce37841ecd51b /src/modules/objects | |
parent | 17118265cf93b35b0b68e450ea5f43046c1d81c3 (diff) | |
download | kvirc-030a2248f3630fd0404df98beffc78b5b5ca4c31.tar.gz kvirc-030a2248f3630fd0404df98beffc78b5b5ca4c31.zip |
Drop USE_QT4 code
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/modules/objects')
28 files changed, 4 insertions, 570 deletions
diff --git a/src/modules/objects/class_button.cpp b/src/modules/objects/class_button.cpp index a23dcda1..d5d13717 100644 --- a/src/modules/objects/class_button.cpp +++ b/src/modules/objects/class_button.cpp @@ -147,18 +147,10 @@ bool KviKvsObject_button::functionSetImage(KviKvsObjectFunctionCall *c) if (!widget()) return true; TQPixmap * pix = g_pIconManager->getImage(icon); if(pix){ - #ifdef COMPILE_USE_QT4 - ((TQPushButton *)widget())->setIconSet(*pix); - #else ((TQPushButton *)widget())->setIconSet(TQIconSet(*pix,TQIconSet::Small)); - #endif } else{ - #ifdef COMPILE_USE_QT4 - ((TQPushButton *)widget())->setIcon(TQIconSet()); - #else ((TQPushButton *)widget())->setIconSet(TQIconSet()); - #endif } return true; } diff --git a/src/modules/objects/class_buttongroup.cpp b/src/modules/objects/class_buttongroup.cpp index 96ecc40c..38de0fd4 100644 --- a/src/modules/objects/class_buttongroup.cpp +++ b/src/modules/objects/class_buttongroup.cpp @@ -72,13 +72,7 @@ KVSO_END_CONSTRUCTOR(KviKvsObject_buttongroup) // CHECK ME bool KviKvsObject_buttongroup::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) { - #ifdef COMPILE_USE_QT4 - TQButtonGroup *group=new TQButtonGroup(parentScriptWidget()); - group->setObjectName(name()); - setObject(group,true); - #else setObject(TQT_TQOBJECT(new TQButtonGroup(name(),parentScriptWidget())), true); - #endif return true; diff --git a/src/modules/objects/class_dockwindow.cpp b/src/modules/objects/class_dockwindow.cpp index 5e2beb1e..bc491dcb 100644 --- a/src/modules/objects/class_dockwindow.cpp +++ b/src/modules/objects/class_dockwindow.cpp @@ -27,13 +27,8 @@ #include "kvi_frame.h" #include "kvi_locale.h" #include "kvi_qstring.h" -#ifdef COMPILE_USE_QT4 - #include <TQDockWidget> - #define TQT_DOCK_WINDOW TQDockWidget -#else #include <tqdockwindow.h> #define TQT_DOCK_WINDOW TQDockWindow -#endif #include <tqlayout.h> /* @@ -96,13 +91,7 @@ KVSO_END_DESTRUCTOR(KviKvsObject_dockwindow) bool KviKvsObject_dockwindow::init(KviKvsRunTimeContext * pContext,KviKvsVariantList * pParams) { -#ifdef COMPILE_USE_QT4 - TQDockWidget * pWidget = new TQDockWidget(g_pFrame); - pWidget->setObjectName(getName()); - setObject(pWidget); -#else //!COMPILE_USE_QT4 setObject(TQT_TQOBJECT(new TQT_DOCK_WINDOW(g_pFrame,getName())),true); -#endif //!COMPILE_USE_QT4 return true; } @@ -146,23 +135,15 @@ bool KviKvsObject_dockwindow::function_addWidget(KviKvsObjectFunctionCall *c) c->warning(__tr2qs("The added widget is not a child of this dock window")); } -#ifdef COMPILE_USE_QT4 - _pDockWindow->setWidget((TQWidget *)(pWidget->object())); -#else //!COMPILE_USE_QT4 _pDockWindow->boxLayout()->addWidget((TQWidget *)(pWidget->object())); ((TQWidget *)(pWidget->object()))->show(); -#endif //!COMPILE_USE_QT4 return true; } bool KviKvsObject_dockwindow::function_orientation(KviKvsObjectFunctionCall * c) { if(!widget())return true; // hum ? dead ? -#ifdef COMPILE_USE_QT4 - c->returnValue()->setString(TQString("horizontal")); -#else //!COMPILE_USE_QT4 c->returnValue()->setString(_pDockWindow->orientation() == Qt::Horizontal ? TQString("horizontal") : TQString("vertical")); -#endif //!COMPILE_USE_QT4 return true; } @@ -174,20 +155,14 @@ bool KviKvsObject_dockwindow::function_setOrientation(KviKvsObjectFunctionCall * KVSO_PARAMETERS_END(c) if(!widget())return true; // hum ? dead ? -#ifndef COMPILE_USE_QT4 _pDockWindow->setOrientation(KviTQString::equalCI(szOrientation,"vertical") ? Qt::Vertical : Qt::Horizontal); -#endif //!COMPILE_USE_QT4 return true; } bool KviKvsObject_dockwindow::function_resizeEnabled(KviKvsObjectFunctionCall * c) { if(!widget())return true; // hum ? dead ? -#ifdef COMPILE_USE_QT4 - c->returnValue()->setBoolean(false); -#else //!COMPILE_USE_QT4 c->returnValue()->setBoolean(_pDockWindow->isResizeEnabled()); -#endif //!COMPILE_USE_QT4 return true; } @@ -200,9 +175,7 @@ bool KviKvsObject_dockwindow::function_setResizeEnabled(KviKvsObjectFunctionCall if(!widget())return true; // hum ? dead ? -#ifndef COMPILE_USE_QT4 _pDockWindow->setResizeEnabled(bResizeEnabled); -#endif //!COMPILE_USE_QT4 return true; } @@ -215,28 +188,12 @@ bool KviKvsObject_dockwindow::function_setAllowedDockAreas(KviKvsObjectFunctionC if(!widget())return true; // hum ? dead ? -#ifdef COMPILE_USE_QT4 - TQt::DockWidgetAreas fAreas = TQt::NoDockWidgetArea; - if(szFlags.find('t',false))fAreas |= TQt::TopDockWidgetArea; - if(szFlags.find('l',false))fAreas |= TQt::LeftDockWidgetArea; - if(szFlags.find('r',false))fAreas |= TQt::RightDockWidgetArea; - if(szFlags.find('b',false))fAreas |= TQt::BottomDockWidgetArea; - _pDockWindow->setAllowedAreas(fAreas); - TQDockWidget::DockWidgetFeatures fFeatures = _pDockWindow->features(); - if(szFlags.find('f',false)) - fFeatures |= TQDockWidget::DockWidgetFloatable; - else - fFeatures &= ~TQDockWidget::DockWidgetFloatable; - // no support for minimized dock widgets - _pDockWindow->setFeatures(fFeatures); -#else //!COMPILE_USE_QT4 g_pFrame->setDockEnabled(_pDockWindow,TQt::DockTop,szFlags.find('t',false) != -1); g_pFrame->setDockEnabled(_pDockWindow,TQt::DockLeft,szFlags.find('l',false) != -1); g_pFrame->setDockEnabled(_pDockWindow,TQt::DockRight,szFlags.find('r',false) != -1); g_pFrame->setDockEnabled(_pDockWindow,TQt::DockBottom,szFlags.find('b',false) != -1); g_pFrame->setDockEnabled(_pDockWindow,TQt::DockTornOff,szFlags.find('f',false) != -1); g_pFrame->setDockEnabled(_pDockWindow,TQt::DockMinimized,szFlags.find('m',false) != -1); -#endif //!COMPILE_USE_QT4 return true; } @@ -250,18 +207,6 @@ bool KviKvsObject_dockwindow::function_dock(KviKvsObjectFunctionCall * c) KVSO_PARAMETERS_END(c) if(!widget())return true; // hum ? dead ? -#ifdef COMPILE_USE_QT4 - g_pFrame->removeDockWidget(_pDockWindow); - if(szDock.find('m',false) == -1)_pDockWindow->setFloating(false); - if(szDock.find('t',false) != -1)g_pFrame->addDockWidget(TQt::TopDockWidgetArea,_pDockWindow); - else if(szDock.find('l',false) != -1)g_pFrame->addDockWidget(TQt::LeftDockWidgetArea,_pDockWindow); - else if(szDock.find('r',false) != -1)g_pFrame->addDockWidget(TQt::RightDockWidgetArea,_pDockWindow); - else if(szDock.find('b',false) != -1)g_pFrame->addDockWidget(TQt::BottomDockWidgetArea,_pDockWindow); - else if(szDock.find('f',false) != -1)_pDockWindow->setFloating(true); - else if(szDock.find('m',false) != -1)tqDebug("Sorry: no support for minimized dock widgets in TQt4"); - else c->warning(__tr2qs("Invalid dock area specified")); - -#else //!COMPILE_USE_QT4 if(szDock.find('t',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockTop,false,100); else if(szDock.find('l',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockLeft,false,100); else if(szDock.find('r',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockRight,false,100); @@ -269,7 +214,6 @@ bool KviKvsObject_dockwindow::function_dock(KviKvsObjectFunctionCall * c) else if(szDock.find('f',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockTornOff,false,100); else if(szDock.find('m',false) != -1)g_pFrame->moveDockWindow(_pDockWindow,TQt::DockMinimized,false,100); else c->warning(__tr2qs("Invalid dock area specified")); -#endif //!COMPILE_USE_QT4 return true; } diff --git a/src/modules/objects/class_file.cpp b/src/modules/objects/class_file.cpp index 0763a2aa..9e4b2790 100644 --- a/src/modules/objects/class_file.cpp +++ b/src/modules/objects/class_file.cpp @@ -39,27 +39,13 @@ const char * const mod_tbl[] = { "Append", "Truncate" }; -#ifdef COMPILE_USE_QT4 -#define IO_RAW TQIODevice::Unbuffered -#define IO_READONLY TQIODevice::ReadOnly -#define IO_WRITEONLY TQIODevice::WriteOnly -#define IO_READWRITE TQIODevice::ReadWrite -#define IO_APPEND TQIODevice::Append -#define IO_TRUNCATE TQIODevice::Truncate -//#define IO_TRANSLATE TQIODevice::Text -#else #define IO_RAW IO_Raw #define IO_READONLY IO_ReadOnly #define IO_WRITEONLY IO_WriteOnly #define IO_READWRITE IO_ReadWrite #define IO_APPEND IO_Append #define IO_TRUNCATE IO_Truncate -#endif -#ifdef COMPILE_USE_QT4 -const TQIODevice::OpenMode mod_cod[] = { -#else const int mod_cod[] = { -#endif IO_RAW, IO_READONLY, IO_WRITEONLY, @@ -225,29 +211,6 @@ bool KviKvsObject_file::functionopen(KviKvsObjectFunctionCall *c) c->warning(__tr2qs("Empty filename string")); return true; } - #ifdef COMPILE_USE_QT4 - TQIODevice::OpenMode mod,sum; - if (modes.empty()) sum = IO_READONLY; // if no parameters given, default to ReadWrite | Append - else - { - for ( int idx=0;idx<modes.count();idx++) - { - mod = IO_ReadOnly; - for(unsigned int j = 0; j < mod_num; j++) - { - if(KviTQString::equalCI(modes.at(idx), mod_tbl[j])) - { - mod=mod_cod[j]; - break; - } - } - if(mod!=IO_ReadOnly) - sum = sum | mod; - else - c->warning(__tr2qs("No such open mode: '%Q'"),&modes.at(idx)); - } - } -#else int mod,sum=0; if (!modes.first()) sum = IO_READONLY; // if no parameters given, default to ReadWrite | Append else @@ -270,7 +233,6 @@ if (!modes.first()) sum = IO_READONLY; // if no parameters given, default to Rea c->warning(__tr2qs("No such open mode: '%Q'"),&(*it)); } } -#endif m_pFile->open(sum); return true; } diff --git a/src/modules/objects/class_groupbox.cpp b/src/modules/objects/class_groupbox.cpp index 7c011403..6157b035 100644 --- a/src/modules/objects/class_groupbox.cpp +++ b/src/modules/objects/class_groupbox.cpp @@ -184,13 +184,7 @@ KVSO_END_CONSTRUCTOR(KviKvsObject_groupbox) bool KviKvsObject_groupbox::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) { -#ifdef COMPILE_USE_QT4 - KviTalGroupBox *groupbox=new KviTalGroupBox(name(),parentScriptWidget()); - groupbox->setObjectName(name()); - setObject(groupbox,true); -#else setObject(TQT_TQOBJECT(new KviTalGroupBox(name(),parentScriptWidget())), true); -#endif return true; } diff --git a/src/modules/objects/class_label.cpp b/src/modules/objects/class_label.cpp index 4411a26d..f160565e 100644 --- a/src/modules/objects/class_label.cpp +++ b/src/modules/objects/class_label.cpp @@ -44,16 +44,6 @@ const char * const align_tbl[] = { "Bottom", "WordBreak" }; -#ifdef COMPILE_USE_QT4 - #define TQT_LABEL_ALIGNLEFT TQt::AlignLeft - #define TQT_LABEL_ALIGNRIGHT TQt::AlignRight - #define TQT_LABEL_ALIGNHCENTER TQt::AlignHCenter - #define TQT_LABEL_ALIGNVCENTER TQt::AlignVCenter - #define TQT_LABEL_ALIGNCENTER TQt::AlignCenter - #define TQT_LABEL_ALIGNTOP TQt::AlignTop - #define TQT_LABEL_ALIGNBOTTOM TQt::AlignBottom - #define TQT_LABEL_JUSTIFY TQt::AlignJustify -#else #define TQT_LABEL_ALIGNLEFT TQLabel::AlignLeft #define TQT_LABEL_ALIGNRIGHT TQLabel::AlignRight #define TQT_LABEL_ALIGNHCENTER TQLabel::AlignHCenter @@ -62,7 +52,6 @@ const char * const align_tbl[] = { #define TQT_LABEL_ALIGNTOP TQLabel::AlignTop #define TQT_LABEL_ALIGNBOTTOM TQLabel::AlignBottom #define TQT_LABEL_JUSTIFY TQLabel::WordBreak -#endif const int align_cod[] = { TQT_LABEL_ALIGNLEFT, @@ -276,21 +265,13 @@ bool KviKvsObject_label::functionSetAutoResize(KviKvsObjectFunctionCall *c) KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) KVSO_PARAMETERS_END(c) - #ifdef COMPILE_USE_QT4 - return true; - #else if(widget()) ((TQLabel *)widget())->setAutoResize(bEnabled); return true; - #endif } bool KviKvsObject_label::functionAutoResize(KviKvsObjectFunctionCall *c) { - #ifdef COMPILE_USE_QT4 - if (widget()) c->returnValue()->setBoolean(true); - #else if (widget()) c->returnValue()->setBoolean(((TQLabel *)widget())->autoResize()); - #endif return true; } // diff --git a/src/modules/objects/class_layout.cpp b/src/modules/objects/class_layout.cpp index 7b2d252d..51afea9c 100644 --- a/src/modules/objects/class_layout.cpp +++ b/src/modules/objects/class_layout.cpp @@ -26,17 +26,10 @@ #include "class_layout.h" -#ifdef COMPILE_USE_QT4 -#define TQLAYOUT_AUTO_CONSTRAINT TQLayout::SetDefaultConstraint -#define TQLAYOUT_FIXED TQLayout::SetFixedSize -#define TQLAYOUT_FREE_RESIZE TQLayout::SetNoConstraint -#define TQLAYOUT_MINIMUM TQLayout::SetMinimumSize -#else #define TQLAYOUT_AUTO_CONSTRAINT TQLayout::Auto #define TQLAYOUT_FIXED TQLayout::Fixed #define TQLAYOUT_FREE_RESIZE TQLayout::FreeResize #define TQLAYOUT_MINIMUM TQLayout::Minimum -#endif /* @@ -258,11 +251,7 @@ bool KviKvsObject_layout::functionSetResizeMode(KviKvsObjectFunctionCall *c) KVSO_PARAMETER("resize_mode",KVS_PT_STRING,0,szMode) KVSO_PARAMETERS_END(c) if(!widget())return true; -#ifdef COMPILE_USE_QT4 - TQLayout::SizeConstraint r = TQLAYOUT_AUTO_CONSTRAINT; -#else TQLayout::ResizeMode r = TQLAYOUT_AUTO_CONSTRAINT; -#endif if(KviTQString::equalCI(szMode,"FreeResize")) r = TQLAYOUT_FREE_RESIZE; else if(KviTQString::equalCI(szMode,"Minimum")) r = TQLAYOUT_MINIMUM; else if(KviTQString::equalCI(szMode,"Fixed"))r = TQLAYOUT_FIXED; diff --git a/src/modules/objects/class_listview.cpp b/src/modules/objects/class_listview.cpp index f21417c1..655972f5 100644 --- a/src/modules/objects/class_listview.cpp +++ b/src/modules/objects/class_listview.cpp @@ -26,12 +26,7 @@ #include "kvi_tal_listview.h" -#ifdef COMPILE_USE_QT4 -#include <tq3header.h> -#include <tqevent.h> -#else #include <tqheader.h> -#endif #include "class_listview.h" #include "kvi_error.h" #include "kvi_debug.h" diff --git a/src/modules/objects/class_mainwindow.cpp b/src/modules/objects/class_mainwindow.cpp index 47c8fc68..60c39b9a 100644 --- a/src/modules/objects/class_mainwindow.cpp +++ b/src/modules/objects/class_mainwindow.cpp @@ -108,7 +108,6 @@ bool KviKvsObject_mainwindow::functionsetDockEnabled(KviKvsObjectFunctionCall *c KVSO_PARAMETERS_END(c) if(widget()) { -#ifndef COMPILE_USE_QT4 if(KviTQString::equalCI(szDockarea,"Top")) ((KviTalMainWindow *)widget())->setDockEnabled(TQt::DockTop,bFlag); else if(KviTQString::equalCI(szDockarea,"Left")) @@ -124,7 +123,6 @@ bool KviKvsObject_mainwindow::functionsetDockEnabled(KviKvsObjectFunctionCall *c else if(KviTQString::equalCI(szDockarea,"Unmanaged")) ((KviTalMainWindow *)widget())->setDockEnabled(TQt::DockUnmanaged,bFlag); else c->warning(__tr2qs("Unknown dock area '%Q'"),&szDockarea); -#endif } return true; @@ -138,7 +136,6 @@ bool KviKvsObject_mainwindow::functionisDockEnabled(KviKvsObjectFunctionCall *c) KVSO_PARAMETER("dock_area",KVS_PT_STRING,0,szDockarea) KVSO_PARAMETERS_END(c) if(!widget()) return true; -#ifndef COMPILE_USE_QT4 if(KviTQString::equalCI(szDockarea,"Top")) bFlag=((KviTalMainWindow *)widget())->isDockEnabled(TQt::DockTop); else if(KviTQString::equalCI(szDockarea,"Left")) bFlag=((KviTalMainWindow *)widget())->isDockEnabled(TQt::DockLeft); else if(KviTQString::equalCI(szDockarea,"Right")) bFlag=((KviTalMainWindow *)widget())->isDockEnabled(TQt::DockRight); @@ -151,7 +148,6 @@ bool KviKvsObject_mainwindow::functionisDockEnabled(KviKvsObjectFunctionCall *c) c->warning(__tr2qs("Unknown dock area '%Q'"),&szDockarea); return true; } -#endif c->returnValue()->setBoolean(bFlag); return true; diff --git a/src/modules/objects/class_multilineedit.cpp b/src/modules/objects/class_multilineedit.cpp index d11608a6..d6bba076 100644 --- a/src/modules/objects/class_multilineedit.cpp +++ b/src/modules/objects/class_multilineedit.cpp @@ -28,17 +28,6 @@ #include "kvi_locale.h" #include "kvi_malloc.h" #include <tqfile.h> -#ifdef COMPILE_USE_QT4 - #include <tq3multilineedit.h> -#include <TQTextStream> - -#include <tq3stylesheet.h> -#define KviTalMultiLineEdit Q3MultiLineEdit -#define TQTEXTEDIT_AUTO_ALL Q3TextEdit::AutoAll -#define TQTEXTEDIT_AUTO_NONE Q3TextEdit::AutoNone -#define TQTEXTEDIT_AUTO_BULLET_LIST Q3TextEdit::AutoBulletList - -#else #include <tqtextstream.h> #include <tqmultilineedit.h> @@ -47,7 +36,6 @@ #define TQTEXTEDIT_AUTO_NONE TQTextEdit::AutoNone #define TQTEXTEDIT_AUTO_BULLET_LIST TQTextEdit::AutoBulletList -#endif #include "class_multilineedit.h" @@ -1076,13 +1064,8 @@ bool KviKvsObject_mledit::functionloadFile(KviKvsObjectFunctionCall *c) TQTextStream ts( &file ); TQString txt = ts.read(); -#ifdef COMPILE_USE_QT4 - if ( !Q3StyleSheet::mightBeRichText( txt ) ) - txt = Q3StyleSheet::convertFromPlainText( txt, Q3StyleSheetItem::WhiteSpacePre ); -#else if ( !TQStyleSheet::mightBeRichText( txt ) ) txt = TQStyleSheet::convertFromPlainText( txt, TQStyleSheetItem::WhiteSpacePre ); -#endif ((KviTalMultiLineEdit *)widget())->setText( txt ); file.close(); diff --git a/src/modules/objects/class_painter.cpp b/src/modules/objects/class_painter.cpp index 28b774ec..b7f78d23 100644 --- a/src/modules/objects/class_painter.cpp +++ b/src/modules/objects/class_painter.cpp @@ -149,18 +149,6 @@ Sets the background mode of the painter to <bgMode>: valid values are:[br] - Transparent (that is the default value);[br] - Opaque.[br] - !fn: $setOpacity(<opacity_factor:real>) [QT4 ONLY] - Sets the painter opacity that affects all painter operations (drawpixmap, drawtext...). Valid values range are from 0 (total transparency) to 1 (total opacity)[br] - You must invoke the [classfnc]$begin[/classfnc] before using it. - !fn: $setTextAntialiasing(<boolean>) [QT4 ONLY] - Enable/disable antialias in text if possible. - You must call the [classfnc]$begin[/classfnc] before using it. - !fn: $setAntialiasing(<boolean>) [QT4 ONLY] - Enable/disable antialias in edges of primitives if possible. - You must call the [classfnc]$begin[/classfnc] before using it. - !fn: $setSmoothPixmapTransform(<boolean>) [QT4 ONLY] - Enable/disable smooth bilinear pixmap transformation algorithm (such as bilinear). - You must call the [classfnc]$begin[/classfnc] before using it. Example:[br] [br] class (hello,widget)[br] @@ -371,12 +359,6 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_painter,"painter","object") KVSO_REGISTER_HANDLER(KviKvsObject_painter,"translate",functiontranslateMatrix) KVSO_REGISTER_HANDLER(KviKvsObject_painter,"reset",functionresetMatrix) -#ifdef COMPILE_USE_QT4 - KVSO_REGISTER_HANDLER(KviKvsObject_painter,"setOpacity",functionsetOpacity) - KVSO_REGISTER_HANDLER(KviKvsObject_painter,"setTextAntialiasing",functionsetTextAntialiasing) - KVSO_REGISTER_HANDLER(KviKvsObject_painter,"setAntialiasing",functionsetAntialiasing) - KVSO_REGISTER_HANDLER(KviKvsObject_painter,"setSmoothPixmapTransform",functionsetSmoothPixmapTransform) -#endif KVSO_REGISTER_HANDLER(KviKvsObject_painter,"begin",functionbegin) KVSO_REGISTER_HANDLER(KviKvsObject_painter,"end",functionend) @@ -596,9 +578,7 @@ bool KviKvsObject_painter::functiondrawWinFocusRect(KviKvsObjectFunctionCall *c) KVSO_PARAMETERS_END(c) TQString function="$drawWinFocusRect"; KVSO_PARAMETERS_PAINTER(pXOrArray,iY,iW,iH) -#ifndef COMPILE_USE_QT4 if(m_pPainter) m_pPainter->drawWinFocusRect(iX,iY,iW,iH); -#endif return true; } bool KviKvsObject_painter::functiondrawEllipse(KviKvsObjectFunctionCall *c) @@ -843,25 +823,11 @@ bool KviKvsObject_painter::functiondrawText(KviKvsObjectFunctionCall *c) KVSO_PARAMETER("mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szMode) KVSO_PARAMETERS_END(c) if(!m_pPainter)return true; -#ifdef COMPILE_USE_QT4 - if (!szMode.isEmpty()){ - if(KviTQString::equalCI(szMode,"RTL"))m_pPainter->setLayoutDirection(TQt::RightToLeft); - else if(KviTQString::equalCI(szMode,"LTR"))m_pPainter->setLayoutDirection(TQt::LeftToRight); - else - { - c->warning(__tr2qs("Invalid mode '%Q'"),&szMode); - return true; - } - } - - m_pPainter->drawText(iX,iY,szText); -#else if(KviTQString::equalCI(szMode,"Auto")) m_pPainter->drawText(iX,iY,szText,iLen,TQPainter::Auto); else if(KviTQString::equalCI(szMode,"RTL")) m_pPainter->drawText(iX,iY,szText,iLen,TQPainter::RTL); else if(KviTQString::equalCI(szMode,"LTR"))m_pPainter->drawText(iX,iY,szText,iLen,TQPainter::LTR); else c->warning(__tr2qs("Invalid mode '%Q'"),&szMode); -#endif return true; } @@ -955,52 +921,6 @@ bool KviKvsObject_painter::functionresetMatrix(KviKvsObjectFunctionCall *c) return true; } -#ifdef COMPILE_USE_QT4 -bool KviKvsObject_painter::functionsetOpacity(KviKvsObjectFunctionCall *c) -{ - if(!m_pPainter)return true; - kvs_real_t dOpacity; - - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("opacity_factor",KVS_PT_DOUBLE,0,dOpacity) - KVSO_PARAMETERS_END(c) - m_pPainter->setOpacity(dOpacity); - return true; -} -bool KviKvsObject_painter::functionsetTextAntialiasing(KviKvsObjectFunctionCall *c) -{ - if(!m_pPainter)return true; - - bool bEnabled; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) - KVSO_PARAMETERS_END(c) - m_pPainter->setRenderHint(TQPainter::TextAntialiasing,bEnabled); - return true; -} -bool KviKvsObject_painter::functionsetAntialiasing(KviKvsObjectFunctionCall *c) -{ - if(!m_pPainter)return true; - - bool bEnabled; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) - KVSO_PARAMETERS_END(c) - m_pPainter->setRenderHint(TQPainter::Antialiasing,bEnabled); - return true; -} -bool KviKvsObject_painter::functionsetSmoothPixmapTransform(KviKvsObjectFunctionCall *c) -{ - if(!m_pPainter)return true; - - bool bEnabled; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) - KVSO_PARAMETERS_END(c) - m_pPainter->setRenderHint(TQPainter::SmoothPixmapTransform,bEnabled); - return true; -} -#endif diff --git a/src/modules/objects/class_painter.h b/src/modules/objects/class_painter.h index 18353945..a441311c 100644 --- a/src/modules/objects/class_painter.h +++ b/src/modules/objects/class_painter.h @@ -75,12 +75,6 @@ public: bool functionresetMatrix(KviKvsObjectFunctionCall *c); bool functiontranslateMatrix(KviKvsObjectFunctionCall *c); -#ifdef COMPILE_USE_QT4 - bool functionsetOpacity(KviKvsObjectFunctionCall *c); - bool functionsetSmoothPixmapTransform(KviKvsObjectFunctionCall *c); - bool functionsetTextAntialiasing(KviKvsObjectFunctionCall *c); - bool functionsetAntialiasing(KviKvsObjectFunctionCall *c); -#endif diff --git a/src/modules/objects/class_pixmap.cpp b/src/modules/objects/class_pixmap.cpp index 47523e63..e5c7223d 100644 --- a/src/modules/objects/class_pixmap.cpp +++ b/src/modules/objects/class_pixmap.cpp @@ -127,13 +127,9 @@ bool KviKvsObject_pixmap::functionscale(KviKvsObjectFunctionCall *c) KVSO_PARAMETER("sx",KVS_PT_REAL,0,uScaleX) KVSO_PARAMETER("sy",KVS_PT_REAL,0,uScaleY) KVSO_PARAMETERS_END(c) - #ifdef COMPILE_USE_QT4 - *m_pPixmap = m_pPixmap->scaled((m_pPixmap->width() * uScaleX), (m_pPixmap->height() * uScaleX)); - #else TQWMatrix wm; wm.scale(uScaleX, uScaleY); *m_pPixmap = m_pPixmap->xForm(wm); - #endif bPixmapModified=true; return true; } @@ -144,15 +140,9 @@ bool KviKvsObject_pixmap::functionrotate(KviKvsObjectFunctionCall *c) KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("a",KVS_PT_REAL,0,uDegrees) KVSO_PARAMETERS_END(c) - #ifdef COMPILE_USE_QT4 - TQMatrix m; - m.rotate(uDegrees); - *m_pPixmap = m_pPixmap->transformed(m); - #else TQWMatrix wm; wm.rotate(uDegrees); *m_pPixmap = m_pPixmap->xForm(wm); - #endif bPixmapModified=true; return true; } diff --git a/src/modules/objects/class_pixmap.h b/src/modules/objects/class_pixmap.h index b9397631..8e618364 100644 --- a/src/modules/objects/class_pixmap.h +++ b/src/modules/objects/class_pixmap.h @@ -25,11 +25,7 @@ #include <tqpixmap.h> #include <tqimage.h> -#ifdef COMPILE_USE_QT4 - #include <TQMatrix> -#else #include <tqwmatrix.h> -#endif #include "kvi_string.h" diff --git a/src/modules/objects/class_process.cpp b/src/modules/objects/class_process.cpp index 1c45ed43..9b92ac2f 100644 --- a/src/modules/objects/class_process.cpp +++ b/src/modules/objects/class_process.cpp @@ -26,11 +26,7 @@ #include "kvi_settings.h" #include "kvi_locale.h" #include <tqtimer.h> -#ifdef COMPILE_USE_QT4 -#include <tq3process.h> -#else #include <tqprocess.h> -#endif /* @doc: process @@ -184,11 +180,7 @@ KVSO_BEGIN_REGISTERCLASS(KviKvsObject_process,"process","object") KVSO_BEGIN_CONSTRUCTOR(KviKvsObject_process,KviKvsObject) -#ifdef COMPILE_USE_QT4 - m_pProcess = new Q3Process(); -#else m_pProcess = new TQProcess(); -#endif connect(m_pProcess,TQT_SIGNAL(readyReadStdout()),this,TQT_SLOT(slotReadStdout())); connect(m_pProcess,TQT_SIGNAL(readyReadStderr()),this,TQT_SLOT(slotReadStderr())); diff --git a/src/modules/objects/class_process.h b/src/modules/objects/class_process.h index ce554d5a..6abb5509 100644 --- a/src/modules/objects/class_process.h +++ b/src/modules/objects/class_process.h @@ -28,11 +28,7 @@ #include "object_macros.h" -#ifdef COMPILE_USE_QT4 -#include <tq3process.h> -#else #include <tqprocess.h> -#endif class KviKvsObject_process : public KviKvsObject @@ -43,11 +39,7 @@ public: KVSO_DECLARE_OBJECT(KviKvsObject_process) protected: -#ifdef COMPILE_USE_QT4 - Q3Process * m_pProcess; -#else TQProcess * m_pProcess; -#endif public: diff --git a/src/modules/objects/class_progressbar.cpp b/src/modules/objects/class_progressbar.cpp index bfaa1eca..39b5df63 100644 --- a/src/modules/objects/class_progressbar.cpp +++ b/src/modules/objects/class_progressbar.cpp @@ -27,13 +27,8 @@ #include "kvi_locale.h" #include "kvi_iconmanager.h" -#ifdef COMPILE_USE_QT4 -#include <tq3progressbar.h> -#define KVI_PROGRESS_BAR Q3ProgressBar -#else #include <tqprogressbar.h> #define KVI_PROGRESS_BAR TQProgressBar -#endif /* @doc: progressbar @@ -95,13 +90,7 @@ KVSO_END_CONSTRUCTOR(KviKvsObject_progressbar) bool KviKvsObject_progressbar::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) { - #ifdef COMPILE_USE_QT4 - Q3ProgressBar *pbar=new Q3ProgressBar(parentScriptWidget()); - pbar->setObjectName(name()); - setObject(pbar,true); - #else setObject(TQT_TQOBJECT(new TQProgressBar(parentScriptWidget(), name())), true); - #endif return true; } diff --git a/src/modules/objects/class_spinbox.cpp b/src/modules/objects/class_spinbox.cpp index c7ad0922..01f69779 100644 --- a/src/modules/objects/class_spinbox.cpp +++ b/src/modules/objects/class_spinbox.cpp @@ -198,11 +198,7 @@ bool KviKvsObject_spinbox::functionlineStep(KviKvsObjectFunctionCall *c) { if (widget()) { - #ifdef COMPILE_USE_QT4 - c->returnValue()->setInteger(((TQSpinBox *)widget())->singleStep()); - #else c->returnValue()->setInteger(((TQSpinBox *)widget())->lineStep()); - #endif } return true; diff --git a/src/modules/objects/class_tabwidget.cpp b/src/modules/objects/class_tabwidget.cpp index 3b768217..33d77841 100644 --- a/src/modules/objects/class_tabwidget.cpp +++ b/src/modules/objects/class_tabwidget.cpp @@ -216,11 +216,7 @@ bool KviKvsObject_tabwidget::functionaddTab(KviKvsObjectFunctionCall *c) TQPixmap * pix = g_pIconManager->getImage(szIcon); if(pix){ -#ifdef COMPILE_USE_QT4 - ((TQTabWidget *)widget())->addTab(((TQWidget *)(ob->object())),TQIconSet(*pix),szLabel); -#else ((TQTabWidget *)widget())->addTab(((TQWidget *)(ob->object())),TQIconSet(*pix,TQIconSet::Small),szLabel); -#endif } else((TQTabWidget *)widget())->addTab(((TQWidget *)(ob->object())),szLabel); return true; @@ -257,11 +253,7 @@ bool KviKvsObject_tabwidget::functioninsertTab(KviKvsObjectFunctionCall *c) } TQPixmap * pix = g_pIconManager->getImage(szIcon); if(pix){ - #ifdef COMPILE_USE_QT4 - ((TQTabWidget *)widget())->insertTab( ((TQWidget *)(ob->object())),TQIconSet(*pix),szLabel,uIndex); - #else ((TQTabWidget *)widget())->insertTab(((TQWidget *)(ob->object())),TQIconSet(*pix,TQIconSet::Small),szLabel,uIndex); - #endif } else ((TQTabWidget *)widget())->insertTab(((TQWidget *)(ob->object())),szLabel,uIndex); return true; @@ -499,11 +491,7 @@ bool KviKvsObject_tabwidget::functionchangeTab(KviKvsObjectFunctionCall *c) } TQPixmap * pix = g_pIconManager->getImage(szIcon); if(pix){ - #ifdef COMPILE_USE_QT4 - ((TQTabWidget *)widget())->changeTab(((TQWidget *)(ob->object())),TQIconSet(*pix),szLabel); - #else ((TQTabWidget *)widget())->changeTab(((TQWidget *)(ob->object())),TQIconSet(*pix,TQIconSet::Small),szLabel); - #endif } else ((TQTabWidget *)widget())->changeTab(((TQWidget *)(ob->object())),szLabel); return true; diff --git a/src/modules/objects/class_toolbar.cpp b/src/modules/objects/class_toolbar.cpp index 2b58acd9..fd497215 100644 --- a/src/modules/objects/class_toolbar.cpp +++ b/src/modules/objects/class_toolbar.cpp @@ -139,10 +139,7 @@ bool KviKvsObject_toolbar::functionsetStretchableWidget(KviKvsObjectFunctionCall c->warning(__tr2qs("Widget object required")); return TRUE; } -#ifndef COMPILE_USE_QT4 - // FIXME: no support for this in TQt4 ? if(widget()) ((KviTalToolBar *)widget())->setStretchableWidget(((TQWidget *)(ob->object()))); -#endif //!COMPILE_USE_QT4 return true; } bool KviKvsObject_toolbar::functionclear(KviKvsObjectFunctionCall *c) diff --git a/src/modules/objects/class_toolbutton.cpp b/src/modules/objects/class_toolbutton.cpp index 57107068..906dd9ed 100644 --- a/src/modules/objects/class_toolbutton.cpp +++ b/src/modules/objects/class_toolbutton.cpp @@ -143,11 +143,7 @@ bool KviKvsObject_toolbutton::functionsetImage(KviKvsObjectFunctionCall *c) if (!widget()) return true; TQPixmap * pix = g_pIconManager->getImage(icon); if(pix){ - #ifdef COMPILE_USE_QT4 - ((TQToolButton *)widget())->setIconSet(TQIconSet(*pix)); - #else ((TQToolButton *)widget())->setIconSet(TQIconSet(*pix,TQIconSet::Small)); - #endif } else ((TQToolButton *)widget())->setIconSet(TQIconSet()); @@ -238,13 +234,8 @@ bool KviKvsObject_toolbutton::functionsetTextLabel(KviKvsObjectFunctionCall *c) KVSO_PARAMETERS_END(c) if(!widget()) return true; - #ifdef COMPILE_USE_QT4 - ((TQToolButton *)widget())->setText(szLabel); - if (!szTip.isEmpty()) ((TQToolButton *)widget())->setToolTip(szTip); - #else if (szTip.isEmpty()) ((TQToolButton *)widget())->setTextLabel(szLabel); else ((TQToolButton *)widget())->setTextLabel(szLabel,szTip); - #endif return true; } bool KviKvsObject_toolbutton::functiontextLabel(KviKvsObjectFunctionCall *c) diff --git a/src/modules/objects/class_urllabel.cpp b/src/modules/objects/class_urllabel.cpp index c55913cc..1dce3643 100644 --- a/src/modules/objects/class_urllabel.cpp +++ b/src/modules/objects/class_urllabel.cpp @@ -31,12 +31,7 @@ #include "kvi_window.h" #include "kvi_kvs_script.h" -#ifdef COMPILE_USE_QT4 -#include <TQMouseEvent> #define TQT_LEFT_BUTTON Qt::LeftButton -#else -#define TQT_LEFT_BUTTON Qt::LeftButton -#endif //#warning "Functions to change colors for different states" //#warning "$setUnderline(), $underline()" 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" diff --git a/src/modules/objects/class_widget.h b/src/modules/objects/class_widget.h index 8ff19532..b8ab8d68 100644 --- a/src/modules/objects/class_widget.h +++ b/src/modules/objects/class_widget.h @@ -102,9 +102,6 @@ protected: bool function_setMask(KviKvsObjectFunctionCall *c); -#ifdef COMPILE_USE_QT4 -bool function_setAttribute(KviKvsObjectFunctionCall *c); -#endif signals: void aboutToDie(); diff --git a/src/modules/objects/class_window.cpp b/src/modules/objects/class_window.cpp index 918f541d..41adaa5f 100644 --- a/src/modules/objects/class_window.cpp +++ b/src/modules/objects/class_window.cpp @@ -36,11 +36,7 @@ KviKvsScriptWindowWindow::KviKvsScriptWindowWindow(KviFrame * pParent,const TQSt : KviWindow(KVI_WINDOW_TYPE_SCRIPTOBJECT,pParent,szName) { m_pCentralWidget = 0; - #ifdef COMPILE_USE_QT4 - setBackgroundMode(TQt::NoBackground); - #else setBackgroundMode(TQWidget::NoBackground); - #endif } KviKvsScriptWindowWindow::~KviKvsScriptWindowWindow() diff --git a/src/modules/objects/class_workspace.cpp b/src/modules/objects/class_workspace.cpp index 4f178024..2305d742 100644 --- a/src/modules/objects/class_workspace.cpp +++ b/src/modules/objects/class_workspace.cpp @@ -252,11 +252,7 @@ bool KviKvsObject_workspace::functionactivateNextWindow(KviKvsObjectFunctionCall bool KviKvsObject_workspace::functionactivatePrevWindow(KviKvsObjectFunctionCall *c) { if(widget()){ - #ifdef COMPILE_USE_QT4 - ((TQWorkspace *)widget())->activatePreviousWindow(); - #else ((TQWorkspace *)widget())->activatePrevWindow(); - #endif } return true; } diff --git a/src/modules/objects/class_wrapper.cpp b/src/modules/objects/class_wrapper.cpp index 57a2ef59..261b041f 100644 --- a/src/modules/objects/class_wrapper.cpp +++ b/src/modules/objects/class_wrapper.cpp @@ -30,10 +30,8 @@ #include "class_widget.h" #include <tqwidget.h> -#ifndef COMPILE_USE_QT4 - #include <tqobjectlist.h> - #include <tqwidgetlist.h> -#endif +#include <tqobjectlist.h> +#include <tqwidgetlist.h> #include "kvi_app.h" #include "kvi_frame.h" @@ -182,28 +180,6 @@ bool KviKvsObject_wrapper::init(KviKvsRunTimeContext * pContext,KviKvsVariantLis } TQWidget *KviKvsObject_wrapper::findTopLevelWidgetToWrap(const TQString szClass, const TQString szName) { -#ifdef COMPILE_USE_QT4 - TQWidgetList list = g_pApp->topLevelWidgets(); - if( !list.count() ) return 0; - for(int idx=0;idx<list.count();idx++) - { - bool bNameMatch = false; - bool bClassMatch = false; - if( !szName.isEmpty() ) - bNameMatch = KviTQString::equalCI(list.at(idx)->name(), szName); - else - bNameMatch = true; - if( !szClass.isEmpty()) - bClassMatch = KviTQString::equalCI(list.at(idx)->className(), szClass); - else - bClassMatch = true; - if( bNameMatch && bClassMatch ) { - TQWidget *w = list.at(idx); - return w; - } - } - return 0; -#else TQWidgetList *list = g_pApp->topLevelWidgets(); if( !list ) return 0; @@ -230,24 +206,10 @@ TQWidget *KviKvsObject_wrapper::findTopLevelWidgetToWrap(const TQString szClass, delete list; return 0; -#endif } TQWidget *KviKvsObject_wrapper::findWidgetToWrap(const char *szClass, const char *szName, TQWidget *childOf) { -#ifdef COMPILE_USE_QT4 - 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() ) { - TQWidget *w = (TQWidget *)list.at(idx); - return w; - } - - } - return 0; -#else TQObjectList *list = childOf->queryList(szClass ? szClass : 0, szName ? szName : 0, false, true); if( !list ) return 0; @@ -263,7 +225,6 @@ TQWidget *KviKvsObject_wrapper::findWidgetToWrap(const char *szClass, const char } delete list; return 0; -#endif } #include "m_class_wrapper.moc" diff --git a/src/modules/objects/libkviobjects.cpp b/src/modules/objects/libkviobjects.cpp index 7276dd5c..6d29f5d9 100644 --- a/src/modules/objects/libkviobjects.cpp +++ b/src/modules/objects/libkviobjects.cpp @@ -39,10 +39,8 @@ #include "kvi_out.h" #include "kvi_app.h" #include "kvi_fileutils.h" -#ifndef COMPILE_USE_QT4 - #include <tqwidgetlist.h> - #include <tqobjectlist.h> -#endif +#include <tqwidgetlist.h> +#include <tqobjectlist.h> #include <tqdir.h> @@ -638,16 +636,7 @@ static bool objects_kvs_cmd_bitBlt(KviKvsModuleCommandCall * c) if(obDst->inherits("KviKvsObject_pixmap")){ ((KviKvsObject_pixmap *)obDst)->pixmapChanged(); } -#ifdef COMPILE_USE_QT4 - /*TQPainter p(pdDest); - TQRect rectdest(iXdst,iYdst,uW,uH); - TQRect rectsrc(iXsrc,iYsrc,uW,uH); - - p.drawPixmap(rectdest,pdSource,rectsrc); -*/ - #else bitBlt(pdDest,iXdst,iYdst,pdSource,iXsrc,iYsrc,uW,uH); -#endif return true; } /* @@ -779,13 +768,7 @@ static bool objects_kvs_cmd_blend(KviKvsModuleCommandCall * c) } -#ifdef COMPILE_USE_QT4 - TQPainter p(pdDest); - TQRect rect(iDesX,iDesY,buffer.width(),buffer.height()); - p.drawImage(rect,buffer); -#else bitBlt(pdDest,iDesX,iDesY,&buffer,0,0,buffer.width(),buffer.height()); -#endif return true; } @@ -826,45 +809,6 @@ static bool objects_kvs_fnc_listObjects(KviKvsModuleFunctionCall * cmd) KVSO_PARAMETER("flag on video",KVS_PT_BOOL,0,bFlag) KVSO_PARAMETERS_END(cmd) if (bFlag) cmd->window()->output(80, "Objects dump:"); - #ifdef COMPILE_USE_QT4 - TQWidgetList list = g_pApp->topLevelWidgets(); - - KviStr spacing = ">"; - TQString szTemp; - KviKvsArray * n = new KviKvsArray(); - int idx=0; - for(int i=0;i<list.count();i++) - { - if( list.at(i)->isWidgetType()) - { - if (bFlag) - { - cmd->window()->output(80, "Ptr %u: top level object: %c%s%c, class %s, %s, rect = %d, %d, %d, %d", - list.at(i), - KVI_TEXT_BOLD, list.at(i)->name(), KVI_TEXT_BOLD, - list.at(i)->className(), - list.at(i)->isVisible() ? "visible" : "hidden", - list.at(i)->x(), list.at(i)->y(), list.at(i)->width(), list.at(i)->height()); - } - TQString szClass=list.at(i)->className(); - TQString szObj=list.at(i)->name(); - TQString szTemp; - szTemp = szClass + "::" + szObj; - KviKvsVariant v; - v.setString(szTemp); - n->set(idx,new KviKvsVariant(v)); - tqDebug ("string %s",szTemp.latin1()); - tqDebug ("class %s",szClass.latin1()); - tqDebug ("Obj %s",szObj.latin1()); - - idx++; - - dumpChildObjects(cmd->window(), list.at(i), spacing.ptr(), bFlag,n,idx); - } - //++it; - } - -#else TQWidgetList *l = g_pApp->topLevelWidgets(); l->setAutoDelete(false); TQWidgetListIt it(*l); @@ -905,43 +849,12 @@ static bool objects_kvs_fnc_listObjects(KviKvsModuleFunctionCall * cmd) ++it; } -#endif cmd->returnValue()->setArray(n); return true; } static void dumpChildObjects(KviWindow *pWnd, TQObject *parent, const char *spacing, bool bFlag, KviKvsArray *n, int &idx) { -#ifdef COMPILE_USE_QT4 - const TQObjectList list = parent->children(); - if( !list.count() ) return; - TQString sp(spacing); - sp.append(">"); - for(int i=0;i<list.count();i++) - { - if( list.at(i)->isWidgetType() ) - { - if (bFlag) - { - pWnd->output(80, "%sPtr %u: object: %c%s%c, class %s", - spacing, list.at(i), KVI_TEXT_BOLD, - list.at(i)->name(), KVI_TEXT_BOLD, list.at(i)->className() - ); - } - TQString szClass=list.at(i)->className(); - TQString szObj=list.at(i)->name(); - TQString szTemp; - szTemp=spacing+szClass+"::"+szObj; - KviKvsVariant v; - v.setString(szTemp); - n->set(idx,new KviKvsVariant(v)); - tqDebug ("string %s",szTemp.latin1()); - idx++; - dumpChildObjects(pWnd, list.at(i), sp, bFlag, n, idx ); - } - } - -#else const TQObjectList l = parent->childrenListObject(); if( l.isEmpty() ) return; TQObjectListIt it(l); @@ -971,7 +884,6 @@ static void dumpChildObjects(KviWindow *pWnd, TQObject *parent, const char *spac } ++it; } -#endif } static bool objects_module_can_unload(KviModule *m) |