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 | |
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')
243 files changed, 38 insertions, 6462 deletions
diff --git a/src/config.h.in b/src/config.h.in index e298be37..c19a4ad1 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -88,9 +88,6 @@ /* define if you have libgsm and want the GSM code to be compiled */ #undef COMPILE_USE_GSM -/* define if you want to compile the Qt 4.x support */ -#undef COMPILE_USE_QT4 - /* define if you trust your memmove() function */ #undef COMPILE_WITH_SYSTEM_MEMMOVE diff --git a/src/kvi_configstatus.h b/src/kvi_configstatus.h index 339ea24c..022bf91a 100644 --- a/src/kvi_configstatus.h +++ b/src/kvi_configstatus.h @@ -89,9 +89,6 @@ /* define if you have libgsm and want the GSM code to be compiled */ #define COMPILE_USE_GSM 1 -/* define if you want to compile the Qt 4.x support */ -/* #undef COMPILE_USE_QT4 */ - /* define if you trust your memmove() function */ #define COMPILE_WITH_SYSTEM_MEMMOVE 1 diff --git a/src/kvilib/build/Makefile.am b/src/kvilib/build/Makefile.am index 4e480336..e96d1517 100644 --- a/src/kvilib/build/Makefile.am +++ b/src/kvilib/build/Makefile.am @@ -188,56 +188,41 @@ headers_HEADERS = \ ../tal/kvi_tal_filedialog.h \ ../tal/kvi_tal_filedialog_kde.h \ ../tal/kvi_tal_filedialog_qt.h \ - ../tal/kvi_tal_filedialog_qt4.h \ ../tal/kvi_tal_grid.h \ ../tal/kvi_tal_grid_qt3.h \ - ../tal/kvi_tal_grid_qt4.h \ ../tal/kvi_tal_groupbox.h \ ../tal/kvi_tal_groupbox_qt3.h \ - ../tal/kvi_tal_groupbox_qt4.h \ ../tal/kvi_tal_hbox.h \ ../tal/kvi_tal_hbox_qt3.h \ - ../tal/kvi_tal_hbox_qt4.h \ ../tal/kvi_tal_iconview.h \ ../tal/kvi_tal_iconview_qt3.h \ - ../tal/kvi_tal_iconview_qt4.h \ ../tal/kvi_tal_listbox.h \ ../tal/kvi_tal_listbox_qt3.h \ - ../tal/kvi_tal_listbox_qt4.h \ ../tal/kvi_tal_listview.h \ ../tal/kvi_tal_listview_qt3.h \ - ../tal/kvi_tal_listview_qt4.h \ ../tal/kvi_tal_mainwindow.h \ ../tal/kvi_tal_mainwindow_kde.h \ ../tal/kvi_tal_mainwindow_qt3.h \ - ../tal/kvi_tal_mainwindow_qt4.h \ ../tal/kvi_tal_menubar.h \ ../tal/kvi_tal_menubar_kde.h \ ../tal/kvi_tal_menubar_qt.h \ ../tal/kvi_tal_popupmenu.h \ ../tal/kvi_tal_popupmenu_qt3.h \ - ../tal/kvi_tal_popupmenu_qt4.h \ ../tal/kvi_tal_scrollview.h \ ../tal/kvi_tal_scrollview_qt3.h \ - ../tal/kvi_tal_scrollview_qt4.h \ ../tal/kvi_tal_tabdialog.h \ ../tal/kvi_tal_tabdialog_qt3.h \ - ../tal/kvi_tal_tabdialog_qt4.h \ ../tal/kvi_tal_textedit.h \ ../tal/kvi_tal_textedit_qt3.h \ - ../tal/kvi_tal_textedit_qt4.h \ ../tal/kvi_tal_toolbar.h \ ../tal/kvi_tal_toolbar_kde.h \ ../tal/kvi_tal_toolbar_qt3.h \ - ../tal/kvi_tal_toolbar_qt4.h \ ../tal/kvi_tal_toolbardocktype.h \ ../tal/kvi_tal_tooltip.h \ ../tal/kvi_tal_vbox.h \ ../tal/kvi_tal_vbox_qt3.h \ - ../tal/kvi_tal_vbox_qt4.h \ ../tal/kvi_tal_widgetstack.h \ ../tal/kvi_tal_widgetstack_qt3.h \ - ../tal/kvi_tal_widgetstack_qt4.h \ ../tal/kvi_tal_wizard.h \ ../tal/kvi_tal_windowstate.h @@ -281,40 +266,25 @@ headers_HEADERS = \ ../tal/kvi_tal_application.cpp: ../tal/kvi_tal_application_qt.moc ../tal/kvi_tal_mainwindow.cpp: ../tal/kvi_tal_mainwindow_kde.moc ../tal/kvi_tal_mainwindow.cpp: ../tal/kvi_tal_mainwindow_qt3.moc -../tal/kvi_tal_mainwindow.cpp: ../tal/kvi_tal_mainwindow_qt4.moc ../tal/kvi_tal_menubar.cpp: ../tal/kvi_tal_menubar_kde.moc ../tal/kvi_tal_menubar.cpp: ../tal/kvi_tal_menubar_qt.moc ../tal/kvi_tal_filedialog.cpp: ../tal/kvi_tal_filedialog_kde.moc ../tal/kvi_tal_filedialog.cpp: ../tal/kvi_tal_filedialog_qt.moc -../tal/kvi_tal_filedialog.cpp: ../tal/kvi_tal_filedialog_qt4.moc ../tal/kvi_tal_grid.cpp: ../tal/kvi_tal_grid_qt3.moc -../tal/kvi_tal_grid.cpp: ../tal/kvi_tal_grid_qt4.moc ../tal/kvi_tal_groupbox.cpp: ../tal/kvi_tal_groupbox_qt3.moc -../tal/kvi_tal_groupbox.cpp: ../tal/kvi_tal_groupbox_qt4.moc ../tal/kvi_tal_hbox.cpp: ../tal/kvi_tal_hbox_qt3.moc -../tal/kvi_tal_hbox.cpp: ../tal/kvi_tal_hbox_qt4.moc ../tal/kvi_tal_vbox.cpp: ../tal/kvi_tal_vbox_qt3.moc -../tal/kvi_tal_vbox.cpp: ../tal/kvi_tal_vbox_qt4.moc ../tal/kvi_tal_popupmenu.cpp: ../tal/kvi_tal_popupmenu_qt3.moc -../tal/kvi_tal_popupmenu.cpp: ../tal/kvi_tal_popupmenu_qt4.moc ../tal/kvi_tal_listview.cpp: ../tal/kvi_tal_listview_qt3.moc -../tal/kvi_tal_listview.cpp: ../tal/kvi_tal_listview_qt4.moc ../tal/kvi_tal_listbox.cpp: ../tal/kvi_tal_listbox_qt3.moc -../tal/kvi_tal_listbox.cpp: ../tal/kvi_tal_listbox_qt4.moc ../tal/kvi_tal_iconview.cpp: ../tal/kvi_tal_iconview_qt3.moc -../tal/kvi_tal_iconview.cpp: ../tal/kvi_tal_iconview_qt4.moc ../tal/kvi_tal_scrollview.cpp: ../tal/kvi_tal_scrollview_qt3.moc -../tal/kvi_tal_scrollview.cpp: ../tal/kvi_tal_scrollview_qt4.moc ../tal/kvi_tal_tabdialog.cpp: ../tal/kvi_tal_tabdialog_qt3.moc -../tal/kvi_tal_tabdialog.cpp: ../tal/kvi_tal_tabdialog_qt4.moc ../tal/kvi_tal_textedit.cpp: ../tal/kvi_tal_textedit_qt3.moc -../tal/kvi_tal_textedit.cpp: ../tal/kvi_tal_textedit_qt4.moc ../tal/kvi_tal_toolbar.cpp: ../tal/kvi_tal_toolbar_qt3.moc -../tal/kvi_tal_toolbar.cpp: ../tal/kvi_tal_toolbar_qt4.moc ../tal/kvi_tal_toolbar.cpp: ../tal/kvi_tal_toolbar_kde.moc ../tal/kvi_tal_tooltip.cpp: ../tal/kvi_tal_tooltip.moc ../tal/kvi_tal_widgetstack.cpp: ../tal/kvi_tal_widgetstack_qt3.moc -../tal/kvi_tal_widgetstack.cpp: ../tal/kvi_tal_widgetstack_qt4.moc # # All the cpp files depend on the precompiled headers being up-to-date diff --git a/src/kvilib/config/kvi_settings.h b/src/kvilib/config/kvi_settings.h index 770379d8..c9baf3a6 100644 --- a/src/kvilib/config/kvi_settings.h +++ b/src/kvilib/config/kvi_settings.h @@ -132,9 +132,6 @@ */ #define KVI_DEPRECATED -#ifdef COMPILE_USE_QT4 - #define debug tqDebug -#endif #endif //_KVI_SETTINGS_H_ diff --git a/src/kvilib/config/kvi_wincfg.h b/src/kvilib/config/kvi_wincfg.h index 1a74f0ae..062aa81e 100644 --- a/src/kvilib/config/kvi_wincfg.h +++ b/src/kvilib/config/kvi_wincfg.h @@ -32,11 +32,6 @@ /* define if you want to compile with new parser */ #define COMPILE_NEW_KVS 1 -/* define if you want to use the TQt 4.x support */ -/* #undef COMPILE_USE_QT4 */ - -#define COMPILE_USE_QT4 - /* define if you want to use only the new KVS parser */ #define COMPILE_ONLY_NEW_KVS 1 diff --git a/src/kvilib/core/kvi_pointerhashtable.h b/src/kvilib/core/kvi_pointerhashtable.h index 99e513f3..d7e84759 100644 --- a/src/kvilib/core/kvi_pointerhashtable.h +++ b/src/kvilib/core/kvi_pointerhashtable.h @@ -244,11 +244,7 @@ inline unsigned int kvi_hash_hash(const TQString &szKey,bool bCaseSensitive) } else { while(p->unicode()) { -#ifdef COMPILE_USE_QT4 - uResult += p->toLower().unicode(); -#else uResult += p->lower().unicode(); -#endif p++; } } diff --git a/src/kvilib/core/kvi_pointerlist.h b/src/kvilib/core/kvi_pointerlist.h index c9746c29..b46343c3 100644 --- a/src/kvilib/core/kvi_pointerlist.h +++ b/src/kvilib/core/kvi_pointerlist.h @@ -36,10 +36,7 @@ // I think we need to be independent of that to the maximum degree possible. // That's why we have our own fast pointer list class. // This does not depend on TQt AT ALL and has an interface similar -// to the TQt<=3.x series. The pointer lists with the autodelete -// feature was great and I don't completly understand why they have -// been removed from TQt4 in favor of the value based non-autodeleting -// lists... anyway: here we go :) +// to the TQt<=3.x series. #include "kvi_settings.h" diff --git a/src/kvilib/core/kvi_qcstring.h b/src/kvilib/core/kvi_qcstring.h index 9406115c..97e6e423 100644 --- a/src/kvilib/core/kvi_qcstring.h +++ b/src/kvilib/core/kvi_qcstring.h @@ -27,13 +27,7 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include <tq3cstring.h> // includes <qbytearray.h> - #define KviTQCString TQByteArray -#else - // this is dead in TQt 4.x - #include <tqcstring.h> - #define KviTQCString TQCString -#endif +#include <tqcstring.h> +#define KviTQCString TQCString #endif //!_KVI_TQCSTRING_H_ diff --git a/src/kvilib/core/kvi_qstring.cpp b/src/kvilib/core/kvi_qstring.cpp index 84beaa07..a477527b 100644 --- a/src/kvilib/core/kvi_qstring.cpp +++ b/src/kvilib/core/kvi_qstring.cpp @@ -84,11 +84,7 @@ namespace KviTQString while(c1 < c1e) { -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != c2->toLower().unicode())return false; -#else if(c1->lower().unicode() != c2->lower().unicode())return false; -#endif c1++; c2++; } @@ -126,11 +122,7 @@ namespace KviTQString while((c1 < c1e) && (*sz2)) { -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != tolower(*sz2))return false; -#else if(c1->lower().unicode() != tolower(*sz2))return false; -#endif c1++; sz2++; } @@ -150,11 +142,7 @@ namespace KviTQString while((c1 < c1e) && (sz2->unicode())) { -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != sz2->toLower().unicode())return false; -#else if(c1->lower().unicode() != sz2->lower().unicode())return false; -#endif c1++; sz2++; } @@ -216,11 +204,7 @@ namespace KviTQString while(c1 < c1e) { -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != c2->toLower().unicode())return false; -#else if(c1->lower().unicode() != c2->lower().unicode())return false; -#endif c1++; c2++; } @@ -238,11 +222,7 @@ namespace KviTQString while(c1 < c1e) { if(!sz2->unicode())return false; // sz1 has at least another character -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != sz2->toLower().unicode())return false; -#else if(c1->lower().unicode() != sz2->lower().unicode())return false; -#endif c1++; sz2++; } @@ -274,11 +254,7 @@ namespace KviTQString while((c1 < c1e) && (*sz2)) { -#ifdef COMPILE_USE_QT4 - if(c1->toLower().unicode() != tolower(*sz2))return false; -#else if(c1->lower().unicode() != tolower(*sz2))return false; -#endif c1++; sz2++; } @@ -337,24 +313,12 @@ namespace KviTQString { if(c1 >= c1e) { -#ifdef COMPILE_USE_QT4 - if(c2 < c2e)return /* 0 */ - (c2->toLower().unicode()); -#else if(c2 < c2e)return /* 0 */ - (c2->lower().unicode()); -#endif return 0; } -#ifdef COMPILE_USE_QT4 - if(c2 >= c2e)return c1->toLower().unicode() /* - 0 */; -#else if(c2 >= c2e)return c1->lower().unicode() /* - 0 */; -#endif -#ifdef COMPILE_USE_QT4 - int diff = c1->toLower().unicode() - c2->toLower().unicode(); -#else int diff = c1->lower().unicode() - c2->lower().unicode(); -#endif if(diff)return diff; c1++; @@ -383,11 +347,7 @@ namespace KviTQString int diff = 0; -#ifdef COMPILE_USE_QT4 - while((c1 < c1e) && !(diff = (c1->toLower().unicode() - c2->toLower().unicode()))) -#else while((c1 < c1e) && !(diff = (c1->lower().unicode() - c2->lower().unicode()))) -#endif { c1++; c2++; @@ -464,21 +424,13 @@ namespace KviTQString void detach(TQString &sz) { -#ifdef COMPILE_USE_QT4 - sz.resize(sz.length()); -#else sz.setLength(sz.length()); -#endif } const TQChar * nullTerminatedArray(const TQString &sz) { //sz.setLength(sz.length()); // detach! -#ifdef COMPILE_USE_QT4 - return sz.constData(); -#else return (const TQChar *)sz.ucs2(); // MAY BE NULL! -#endif } void appendNumber(TQString &s,double dReal) @@ -781,13 +733,8 @@ namespace KviTQString // s1 // -#ifdef COMPILE_USE_QT4 - const TQChar * m1 = (const TQChar *)szM1.constData(); - const TQChar * m2 = (const TQChar *)szM2.constData(); -#else const TQChar * m1 = (const TQChar *)szM1.ucs2(); const TQChar * m2 = (const TQChar *)szM2.ucs2(); -#endif if(!(m1 && m2 && (m1->unicode())))return false; const TQChar * savePos1 = 0; @@ -804,11 +751,7 @@ namespace KviTQString continue; //and return } if(!m2->unicode())return false; //m2 finished and we had something to match here! -#ifdef COMPILE_USE_QT4 - if(m1->toLower()==m2->toLower()) -#else if(m1->lower()==m2->lower()) -#endif { //chars matched m1++; //Go ahead in the two strings @@ -864,11 +807,7 @@ namespace KviTQString bool matchStringCI(const TQString &szExp,const TQString &szStr,bool bIsRegExp,bool bExact) { TQString szWildcard; -#ifdef COMPILE_USE_QT4 - TQChar* ptr=(TQChar*)szExp.constData(); -#else TQChar* ptr=(TQChar*)szExp.ucs2(); -#endif if(!ptr) return 0; while(ptr->unicode()) { @@ -882,27 +821,15 @@ namespace KviTQString } ptr++; } -#ifdef COMPILE_USE_QT4 - TQRegExp re(szWildcard,TQt::CaseInsensitive,bIsRegExp ? TQRegExp::RegExp : TQRegExp::Wildcard); -#else TQRegExp re(szWildcard,false,!bIsRegExp); -#endif if(bExact) return re.exactMatch(szStr); -#ifdef COMPILE_USE_QT4 - return re.indexIn(szStr) != -1; -#else return re.search(szStr) != -1; -#endif } bool matchStringCS(const TQString &szExp,const TQString &szStr,bool bIsRegExp,bool bExact) { TQString szWildcard; -#ifdef COMPILE_USE_QT4 - TQChar* ptr=(TQChar*)szExp.constData(); -#else TQChar* ptr=(TQChar*)szExp.ucs2(); -#endif if(!ptr) return 0; while(ptr->unicode()) { @@ -916,48 +843,28 @@ namespace KviTQString } ptr++; } -#ifdef COMPILE_USE_QT4 - TQRegExp re(szWildcard,TQt::CaseSensitive,bIsRegExp ? TQRegExp::RegExp : TQRegExp::Wildcard); -#else TQRegExp re(szWildcard,true,!bIsRegExp); -#endif if(bExact) return re.exactMatch(szStr); -#ifdef COMPILE_USE_QT4 - return re.indexIn(szStr) != -1; -#else return re.search(szStr) != -1; -#endif } void cutFromFirst(TQString &s,const TQChar &c,bool bIncluded) { -#ifdef COMPILE_USE_QT4 - int idx = s.indexOf(c); -#else int idx = s.find(c); -#endif if(idx == -1)return; s.truncate(bIncluded ? idx : idx + 1); } void cutFromLast(TQString &s,const TQChar &c,bool bIncluded) { -#ifdef COMPILE_USE_QT4 - int idx = s.lastIndexOf(c); -#else int idx = s.findRev(c); -#endif if(idx == -1)return; s.truncate(bIncluded ? idx : idx + 1); } void cutToFirst(TQString &s,const TQChar &c,bool bIncluded,bool bClearIfNotFound) { -#ifdef COMPILE_USE_QT4 - int idx = s.indexOf(c); -#else int idx = s.find(c); -#endif if(idx == -1) { if(bClearIfNotFound)s = ""; @@ -968,11 +875,7 @@ namespace KviTQString void cutToLast(TQString &s,const TQChar &c,bool bIncluded,bool bClearIfNotFound) { -#ifdef COMPILE_USE_QT4 - int idx = s.lastIndexOf(c); -#else int idx = s.findRev(c); -#endif if(idx == -1) { if(bClearIfNotFound)s = ""; @@ -983,33 +886,21 @@ namespace KviTQString void cutFromFirst(TQString &s,const TQString &c,bool bIncluded) { -#ifdef COMPILE_USE_QT4 - int idx = s.indexOf(c); -#else int idx = s.find(c); -#endif if(idx == -1)return; s.truncate(bIncluded ? idx : idx + c.length()); } void cutFromLast(TQString &s,const TQString &c,bool bIncluded) { -#ifdef COMPILE_USE_QT4 - int idx = s.lastIndexOf(c); -#else int idx = s.findRev(c); -#endif if(idx == -1)return; s.truncate(bIncluded ? idx : idx + c.length()); } void cutToFirst(TQString &s,const TQString &c,bool bIncluded,bool bClearIfNotFound) { -#ifdef COMPILE_USE_QT4 - int idx = s.indexOf(c); -#else int idx = s.find(c); -#endif if(idx == -1) { if(bClearIfNotFound)s = ""; @@ -1020,11 +911,7 @@ namespace KviTQString void cutToLast(TQString &s,const TQString &c,bool bIncluded,bool bClearIfNotFound) { -#ifdef COMPILE_USE_QT4 - int idx = s.lastIndexOf(c); -#else int idx = s.findRev(c); -#endif if(idx == -1) { if(bClearIfNotFound)s = ""; @@ -1107,11 +994,7 @@ namespace KviTQString void bufferToHex(TQString &szRetBuffer,const unsigned char * buffer,unsigned int len) { -#ifdef COMPILE_USE_QT4 - szRetBuffer.resize(len * 2); -#else szRetBuffer.setLength(len * 2); -#endif unsigned int i=0; while(i < (len*2)) { diff --git a/src/kvilib/core/kvi_qstring.h b/src/kvilib/core/kvi_qstring.h index 7f9f7e73..8d70ba5f 100644 --- a/src/kvilib/core/kvi_qstring.h +++ b/src/kvilib/core/kvi_qstring.h @@ -136,115 +136,66 @@ namespace KviTQString extern KVILIB_API const TQString empty; /// - /// A portability wrapper which with TQt3 and TQt4. /// Returns a lowcase version of the parameter string. /// inline TQString toLower(const TQString &s) { -#ifdef COMPILE_USE_QT4 - return s.toLower(); -#else return s.lower(); -#endif } inline int find(const TQString &s,TQChar c,int index = 0,bool cs = true) { -#ifdef COMPILE_USE_QT4 - return s.indexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); -#else return s.find(c,index,cs); -#endif } inline int find(const TQString &s,char c,int index = 0,bool cs = true) { -#ifdef COMPILE_USE_QT4 - return s.indexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); -#else return s.find(c,index,cs); -#endif } inline int find(const TQString &s,const TQString & str,int index = 0,bool cs = true) { -#ifdef COMPILE_USE_QT4 - return s.indexOf(str,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); -#else return s.find(str,index,cs); -#endif } inline int find(const TQString &s,const TQRegExp & rx,int index = 0) { -#ifdef COMPILE_USE_QT4 - return s.indexOf(rx,index); -#else return s.find(rx,index); -#endif } inline int find(const TQString &s,const char * str,int index = 0) { -#ifdef COMPILE_USE_QT4 - return s.indexOf(TQString(str),index); -#else return s.find(str,index); -#endif } inline int findRev(const TQString &s,TQChar c,int index = -1,bool cs = true) { -#ifdef COMPILE_USE_QT4 - return s.lastIndexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); -#else return s.findRev(c,index,cs); -#endif } inline int findRev(const TQString &s,char c,int index = -1,bool cs = true) { -#ifdef COMPILE_USE_QT4 - return s.lastIndexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); -#else return s.findRev(c,index,cs); -#endif } inline int findRev(const TQString &s,const TQString & str,int index = -1,bool cs = true) { -#ifdef COMPILE_USE_QT4 - return s.lastIndexOf(str,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive); -#else return s.findRev(str,index,cs); -#endif } inline int findRev(const TQString &s,const TQRegExp & rx,int index = -1) { -#ifdef COMPILE_USE_QT4 - return s.lastIndexOf(rx,index); -#else return s.findRev(rx,index); -#endif } inline int findRev(const TQString &s,const char * str,int index = -1) { -#ifdef COMPILE_USE_QT4 - return s.lastIndexOf(TQString(str),index); -#else return s.findRev(str,index); -#endif } inline TQString trimmed(const TQString &s) { -#ifdef COMPILE_USE_QT4 - return s.trimmed(); -#else return s.stripWhiteSpace(); -#endif } // WARNING: DO NOT USE CONSTRUCTS LIKE char * c = KviTQString::toUtf8(something).data(); @@ -258,11 +209,7 @@ namespace KviTQString // transit to qt 4.x more or less cleanly... inline KviTQCString toUtf8(const TQString &s) { -#ifdef COMPILE_USE_QT4 - return s.toUtf8(); -#else return s.utf8(); -#endif } inline KviTQCString toLocal8Bit(const TQString &s) @@ -289,6 +236,4 @@ namespace KviTQString } }; -// QT4SUX: Because TQString() is gone. TQString() is SLOWER than TQString() since it invokes a constructor and destructor. - #endif //!_KVI_TQSTRING_H_ diff --git a/src/kvilib/core/kvi_string.cpp b/src/kvilib/core/kvi_string.cpp index c133f20f..9e491ccb 100644 --- a/src/kvilib/core/kvi_string.cpp +++ b/src/kvilib/core/kvi_string.cpp @@ -195,11 +195,7 @@ bool kvi_qstringEqualCI(const TQString &s1,const TQString &s2) const TQChar * p1 = s1.unicode(); const TQChar * p2 = s2.unicode(); int l = s1.length() < s2.length() ? s1.length() : s2.length(); -#ifdef COMPILE_USE_QT4 - while(l-- && (p1->toLower() == p2->toLower()))p1++,p2++; -#else while(l-- && (p1->lower() == p2->lower()))p1++,p2++; -#endif if(l==-1)return true; return false; } diff --git a/src/kvilib/core/kvi_valuelist.h b/src/kvilib/core/kvi_valuelist.h index 9ad234f2..c5a2e624 100644 --- a/src/kvilib/core/kvi_valuelist.h +++ b/src/kvilib/core/kvi_valuelist.h @@ -26,12 +26,7 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include <tq3valuelist.h> - #define KviValueList Q3ValueList -#else #include <tqvaluelist.h> #define KviValueList TQValueList -#endif #endif //_KVI_VALUELIST_H_ diff --git a/src/kvilib/ext/kvi_accel.h b/src/kvilib/ext/kvi_accel.h index 1014b2cb..f640d82c 100644 --- a/src/kvilib/ext/kvi_accel.h +++ b/src/kvilib/ext/kvi_accel.h @@ -27,12 +27,7 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include <tq3accel.h> - #define KviAccel Q3Accel -#else #include <tqaccel.h> #define KviAccel TQAccel -#endif #endif //!_KVI_ACCEL_H_ diff --git a/src/kvilib/ext/kvi_cmdformatter.cpp b/src/kvilib/ext/kvi_cmdformatter.cpp index 153557b2..2866ae04 100644 --- a/src/kvilib/ext/kvi_cmdformatter.cpp +++ b/src/kvilib/ext/kvi_cmdformatter.cpp @@ -63,11 +63,7 @@ namespace KviCommandFormatter } else { // we pretend this line to be empty TQString tmp = *it; -#ifdef COMPILE_USE_QT4 - tmp = tmp.trimmed(); -#else tmp = tmp.stripWhiteSpace(); -#endif if(!tmp.isEmpty())return false; *it = ""; // set it to empty also in the main buffer } @@ -127,11 +123,7 @@ namespace KviCommandFormatter void unindent(TQString &buffer) { -#ifdef COMPILE_USE_QT4 - TQStringList list = buffer.split("\n",TQString::KeepEmptyParts); -#else TQStringList list = TQStringList::split("\n",buffer,true); -#endif while(hasLeadingChars(list,TQChar('\t')) || hasLeadingChars(list,TQChar(' ')))trimLeading(list); //buffer = list.join("\n"); join implementation sux :D // we WANT the last newline @@ -162,11 +154,7 @@ namespace KviCommandFormatter void bufferFromBlock(TQString &buffer) { -#ifdef COMPILE_USE_QT4 - buffer = buffer.trimmed(); -#else buffer = buffer.stripWhiteSpace(); -#endif if(buffer.isEmpty())return; @@ -180,11 +168,7 @@ namespace KviCommandFormatter unindent(buffer); -#ifdef COMPILE_USE_QT4 - buffer = buffer.trimmed(); -#else buffer = buffer.stripWhiteSpace(); -#endif } @@ -203,11 +187,7 @@ namespace KviCommandFormatter void indent(TQString &buffer) { -#ifdef COMPILE_USE_QT4 - TQStringList list = buffer.split("\n",TQString::KeepEmptyParts); -#else TQStringList list = TQStringList::split("\n",buffer,true); -#endif addLeading(list,TQChar('\t')); //buffer = list.join("\n"); join implementation sux :D // we WANT the last newline diff --git a/src/kvilib/ext/kvi_config.cpp b/src/kvilib/ext/kvi_config.cpp index bd6f8a7a..dab135cc 100644 --- a/src/kvilib/ext/kvi_config.cpp +++ b/src/kvilib/ext/kvi_config.cpp @@ -627,11 +627,7 @@ TQStringList KviConfig::readStringListEntry(const TQString & szKey,const TQStrin KviConfigGroup * p_group = getCurrentGroup(); TQString * p_str = p_group->find(szKey); if(!p_str)return list; -#ifdef COMPILE_USE_QT4 - return p_str->split(g_szConfigStringListSeparator); -#else return TQStringList::split(g_szConfigStringListSeparator,*p_str); -#endif } void KviConfig::writeEntry(const TQString & szKey,const TQStringList &list) @@ -653,11 +649,7 @@ KviValueList<int> KviConfig::readIntListEntry(const TQString & szKey,const KviVa //tqDebug("Returning default list for group %s and key %s",m_szGroup.latin1(),szKey.latin1()); return list; } -#ifdef COMPILE_USE_QT4 - TQStringList sl = p_str->split(","); -#else TQStringList sl = TQStringList::split(",",*p_str); -#endif KviValueList<int> ret; //tqDebug("Got option list for group %s and key %s: %s",m_szGroup.latin1(),szKey.latin1(),p_str->latin1()); diff --git a/src/kvilib/ext/kvi_doublebuffer.cpp b/src/kvilib/ext/kvi_doublebuffer.cpp index 5f48a0cb..0f15dca3 100644 --- a/src/kvilib/ext/kvi_doublebuffer.cpp +++ b/src/kvilib/ext/kvi_doublebuffer.cpp @@ -38,12 +38,7 @@ KviDoubleBuffer::KviDoubleBuffer(unsigned int uWidth,unsigned int uHeight) // There is either no such user requirement or it has grown by the meantime unsigned int uMaxW = uWidth > g_pMemoryPixmap->width() ? uWidth : g_pMemoryPixmap->width(); unsigned int uMaxH = uHeight > g_pMemoryPixmap->height() ? uHeight : g_pMemoryPixmap->height(); -#ifdef COMPILE_USE_QT4 - // QT4SUX: TQPixmap::resize() is missing (it's a widely used function and assigning a new TQPixmap() seems to be slower and not intuitive) - *g_pMemoryPixmap = TQPixmap(uMaxW,uMaxH); -#else g_pMemoryPixmap->resize(uMaxW,uMaxH); -#endif } if(uWidth > g_uMaxRequestedWidth)g_uMaxRequestedWidth = uWidth; @@ -78,12 +73,7 @@ void KviDoubleBuffer::heartbeat() if(((g_uMaxRequestedHeight + 64) < g_pMemoryPixmap->height()) || ((g_uMaxRequestedWidth + 64) < g_pMemoryPixmap->width())) { // do shrink :) -#ifdef COMPILE_USE_QT4 - // QT4SUX: TQPixmap::resize() is missing (it's a widely used function and assigning a new TQPixmap() seems to be slower and not intuitive) - *g_pMemoryPixmap = TQPixmap(g_uMaxRequestedWidth,g_uMaxRequestedHeight); -#else g_pMemoryPixmap->resize(g_uMaxRequestedWidth,g_uMaxRequestedHeight); -#endif } g_uMaxRequestedHeight = 0; g_uMaxRequestedWidth = 0; diff --git a/src/kvilib/ext/kvi_draganddrop.h b/src/kvilib/ext/kvi_draganddrop.h index 0ad6e9a2..10dc489b 100644 --- a/src/kvilib/ext/kvi_draganddrop.h +++ b/src/kvilib/ext/kvi_draganddrop.h @@ -26,20 +26,11 @@ //============================================================================= #include "kvi_settings.h" +#include <tqdragobject.h> - -#ifdef COMPILE_USE_QT4 - #include <tq3dragobject.h> - #define KviDragObject Q3DragObject - #define KviUriDrag Q3UriDrag - #define KviTextDrag Q3TextDrag - #define KviImageDrag Q3ImageDrag -#else - #include <tqdragobject.h> - #define KviDragObject TQDragObject - #define KviUriDrag TQUriDrag - #define KviTextDrag TQTextDrag - #define KviImageDrag TQImageDrag -#endif +#define KviDragObject TQDragObject +#define KviUriDrag TQUriDrag +#define KviTextDrag TQTextDrag +#define KviImageDrag TQImageDrag #endif //!_KVI_DRAGANDDROP_H_ diff --git a/src/kvilib/ext/kvi_imagelib.cpp b/src/kvilib/ext/kvi_imagelib.cpp index 104c69d4..8c0b6b43 100644 --- a/src/kvilib/ext/kvi_imagelib.cpp +++ b/src/kvilib/ext/kvi_imagelib.cpp @@ -113,26 +113,16 @@ TQPixmap KviImageLibrary::getImage(int zeroBasedIndex) int xOffset=(zeroBasedIndex % imPerRow) * m_iWidth; int yOffset=(zeroBasedIndex / imPerRow) * m_iHeight; -#ifdef COMPILE_USE_QT4 - TQImage image(m_iWidth,m_iHeight,m_pLibrary->format()); -#else TQImage image(m_iWidth,m_iHeight,m_pLibrary->depth()); -#endif int d = image.depth() / 8; -#ifndef COMPILE_USE_QT4 - if(d == 4)image.setAlphaBuffer(true); // TQt 4.x should manage it automagically -#endif + if(d == 4)image.setAlphaBuffer(true); //Copy the image data //bitBlt(&image,0,0,m_pLibrary,xOffset,yOffset,m_iWidth,m_iHeight,TQt::CopyROP,false); for(int i=0;i<m_iHeight;i++) kvi_memmove(image.scanLine(i),m_pLibrary->scanLine(i + yOffset) + (xOffset * d),m_iWidth * d); -#ifdef COMPILE_USE_QT4 - TQPixmap p = TQPixmap::fromImage(image); -#else TQPixmap p(image); -#endif return p; } diff --git a/src/kvilib/ext/kvi_mediatype.cpp b/src/kvilib/ext/kvi_mediatype.cpp index 2bc60850..7631e36c 100644 --- a/src/kvilib/ext/kvi_mediatype.cpp +++ b/src/kvilib/ext/kvi_mediatype.cpp @@ -241,11 +241,7 @@ KviMediaType * KviMediaManager::findMediaType(const char * filename,bool bCheckM KviStr szFullPath = filename; if(!kvi_isAbsolutePath(szFullPath.ptr())) { -#ifdef COMPILE_USE_QT4 - KviStr tmp = TQDir::currentPath(); -#else KviStr tmp = TQDir::currentDirPath(); -#endif tmp.ensureLastCharIs('/'); szFullPath.prepend(tmp); } @@ -406,11 +402,7 @@ KviMediaType * KviMediaManager::findMediaTypeForRegularFile(const char * szFullP TQRegExp re(m->szMagicBytes.ptr()); // It looks like they can't decide the name for this function :D // ... well, maybe the latest choice is the best one. -#ifdef COMPILE_USE_QT4 - if(re.indexIn(buffer) > -1)return m; // matched! -#else if(re.search(buffer) > -1)return m; // matched! -#endif // else magic failed...not a match } else return m; // matched! (no magic check) } diff --git a/src/kvilib/ext/kvi_miscutils.cpp b/src/kvilib/ext/kvi_miscutils.cpp index 7b3c4caa..111fa300 100644 --- a/src/kvilib/ext/kvi_miscutils.cpp +++ b/src/kvilib/ext/kvi_miscutils.cpp @@ -31,13 +31,8 @@ namespace KviMiscUtils { int compareVersions(const TQString &szVersion1,const TQString &szVersion2) { -#ifdef COMPILE_USE_QT4 - TQStringList sl1 = szVersion1.split("."); - TQStringList sl2 = szVersion2.split("."); -#else TQStringList sl1 = TQStringList::split(".",szVersion1); TQStringList sl2 = TQStringList::split(".",szVersion2); -#endif TQStringList::Iterator it1 = sl1.begin(); TQStringList::Iterator it2 = sl2.begin(); @@ -66,11 +61,7 @@ namespace KviMiscUtils bool isValidVersionString(const TQString &szVersion) { -#ifdef COMPILE_USE_QT4 - TQStringList sl = szVersion.split("."); -#else TQStringList sl = TQStringList::split(".",szVersion); -#endif if(sl.isEmpty())return false; // must all be numbers for(TQStringList::Iterator it = sl.begin();it != sl.end();++it) diff --git a/src/kvilib/ext/kvi_regusersdb.cpp b/src/kvilib/ext/kvi_regusersdb.cpp index d34fde15..87ce9b6a 100644 --- a/src/kvilib/ext/kvi_regusersdb.cpp +++ b/src/kvilib/ext/kvi_regusersdb.cpp @@ -230,11 +230,7 @@ void KviRegisteredUser::setProperty(const TQString & name,const TQString & value m_pPropertyDict = new KviPointerHashTable<TQString,TQString>(7,false); m_pPropertyDict->setAutoDelete(true); } -#ifdef COMPILE_USE_QT4 - TQString * val = new TQString(value.trimmed()); -#else TQString * val = new TQString(value.stripWhiteSpace()); -#endif if(!val->isEmpty()) { m_pPropertyDict->replace(name,val); diff --git a/src/kvilib/ext/kvi_sharedfiles.cpp b/src/kvilib/ext/kvi_sharedfiles.cpp index d38bd680..4651a3c6 100644 --- a/src/kvilib/ext/kvi_sharedfiles.cpp +++ b/src/kvilib/ext/kvi_sharedfiles.cpp @@ -86,12 +86,7 @@ KviSharedFile::KviSharedFile(const TQString &szName,const TQString &szAbsPath,co m_szUserMask = szUserMask; m_expireTime = expireTime; m_uFileSize = uFileSize; -#ifdef COMPILE_USE_QT4 - // QT4ROX: Because they have finally moved the functionality of TQString::contains() to TQString::count(), and TQString::contains() now does the right job - m_uWildCount = m_szUserMask.count('*'); -#else m_uWildCount = m_szUserMask.contains('*'); -#endif m_uNonWildCount = m_szUserMask.length() - m_uWildCount; } diff --git a/src/kvilib/ext/kvi_stringconversion.cpp b/src/kvilib/ext/kvi_stringconversion.cpp index f316fc2a..0d3736c6 100644 --- a/src/kvilib/ext/kvi_stringconversion.cpp +++ b/src/kvilib/ext/kvi_stringconversion.cpp @@ -266,11 +266,7 @@ namespace KviStringConversion bool fromString(const TQString & szValue,TQStringList &buffer) { -#ifdef COMPILE_USE_QT4 - buffer = szValue.split(","); -#else buffer = TQStringList::split(",",szValue); -#endif return true; } diff --git a/src/kvilib/file/kvi_file.cpp b/src/kvilib/file/kvi_file.cpp index 227a4997..d904540a 100644 --- a/src/kvilib/file/kvi_file.cpp +++ b/src/kvilib/file/kvi_file.cpp @@ -45,20 +45,12 @@ KviFile::~KviFile() bool KviFile::openForReading() { -#ifdef COMPILE_USE_QT4 - return open(TQFile::ReadOnly); -#else return open(IO_ReadOnly); -#endif } bool KviFile::openForWriting(bool bAppend) { -#ifdef COMPILE_USE_QT4 - return open(TQFile::WriteOnly | (bAppend ? TQFile::Append : TQFile::Truncate)); -#else return open(IO_WriteOnly | (bAppend ? IO_Append : IO_Truncate)); -#endif } @@ -77,7 +69,6 @@ bool KviFile::load(TQByteArray &bData) return true; } -#ifndef COMPILE_USE_QT4 bool KviFile::save(const KviTQCString &szData) { @@ -95,7 +86,6 @@ bool KviFile::load(KviTQCString &szData) return true; } -#endif bool KviFile::save(const TQString &szData) diff --git a/src/kvilib/file/kvi_file.h b/src/kvilib/file/kvi_file.h index 7cce041f..11cc85be 100644 --- a/src/kvilib/file/kvi_file.h +++ b/src/kvilib/file/kvi_file.h @@ -36,15 +36,7 @@ #include <tqfile.h> #include <time.h> -#ifdef COMPILE_USE_QT4 - #define kvi_file_offset_t qlonglong -#else -#ifdef USE_QT4 - #define kvi_file_offset_t qint64 -#else // USE_QT4 - #define kvi_file_offset_t TQFile::Offset -#endif // USE_QT4 -#endif +#define kvi_file_offset_t TQFile::Offset class KVILIB_API KviFile : public TQFile, public KviHeapObject @@ -58,20 +50,12 @@ public: bool openForReading(); bool openForWriting(bool bAppend = false); -#ifndef COMPILE_USE_QT4 - // Functions present in TQt 4.x but not TQt 3.x bool putChar(char c){ return putch(c) != -1; }; bool ungetChar(char c){ return ungetch(c) != -1; }; bool getChar(char * c){ *c = getch(); return *c != -1; }; bool seek(kvi_file_offset_t o){ return at(o); }; kvi_file_offset_t pos(){ return at(); }; -#endif -#ifdef COMPILE_USE_QT4 - // Missing functions in TQt 4.x - quint64 writeBlock(const char * data,quint64 uLen){ return write(data,uLen); }; - quint64 readBlock(char * data,quint64 uLen){ return read(data,uLen); }; -#endif // This stuff loads and saves LITTLE ENDIAN DATA! bool save(kvi_u64_t t); @@ -101,11 +85,8 @@ public: bool save(const KviStr &szData); bool load(KviStr &szData); -#ifndef COMPILE_USE_QT4 - // Under TQt 4.x these collide with TQByteArray bool save(const KviTQCString &szData); bool load(KviTQCString &szData); -#endif bool save(const TQByteArray &bData); bool load(TQByteArray &bData); diff --git a/src/kvilib/file/kvi_fileutils.cpp b/src/kvilib/file/kvi_fileutils.cpp index 8e81f861..9bea5c96 100644 --- a/src/kvilib/file/kvi_fileutils.cpp +++ b/src/kvilib/file/kvi_fileutils.cpp @@ -105,11 +105,7 @@ namespace KviFileUtils TQString createdDir; #ifdef COMPILE_ON_WINDOWS -#ifdef COMPILE_USE_QT4 - int idx = dir.indexOf(':'); -#else int idx = dir.find(':'); -#endif if(idx == 1) { createdDir = dir.left(2); @@ -213,20 +209,12 @@ namespace KviFileUtils { #ifdef COMPILE_ON_WINDOWS szPath.replace('/',"\\"); -#ifdef COMPILE_USE_QT4 - szPath.replace("\\\\","\\"); -#else while(szPath.find("\\\\") != -1)szPath.replace("\\\\","\\"); -#endif // FIXME: Use the default drive here ? if(szPath.startsWith("\\"))szPath.prepend("C:"); #else szPath.replace('\\',"/"); -#ifdef COMPILE_USE_QT4 - szPath.replace("//","/"); -#else while(KviTQString::find(szPath,"//") != -1)szPath.replace("//","/"); -#endif // deal with windows paths if((szPath.length() > 2) && (szPath.at(0) != TQChar('/'))) { @@ -235,12 +223,8 @@ namespace KviFileUtils szPath.remove(0,2); } } -#ifdef COMPILE_USE_QT4 - szPath=TQDir::cleanPath(szPath); -#else szPath=TQDir::cleanDirPath(szPath); #endif -#endif } diff --git a/src/kvilib/file/kvi_packagefile.cpp b/src/kvilib/file/kvi_packagefile.cpp index 31f69438..2c1ad469 100644 --- a/src/kvilib/file/kvi_packagefile.cpp +++ b/src/kvilib/file/kvi_packagefile.cpp @@ -128,11 +128,7 @@ KviPackageIOEngine::~KviPackageIOEngine() bool KviPackageIOEngine::updateProgress(int iProgress,const TQString &szLabel) { if(!m_pProgressDialog)return true; -#ifdef COMPILE_USE_QT4 - m_pProgressDialog->setValue(iProgress); -#else m_pProgressDialog->setProgress(iProgress); -#endif m_pProgressDialogLabel->setText(szLabel); tqApp->processEvents(); if(m_pProgressDialog->wasCanceled()) @@ -145,14 +141,8 @@ bool KviPackageIOEngine::updateProgress(int iProgress,const TQString &szLabel) void KviPackageIOEngine::showProgressDialog(const TQString &szCaption,int iTotalSteps) { -#ifdef COMPILE_USE_QT4 - m_pProgressDialog = new TQProgressDialog(TQString(""),__tr2qs("Cancel"),0,iTotalSteps,0); - m_pProgressDialog->setModal(true); - m_pProgressDialog->setWindowTitle(szCaption); -#else m_pProgressDialog = new TQProgressDialog(TQString(""),__tr2qs("Cancel"),iTotalSteps,0,"",true); m_pProgressDialog->setCaption(szCaption); -#endif m_pProgressDialogLabel = new TQLabel(m_pProgressDialog); m_pProgressDialogLabel->setMaximumSize(500,300); m_pProgressDialog->setLabel(m_pProgressDialogLabel); @@ -234,67 +224,35 @@ bool KviPackageWriter::addFileInternal(const TQFileInfo * fi,const TQString &szL bool KviPackageWriter::addDirectory(const TQString &szLocalDirectoryName,const TQString &szTargetDirectoryPrefix,kvi_u32_t uAddFileFlags) { TQDir d(szLocalDirectoryName); -#ifdef COMPILE_USE_QT4 - TQDir::Filters iFlags; -#else int iFlags; -#endif iFlags = TQDir::Files | TQDir::Readable; if(!(uAddFileFlags & FollowSymLinks)) iFlags |= TQDir::NoSymLinks; - // QT4SUX: Because the TQDir::entryInfoList() breaks really a lot of code by returning an object that behaves in a _totally_ different way.. it's also much slower - -#ifdef COMPILE_USE_QT4 - int j; - TQFileInfoList sl = d.entryInfoList(iFlags); - for(j=0;j<sl.size();j++) - { -#else const TQFileInfoList * sl = d.entryInfoList(iFlags); if(!sl)return false; TQFileInfoListIterator it(*sl); while(TQFileInfo * fi = it.current()) { -#endif TQString szSFileName = szLocalDirectoryName; KviTQString::ensureLastCharIs(szSFileName,TQChar(KVI_PATH_SEPARATOR_CHAR)); -#ifdef COMPILE_USE_QT4 - TQFileInfo slowCopy = sl.at(j); - szSFileName += slowCopy.fileName(); -#else szSFileName += fi->fileName(); -#endif TQString szDFileName = szTargetDirectoryPrefix; KviTQString::ensureLastCharIs(szDFileName,TQChar(KVI_PATH_SEPARATOR_CHAR)); -#ifdef COMPILE_USE_QT4 - szDFileName += slowCopy.fileName(); - if(!addFileInternal(&slowCopy,szSFileName,szDFileName,uAddFileFlags)) - return false; -#else szDFileName += fi->fileName(); if(!addFileInternal(fi,szSFileName,szDFileName,uAddFileFlags)) return false; -#endif -#ifndef COMPILE_USE_QT4 ++it; -#endif } iFlags = TQDir::Dirs | TQDir::Readable; if(!(uAddFileFlags & FollowSymLinks)) iFlags |= TQDir::NoSymLinks; sl = d.entryInfoList(iFlags); -#ifdef COMPILE_USE_QT4 - for(j=0;j<sl.size();j++) - { - TQString szDir = sl.at(j).fileName(); -#else if(!sl)return false; TQFileInfoListIterator it2(*sl); while(TQFileInfo * fi2 = it2.current()) { TQString szDir = fi2->fileName(); -#endif if(!KviTQString::equalCS(szDir,"..") && !KviTQString::equalCS(szDir,".")) { TQString szSDirName = szLocalDirectoryName; @@ -306,9 +264,7 @@ bool KviPackageWriter::addDirectory(const TQString &szLocalDirectoryName,const T if(!addDirectory(szSDirName,szDDirName,uAddFileFlags)) return false; } -#ifndef COMPILE_USE_QT4 ++it2; -#endif } return true; diff --git a/src/kvilib/irc/kvi_avatar.cpp b/src/kvilib/irc/kvi_avatar.cpp index 680e7978..3a9f54df 100644 --- a/src/kvilib/irc/kvi_avatar.cpp +++ b/src/kvilib/irc/kvi_avatar.cpp @@ -153,13 +153,9 @@ TQPixmap * KviAvatar::scaledPixmap(unsigned int w,unsigned int h) scaleW = (scaleH * curW) / curH; } -#ifdef COMPILE_USE_QT4 - m_pScaledPixmap = new TQPixmap(m_pPixmap->scaled(scaleW,scaleH)); -#else TQImage img = m_pPixmap->convertToImage(); m_pScaledPixmap = new TQPixmap(); m_pScaledPixmap->convertFromImage(img.smoothScale(scaleW,scaleH)); -#endif return m_pScaledPixmap; } diff --git a/src/kvilib/irc/kvi_ircmask.cpp b/src/kvilib/irc/kvi_ircmask.cpp index 9b0030ae..90ae3566 100644 --- a/src/kvilib/irc/kvi_ircmask.cpp +++ b/src/kvilib/irc/kvi_ircmask.cpp @@ -299,11 +299,7 @@ bool KviIrcMask::hasNumericHost() const else { if((uc < '0') || (uc > '9')) { -#ifdef COMPILE_USE_QT4 - uc = p->toUpper().unicode(); -#else uc = p->upper().unicode(); -#endif if((uc < 'A') || (uc > 'F'))return false; } } diff --git a/src/kvilib/irc/kvi_ircserverdb.cpp b/src/kvilib/irc/kvi_ircserverdb.cpp index 84bb5f39..8eecb260 100644 --- a/src/kvilib/irc/kvi_ircserverdb.cpp +++ b/src/kvilib/irc/kvi_ircserverdb.cpp @@ -184,13 +184,8 @@ bool KviIrcServerDataBase::makeCurrentBestServerInNetwork(const TQString &szNetN for(KviIrcServer * s = r->m_pServerList->first();s;s = r->m_pServerList->next()) { -#ifdef COMPILE_USE_QT4 - if(s->m_szDescription.contains("random",TQt::CaseInsensitive) || - (s->m_szDescription.contains("round",TQt::CaseInsensitive) && s->m_szDescription.contains("robin",TQt::CaseInsensitive))) -#else if(s->m_szDescription.contains("random",false) || (s->m_szDescription.contains("round",false) && s->m_szDescription.contains("robin",false))) -#endif { r->setCurrentServer(s); return true; @@ -343,11 +338,7 @@ search_finished: if(!(bIsValidIpV4 || bIsValidIpV6)) { // is it a valid hostname ? (must contain at least one dot) -#ifdef COMPILE_USE_QT4 - if(!d->szServer.contains('.')) -#else if(d->szServer.contains('.') < 1) -#endif { // assume it is a network name! KviIrcServerDataBaseRecord * r = m_pRecords->find(d->szServer); diff --git a/src/kvilib/irc/kvi_nickserv.cpp b/src/kvilib/irc/kvi_nickserv.cpp index 24a50e96..240ac515 100644 --- a/src/kvilib/irc/kvi_nickserv.cpp +++ b/src/kvilib/irc/kvi_nickserv.cpp @@ -203,19 +203,11 @@ KviNickServRule * KviNickServRuleSet::matchRule(const TQString &szNick,const Kvi if(!KviTQString::matchStringCI(r->registeredNick(),szNick,false,true)) continue; if(!szServer.isEmpty()) { -#ifdef COMPILE_USE_QT4 - TQRegExp res(r->serverMask(),TQt::CaseInsensitive,TQRegExp::Wildcard); -#else TQRegExp res(r->serverMask(),false,true); -#endif if(!res.exactMatch(szServer))continue; } if(!nickServ->matchedBy(KviIrcMask(r->nickServMask())))continue; -#ifdef COMPILE_USE_QT4 - TQRegExp re(r->messageRegexp(),TQt::CaseInsensitive,TQRegExp::Wildcard); -#else TQRegExp re(r->messageRegexp(),false,true); -#endif if(re.exactMatch(szMsg))return r; } return 0; diff --git a/src/kvilib/net/kvi_http.cpp b/src/kvilib/net/kvi_http.cpp index 0bcd864b..a8045f82 100644 --- a/src/kvilib/net/kvi_http.cpp +++ b/src/kvilib/net/kvi_http.cpp @@ -274,11 +274,7 @@ bool KviHttpRequest::event(TQEvent *e) case KVI_HTTP_REQUEST_THREAD_EVENT_REQUESTSENT: { TQString * req = ((KviThreadDataEvent<TQString> *)e)->getData(); -#ifdef COMPILE_USE_QT4 - TQStringList sl = req->split("\r\n"); -#else TQStringList sl = TQStringList::split("\r\n",*req); -#endif emit requestSent(sl); delete req; return true; diff --git a/src/kvilib/system/kvi_locale.cpp b/src/kvilib/system/kvi_locale.cpp index d4f89cc1..8798d8ec 100644 --- a/src/kvilib/system/kvi_locale.cpp +++ b/src/kvilib/system/kvi_locale.cpp @@ -37,9 +37,6 @@ #include <tqtextcodec.h> #include <tqdir.h> -#ifdef COMPILE_USE_QT4 - #include <tqlocale.h> -#endif #include "kvi_string.h" #include "kvi_qcstring.h" @@ -307,19 +304,6 @@ public: virtual int mibEnum () const { return 0; }; -#ifdef COMPILE_USE_QT4 - virtual TQByteArray name() const { return m_szName; }; -protected: - virtual TQByteArray convertFromUnicode(const TQChar * input,int number,ConverterState * state) const - { - return m_pSendCodec->fromUnicode(input,number,state); - } - virtual TQString convertToUnicode(const char * chars,int len,ConverterState * state) const - { - if(g_utf8_validate(chars,len,NULL))return g_pUtf8TextCodec->toUnicode(chars,len,state); - return m_pRecvCodec->toUnicode(chars,len,state); - } -#else public: virtual const char * mimeName () const { return m_pRecvCodec->mimeName(); }; virtual const char * name () const { return m_szName.data(); }; @@ -367,7 +351,6 @@ public: return iii; } virtual int heuristicNameMatch(const char * hint) const { return 0; }; -#endif }; static KviPointerHashTable<const char *,KviSmartTextCodec> * g_pSmartCodecDict = 0; @@ -956,11 +939,7 @@ namespace KviLocale { // first of all try to find out the current locale g_szLang=""; -#ifdef COMPILE_USE_QT4 - TQString szLangFile=TQString("%1/.kvirc_force_locale").arg(TQDir::homePath()); -#else TQString szLangFile=TQString("%1/.kvirc_force_locale").arg(TQDir::homeDirPath()); -#endif if(KviFileUtils::fileExists(szLangFile)) { TQString szTmp; @@ -968,11 +947,7 @@ namespace KviLocale g_szLang=szTmp; } if(g_szLang.isEmpty())g_szLang = kvi_getenv("KVIRC_LANG"); -#ifdef COMPILE_USE_QT4 - if(g_szLang.isEmpty())g_szLang = TQLocale::system().name(); -#else if(g_szLang.isEmpty())g_szLang = TQTextCodec::locale(); -#endif if(g_szLang.isEmpty())g_szLang = kvi_getenv("LC_MESSAGES"); if(g_szLang.isEmpty())g_szLang = kvi_getenv("LANG"); if(g_szLang.isEmpty())g_szLang = "en"; @@ -1079,11 +1054,7 @@ namespace KviLocale }; KviTranslator::KviTranslator(TQObject * par,const char * nam) -#ifdef COMPILE_USE_QT4 -: TQTranslator(par) -#else : TQTranslator(par,nam) -#endif { } @@ -1091,13 +1062,6 @@ KviTranslator::~KviTranslator() { } -#ifdef COMPILE_USE_QT4 -TQString KviTranslator::translate(const char *context,const char * message,const char * comment) const -{ - // we ignore contexts and comments for qt translations - return g_pMainCatalogue->translateToTQString(message); -} -#endif TQString KviTranslator::find(const char *context,const char * message) const { @@ -1105,13 +1069,11 @@ TQString KviTranslator::find(const char *context,const char * message) const return g_pMainCatalogue->translateToTQString(message); } -#ifndef COMPILE_USE_QT4 TQTranslatorMessage KviTranslator::findMessage(const char * context,const char * sourceText,const char * comment) const { // we ignore contexts for qt translations return TQTranslatorMessage(context,sourceText,comment,g_pMainCatalogue->translateToTQString(sourceText)); } -#endif #if 0 diff --git a/src/kvilib/system/kvi_locale.h b/src/kvilib/system/kvi_locale.h index b3f15b45..599aec41 100644 --- a/src/kvilib/system/kvi_locale.h +++ b/src/kvilib/system/kvi_locale.h @@ -132,15 +132,8 @@ class KVILIB_API KviTranslator : public TQTranslator KviTranslator(TQObject * parent,const char * name); ~KviTranslator(); public: -#ifdef COMPILE_USE_QT4 - virtual TQString translate(const char * context,const char * message,const char * comment) const; -#endif - // Deprecated in qt 4.x virtual TQString find(const char * context,const char * message) const; -#ifndef COMPILE_USE_QT4 - // Dead in qt 4.x virtual TQTranslatorMessage findMessage(const char * context,const char * sourceText,const char * comment = 0) const; -#endif }; diff --git a/src/kvilib/system/kvi_process.h b/src/kvilib/system/kvi_process.h index 649e40d7..2be819a5 100644 --- a/src/kvilib/system/kvi_process.h +++ b/src/kvilib/system/kvi_process.h @@ -26,12 +26,7 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include <tq3process.h> - #define KviProcess Q3Process -#else #include <tqprocess.h> #define KviProcess TQProcess -#endif #endif //!_KVI_PROCESS_H_ diff --git a/src/kvilib/tal/kvi_tal_filedialog.cpp b/src/kvilib/tal/kvi_tal_filedialog.cpp index 77e7529e..cfbb2d60 100644 --- a/src/kvilib/tal/kvi_tal_filedialog.cpp +++ b/src/kvilib/tal/kvi_tal_filedialog.cpp @@ -27,54 +27,6 @@ #include "kvi_tal_filedialog.h" -#ifdef COMPILE_USE_QT4 - - #include <tqdir.h> - - KviTalFileDialog::KviTalFileDialog(const TQString &dirName,const TQString &filter,TQWidget *parent,const char *name,bool modal) - : TQFileDialog(parent,"",dirName,filter) - { - setModal(modal); - } - - KviTalFileDialog::~KviTalFileDialog() - { - } - - void KviTalFileDialog::setFileMode(FileMode m) - { - switch(m) - { - case AnyFile: - TQFileDialog::setFileMode(TQFileDialog::AnyFile); - break; - case ExistingFile: - TQFileDialog::setFileMode(TQFileDialog::ExistingFile); - break; - case ExistingFiles: - TQFileDialog::setFileMode(TQFileDialog::ExistingFiles); - break; - case Directory: - TQFileDialog::setFileMode(TQFileDialog::Directory); - break; - case DirectoryOnly: - TQFileDialog::setFileMode(TQFileDialog::DirectoryOnly); - break; - default: - TQFileDialog::setFileMode(TQFileDialog::AnyFile); - break; - } - } - - void KviTalFileDialog::setDirectory(const TQString &szDirectory) - { - TQFileDialog::setDirectory(szDirectory); - } - - - #include "kvi_tal_filedialog_qt4.moc" - -#else #ifdef COMPILE_TDE_SUPPORT @@ -173,4 +125,3 @@ #include "kvi_tal_filedialog_qt.moc" #endif -#endif diff --git a/src/kvilib/tal/kvi_tal_filedialog.h b/src/kvilib/tal/kvi_tal_filedialog.h index f7456e3c..ca7151ae 100644 --- a/src/kvilib/tal/kvi_tal_filedialog.h +++ b/src/kvilib/tal/kvi_tal_filedialog.h @@ -27,14 +27,10 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_filedialog_qt4.h" -#else #ifdef COMPILE_TDE_SUPPORT #include "kvi_tal_filedialog_kde.h" #else #include "kvi_tal_filedialog_qt.h" #endif -#endif #endif // _KVI_TAL_FILEDIALOG_H_ diff --git a/src/kvilib/tal/kvi_tal_filedialog_qt4.h b/src/kvilib/tal/kvi_tal_filedialog_qt4.h deleted file mode 100644 index 3c7580e7..00000000 --- a/src/kvilib/tal/kvi_tal_filedialog_qt4.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _KVI_TAL_FILEDIALOG_QT4_H_ -#define _KVI_TAL_FILEDIALOG_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_filedialog_qt4.h -// Creation date : Fri 19 Jan 2007 02:17:12 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include <tqfiledialog.h> - -class KVILIB_API KviTalFileDialog : public TQFileDialog -{ - TQ_OBJECT - -public: - KviTalFileDialog(const TQString &dirName,const TQString &filter = TQString(),TQWidget *parent = 0,const char *name = 0,bool modal = FALSE); - ~KviTalFileDialog(); -public: - enum FileMode { AnyFile, ExistingFile, ExistingFiles, Directory, DirectoryOnly }; - - void setFileMode(FileMode m); - void setDirectory(const TQString &szDirectory); - - static TQString getExistingDirectoryPath(const TQString &dir = TQString(),const TQString &caption = TQString(),TQWidget *parent = 0) - { return getExistingDirectory(parent,caption,dir); }; -}; - -#endif // _KVI_TAL_FILEDIALOG_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_grid.cpp b/src/kvilib/tal/kvi_tal_grid.cpp index 472af5a0..3d688e9e 100644 --- a/src/kvilib/tal/kvi_tal_grid.cpp +++ b/src/kvilib/tal/kvi_tal_grid.cpp @@ -26,9 +26,5 @@ #include "kvi_tal_grid.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_grid_qt4.moc" -#else #include "kvi_tal_grid_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_grid.h b/src/kvilib/tal/kvi_tal_grid.h index 18c4af98..a5ee8045 100644 --- a/src/kvilib/tal/kvi_tal_grid.h +++ b/src/kvilib/tal/kvi_tal_grid.h @@ -27,10 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_grid_qt4.h" -#else #include "kvi_tal_grid_qt3.h" -#endif #endif // _KVI_TAL_GRID_H_ diff --git a/src/kvilib/tal/kvi_tal_grid_qt4.h b/src/kvilib/tal/kvi_tal_grid_qt4.h deleted file mode 100644 index 23a6bfab..00000000 --- a/src/kvilib/tal/kvi_tal_grid_qt4.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_GRID_QT4_H_ -#define _KVI_TAL_GRID_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_grid_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include <tq3grid.h> - -class KVILIB_API KviTalGrid : public Q3Grid -{ - TQ_OBJECT - -public: - KviTalGrid(int n,Qt::Orientation orient,TQWidget * pParent = 0) - : Q3Grid(n,orient,pParent) {}; - ~KviTalGrid() {}; -}; - -#endif // _KVI_TAL_GRID_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_groupbox.cpp b/src/kvilib/tal/kvi_tal_groupbox.cpp index bf2f5689..704ff363 100644 --- a/src/kvilib/tal/kvi_tal_groupbox.cpp +++ b/src/kvilib/tal/kvi_tal_groupbox.cpp @@ -26,9 +26,5 @@ #include "kvi_tal_groupbox.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_groupbox_qt4.moc" -#else #include "kvi_tal_groupbox_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_groupbox.h b/src/kvilib/tal/kvi_tal_groupbox.h index ae82519b..59c7096e 100644 --- a/src/kvilib/tal/kvi_tal_groupbox.h +++ b/src/kvilib/tal/kvi_tal_groupbox.h @@ -27,10 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_groupbox_qt4.h" -#else #include "kvi_tal_groupbox_qt3.h" -#endif #endif // _KVI_TAL_GROUPBOX_H_ diff --git a/src/kvilib/tal/kvi_tal_groupbox_qt4.h b/src/kvilib/tal/kvi_tal_groupbox_qt4.h deleted file mode 100644 index 963a1a01..00000000 --- a/src/kvilib/tal/kvi_tal_groupbox_qt4.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _KVI_TAL_GROUPBOX_QT4_H_ -#define _KVI_TAL_GROUPBOX_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_groupbox_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include <tq3groupbox.h> - -class KVILIB_API KviTalGroupBox : public Q3GroupBox -{ - TQ_OBJECT - -public: - KviTalGroupBox(TQWidget * parent = 0) - : Q3GroupBox(parent) {}; - KviTalGroupBox(const TQString & title,TQWidget * parent = 0) - : Q3GroupBox(title,parent) {}; - KviTalGroupBox(int strips,Qt::Orientation orientation,TQWidget * parent = 0) - : Q3GroupBox(strips,orientation,parent) {}; - KviTalGroupBox(int strips,Qt::Orientation orientation,const TQString & title,TQWidget * parent = 0) - : Q3GroupBox(strips,orientation,title,parent) {}; - ~KviTalGroupBox() {}; -}; - - - -#endif // _KVI_TAL_GROUPBOX_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_hbox.cpp b/src/kvilib/tal/kvi_tal_hbox.cpp index 6df56ee8..ba9f23ad 100644 --- a/src/kvilib/tal/kvi_tal_hbox.cpp +++ b/src/kvilib/tal/kvi_tal_hbox.cpp @@ -25,8 +25,4 @@ #define __KVILIB__ #include "kvi_tal_hbox.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_hbox_qt4.moc" -#else #include "kvi_tal_hbox_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_hbox.h b/src/kvilib/tal/kvi_tal_hbox.h index 6f955ed6..3081aa96 100644 --- a/src/kvilib/tal/kvi_tal_hbox.h +++ b/src/kvilib/tal/kvi_tal_hbox.h @@ -27,10 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_hbox_qt4.h" -#else #include "kvi_tal_hbox_qt3.h" -#endif #endif // _KVI_TAL_HBOX_H_ diff --git a/src/kvilib/tal/kvi_tal_hbox_qt4.h b/src/kvilib/tal/kvi_tal_hbox_qt4.h deleted file mode 100644 index 051b5228..00000000 --- a/src/kvilib/tal/kvi_tal_hbox_qt4.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_HBOX_QT4_H_ -#define _KVI_TAL_HBOX_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_hbox_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include <tq3hbox.h> - -class KVILIB_API KviTalHBox : public Q3HBox -{ - TQ_OBJECT - -public: - KviTalHBox(TQWidget * pParent,char* name=0) - : Q3HBox(pParent,name) {}; - virtual ~KviTalHBox() {}; -}; - -#endif // _KVI_TAL_HBOX_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_iconview.cpp b/src/kvilib/tal/kvi_tal_iconview.cpp index 45b640fd..9abe0f64 100644 --- a/src/kvilib/tal/kvi_tal_iconview.cpp +++ b/src/kvilib/tal/kvi_tal_iconview.cpp @@ -25,100 +25,6 @@ #define __KVILIB__ #include "kvi_tal_iconview.h" -#ifdef COMPILE_USE_QT4 - - KviTalIconView::KviTalIconView(TQWidget * pParent,TQt::WFlags f) - : Q3IconView(pParent,0,f) - { - connect(this,TQT_SIGNAL(selectionChanged(Q3IconViewItem *)),this,TQT_SLOT(redirect_selectionChanged(Q3IconViewItem *))); - connect(this,TQT_SIGNAL(currentChanged(Q3IconViewItem *)),this,TQT_SLOT(redirect_currentChanged(Q3IconViewItem *))); - connect(this,TQT_SIGNAL(clicked(Q3IconViewItem *)),this,TQT_SLOT(redirect_clicked(Q3IconViewItem *))); - connect(this,TQT_SIGNAL(clicked(Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_clicked(Q3IconViewItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(pressed(Q3IconViewItem *)),this,TQT_SLOT(redirect_pressed(Q3IconViewItem *))); - connect(this,TQT_SIGNAL(pressed(Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_pressed(Q3IconViewItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(doubleClicked(Q3IconViewItem *)),this,TQT_SLOT(redirect_doubleClicked(Q3IconViewItem *))); - connect(this,TQT_SIGNAL(returnPressed(Q3IconViewItem *)),this,TQT_SLOT(redirect_returnPressed(Q3IconViewItem *))); - connect(this,TQT_SIGNAL(rightButtonClicked(Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_rightButtonClicked(Q3IconViewItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(rightButtonPressed(Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_rightButtonPressed(Q3IconViewItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(mouseButtonClicked(int,Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonClicked(int,Q3IconViewItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(mouseButtonPressed(int,Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonPressed(int,Q3IconViewItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(contextMenuRequested(Q3IconViewItem *,const TQPoint &)),this,TQT_SLOT(redirect_contextMenuRequested(Q3IconViewItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(onItem(Q3IconViewItem *)),this,TQT_SLOT(redirect_onItem(Q3IconViewItem *))); - } - - void KviTalIconView::redirect_selectionChanged(Q3IconViewItem * pItem) - { - emit selectionChanged((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_currentChanged(Q3IconViewItem * pItem) - { - emit currentChanged((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_clicked(Q3IconViewItem * pItem) - { - emit clicked((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_clicked(Q3IconViewItem * pItem,const TQPoint &pnt) - { - emit clicked((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_pressed(Q3IconViewItem * pItem) - { - emit pressed((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_pressed(Q3IconViewItem * pItem,const TQPoint &pnt) - { - emit pressed((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_doubleClicked(Q3IconViewItem * pItem) - { - emit doubleClicked((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_returnPressed(Q3IconViewItem * pItem) - { - emit returnPressed((KviTalIconViewItem *)pItem); - } - - void KviTalIconView::redirect_rightButtonClicked(Q3IconViewItem * pItem,const TQPoint &pnt) - { - emit rightButtonClicked((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_rightButtonPressed(Q3IconViewItem * pItem,const TQPoint &pnt) - { - emit rightButtonPressed((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_mouseButtonClicked(int iButton,Q3IconViewItem * pItem,const TQPoint &pnt) - { - emit mouseButtonClicked(iButton,(KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_mouseButtonPressed(int iButton,Q3IconViewItem * pItem,const TQPoint &pnt) - { - emit mouseButtonPressed(iButton,(KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_contextMenuRequested(Q3IconViewItem * pItem,const TQPoint &pnt) - { - emit contextMenuRequested((KviTalIconViewItem *)pItem,pnt); - } - - void KviTalIconView::redirect_onItem(Q3IconViewItem * pItem) - { - emit onItem((KviTalIconViewItem *)pItem); - } - - - #include "kvi_tal_iconview_qt4.moc" -#else KviTalIconView::KviTalIconView(TQWidget * pParent,TQt::WFlags f) : TQIconView(pParent,0,f) @@ -211,5 +117,4 @@ #include "kvi_tal_iconview_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_iconview.h b/src/kvilib/tal/kvi_tal_iconview.h index 53b1137b..a2bc2114 100644 --- a/src/kvilib/tal/kvi_tal_iconview.h +++ b/src/kvilib/tal/kvi_tal_iconview.h @@ -27,10 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_iconview_qt4.h" -#else #include "kvi_tal_iconview_qt3.h" -#endif #endif // _KVI_TAL_ICONVIEW_H_ diff --git a/src/kvilib/tal/kvi_tal_iconview_qt4.h b/src/kvilib/tal/kvi_tal_iconview_qt4.h deleted file mode 100644 index 5b919248..00000000 --- a/src/kvilib/tal/kvi_tal_iconview_qt4.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifndef _KVI_TAL_ICONVIEW_QT4_H_ -#define _KVI_TAL_ICONVIEW_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_iconview_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,59 Temple Place - Suite 440, Boston, MA 02111-1407, USA. -// -//============================================================================= - -#include "kvi_settings.h" -#include "kvi_qstring.h" - -#include <tq3iconview.h> - -class KviTalIconViewItem; - -class KVILIB_API KviTalIconView : public Q3IconView -{ - TQ_OBJECT - -public: - KviTalIconView(TQWidget * pParent,TQt::WFlags f = 0); - virtual ~KviTalIconView() {}; -signals: - void selectionChanged(KviTalIconViewItem * pItem); - void currentChanged(KviTalIconViewItem * pItem); - void clicked(KviTalIconViewItem * pItem); - void clicked(KviTalIconViewItem * pItem,const TQPoint &pnt); - void pressed(KviTalIconViewItem * pItem); - void pressed(KviTalIconViewItem * pItem,const TQPoint &pnt); - void doubleClicked(KviTalIconViewItem * pItem); - void returnPressed(KviTalIconViewItem * pItem); - void rightButtonClicked(KviTalIconViewItem * pItem,const TQPoint &pnt); - void rightButtonPressed(KviTalIconViewItem * pItem,const TQPoint &pnt); - void mouseButtonClicked(int iButton,KviTalIconViewItem * pItem,const TQPoint &pnt); - void mouseButtonPressed(int iButton,KviTalIconViewItem * pItem,const TQPoint &pnt); - void contextMenuRequested(KviTalIconViewItem * pItem,const TQPoint &pnt); - void onItem(KviTalIconViewItem * pItem); -protected slots: - void redirect_selectionChanged(Q3IconViewItem * pItem); - void redirect_currentChanged(Q3IconViewItem * pItem); - void redirect_clicked(Q3IconViewItem * pItem); - void redirect_clicked(Q3IconViewItem * pItem,const TQPoint &pnt); - void redirect_pressed(Q3IconViewItem * pItem); - void redirect_pressed(Q3IconViewItem * pItem,const TQPoint &pnt); - void redirect_doubleClicked(Q3IconViewItem * pItem); - void redirect_returnPressed(Q3IconViewItem * pItem); - void redirect_rightButtonClicked(Q3IconViewItem * pItem,const TQPoint &pnt); - void redirect_rightButtonPressed(Q3IconViewItem * pItem,const TQPoint &pnt); - void redirect_mouseButtonClicked(int iButton,Q3IconViewItem * pItem,const TQPoint &pnt); - void redirect_mouseButtonPressed(int iButton,Q3IconViewItem * pItem,const TQPoint &pnt); - void redirect_contextMenuRequested(Q3IconViewItem * pItem,const TQPoint &pnt); - void redirect_onItem(Q3IconViewItem * pItem); -public: - KviTalIconViewItem * firstItem() const { return (KviTalIconViewItem *)Q3IconView::firstItem(); }; - KviTalIconViewItem * lastItem() const { return (KviTalIconViewItem *)Q3IconView::lastItem(); }; - KviTalIconViewItem * currentItem() const { return (KviTalIconViewItem *)Q3IconView::currentItem(); }; -}; - -class KVILIB_API KviTalIconViewItem : public Q3IconViewItem -{ -public: - KviTalIconViewItem(KviTalIconView * parent) - : Q3IconViewItem(parent) {}; - KviTalIconViewItem(KviTalIconView * parent,KviTalIconViewItem * after) - : Q3IconViewItem(parent,after) {}; - KviTalIconViewItem(KviTalIconView * parent, const TQString & text) - : Q3IconViewItem(parent,text) {}; - KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const TQString & text) - : Q3IconViewItem(parent,after,text) {}; - KviTalIconViewItem(KviTalIconView * parent, const TQString & text, const TQPixmap & icon) - : Q3IconViewItem(parent,text,icon) {}; - KviTalIconViewItem(KviTalIconView * parent, KviTalIconViewItem * after, const TQString & text, const TQPixmap & icon) - : Q3IconViewItem(parent,after,text,icon) {}; -public: - KviTalIconView * iconView() const { return (KviTalIconView *)Q3IconViewItem::iconView(); }; - KviTalIconViewItem * prevItem() const { return (KviTalIconViewItem *)Q3IconViewItem::prevItem(); }; - KviTalIconViewItem * nextItem() const { return (KviTalIconViewItem *)Q3IconViewItem::nextItem(); }; -}; - - -#endif // _KVI_TAL_ICONVIEW_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_listbox.cpp b/src/kvilib/tal/kvi_tal_listbox.cpp index e96cc012..72a0cf28 100644 --- a/src/kvilib/tal/kvi_tal_listbox.cpp +++ b/src/kvilib/tal/kvi_tal_listbox.cpp @@ -25,247 +25,6 @@ #define __KVILIB__ #include "kvi_tal_listbox.h" -#ifdef COMPILE_USE_QT4 - #include <tqpainter.h> - #include <tqstyle.h> - #include <tqapplication.h> - - KviTalListBox::KviTalListBox(TQWidget * pParent,TQt::WFlags f) - : Q3ListBox(pParent,0,f) - { - connect(this,TQT_SIGNAL(highlighted(Q3ListBoxItem *)),this,TQT_SLOT(redirect_highlighted(Q3ListBoxItem *))); - connect(this,TQT_SIGNAL(selected(Q3ListBoxItem *)),this,TQT_SLOT(redirect_selected(Q3ListBoxItem *))); - connect(this,TQT_SIGNAL(selectionChanged(Q3ListBoxItem *)),this,TQT_SLOT(redirect_selectionChanged(Q3ListBoxItem *))); - connect(this,TQT_SIGNAL(currentChanged(Q3ListBoxItem *)),this,TQT_SLOT(redirect_currentChanged(Q3ListBoxItem *))); - connect(this,TQT_SIGNAL(clicked(Q3ListBoxItem *)),this,TQT_SLOT(redirect_clicked(Q3ListBoxItem *))); - connect(this,TQT_SIGNAL(clicked(Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_clicked(Q3ListBoxItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(pressed(Q3ListBoxItem *)),this,TQT_SLOT(redirect_pressed(Q3ListBoxItem *))); - connect(this,TQT_SIGNAL(pressed(Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_pressed(Q3ListBoxItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(doubleClicked(Q3ListBoxItem *)),this,TQT_SLOT(redirect_doubleClicked(Q3ListBoxItem *))); - connect(this,TQT_SIGNAL(returnPressed(Q3ListBoxItem *)),this,TQT_SLOT(redirect_returnPressed(Q3ListBoxItem *))); - connect(this,TQT_SIGNAL(rightButtonClicked(Q3ListBoxItem *, const TQPoint &)),this,TQT_SLOT(redirect_rightButtonClicked(Q3ListBoxItem *, const TQPoint &))); - connect(this,TQT_SIGNAL(rightButtonPressed(Q3ListBoxItem *, const TQPoint &)),this,TQT_SLOT(redirect_rightButtonPressed(Q3ListBoxItem *, const TQPoint &))); - connect(this,TQT_SIGNAL(mouseButtonPressed(int,Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonPressed(int,Q3ListBoxItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(mouseButtonClicked(int,Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonClicked(int,Q3ListBoxItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(contextMenuRequested(Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_contextMenuRequested(Q3ListBoxItem *,const TQPoint &))); - connect(this,TQT_SIGNAL(onItem(Q3ListBoxItem *)),this,TQT_SLOT(redirect_onItem(Q3ListBoxItem *))); - } - - void KviTalListBox::redirect_highlighted(Q3ListBoxItem *item) - { - emit highlighted((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_selected(Q3ListBoxItem *item) - { - emit selected((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_selectionChanged(Q3ListBoxItem * item) - { - emit selectionChanged((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_currentChanged(Q3ListBoxItem * item) - { - emit currentChanged((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_clicked(Q3ListBoxItem * item) - { - emit clicked((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_clicked(Q3ListBoxItem * item,const TQPoint & pnt) - { - emit clicked((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_pressed(Q3ListBoxItem * item) - { - emit pressed((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_pressed(Q3ListBoxItem * item,const TQPoint & pnt) - { - emit pressed((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_doubleClicked(Q3ListBoxItem * item) - { - emit doubleClicked((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_returnPressed(Q3ListBoxItem * item) - { - emit returnPressed((KviTalListBoxItem *)item); - } - - void KviTalListBox::redirect_rightButtonClicked(Q3ListBoxItem * item, const TQPoint &pnt) - { - emit rightButtonClicked((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_rightButtonPressed(Q3ListBoxItem * item, const TQPoint &pnt) - { - emit rightButtonPressed((KviTalListBoxItem *)item,pnt); - } - - void KviTalListBox::redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const TQPoint & pos) - { - emit mouseButtonPressed(button,(KviTalListBoxItem *)item,pos); - } - - void KviTalListBox::redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const TQPoint & pos) - { - emit mouseButtonClicked(button,(KviTalListBoxItem *)item,pos); - } - - void KviTalListBox::redirect_contextMenuRequested(Q3ListBoxItem * item,const TQPoint & pos) - { - emit contextMenuRequested((KviTalListBoxItem *)item,pos); - } - - void KviTalListBox::redirect_onItem(Q3ListBoxItem * i) - { - emit onItem((KviTalListBoxItem *)i); - } - - KviTalListBoxText::KviTalListBoxText(KviTalListBox *listbox, const TQString &text) - :KviTalListBoxItem(listbox) - { - setText(text); - } - - KviTalListBoxText::KviTalListBoxText(const TQString &text) - :KviTalListBoxItem() - { - setText(text); - } - - KviTalListBoxText::KviTalListBoxText(KviTalListBox* listbox, const TQString &text, KviTalListBoxItem *after) - : KviTalListBoxItem(listbox, after) - { - setText(text); - } - - KviTalListBoxText::~KviTalListBoxText() - { - } - - void KviTalListBoxText::paint(TQPainter *painter) - { - int itemHeight = height(listBox()); - TQFontMetrics fm = painter->fontMetrics(); - int yPos = ((itemHeight - fm.height()) / 2) + fm.ascent(); - painter->drawText(3, yPos, text()); - } - - int KviTalListBoxText::height(const KviTalListBox* lb) const - { - int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0; - return qMax(h, TQApplication::globalStrut().height()); - } - - int KviTalListBoxText::width(const KviTalListBox* lb) const - { - int w = lb ? lb->fontMetrics().width(text()) + 6 : 0; - return qMax(w, TQApplication::globalStrut().width()); - } - - int KviTalListBoxText::rtti() const - { - return RTTI; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &pixmap) - : KviTalListBoxItem(listbox) - { - pm = pixmap; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(const TQPixmap &pixmap) - : KviTalListBoxItem() - { - pm = pixmap; - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &pixmap, KviTalListBoxItem *after) - : KviTalListBoxItem(listbox, after) - { - pm = pixmap; - } - - KviTalListBoxPixmap::~KviTalListBoxPixmap() - { - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &pix, const TQString& text) - : KviTalListBoxItem(listbox) - { - pm = pix; - setText(text); - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(const TQPixmap & pix, const TQString& text) - : KviTalListBoxItem() - { - pm = pix; - setText(text); - } - - KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap & pix, const TQString& text, - KviTalListBoxItem *after) - : KviTalListBoxItem(listbox, after) - { - pm = pix; - setText(text); - } - - void KviTalListBoxPixmap::paint(TQPainter *painter) - { - int itemHeight = height(listBox()); - int yPos; - - const TQPixmap *pm = pixmap(); - if (pm && ! pm->isNull()) { - yPos = (itemHeight - pm->height()) / 2; - painter->drawPixmap(3, yPos, *pm); - } - - if (!text().isEmpty()) { - TQFontMetrics fm = painter->fontMetrics(); - yPos = ((itemHeight - fm.height()) / 2) + fm.ascent(); - painter->drawText(pm->width() + 5, yPos, text()); - } - } - - int KviTalListBoxPixmap::height(const KviTalListBox* lb) const - { - int h; - if (text().isEmpty()) - h = pm.height(); - else - h = qMax(pm.height(), lb->fontMetrics().lineSpacing() + 2); - return qMax(h, TQApplication::globalStrut().height()); - } - - int KviTalListBoxPixmap::width(const KviTalListBox* lb) const - { - if (text().isEmpty()) - return qMax(pm.width() + 6, TQApplication::globalStrut().width()); - return qMax(pm.width() + lb->fontMetrics().width(text()) + 6, - TQApplication::globalStrut().width()); - } - - int KviTalListBoxPixmap::rtti() const - { - return RTTI; - } - - - #include "kvi_tal_listbox_qt4.moc" -#else #include <tqpainter.h> #include <tqstyle.h> #include <tqapplication.h> @@ -509,5 +268,4 @@ } #include "kvi_tal_listbox_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_listbox.h b/src/kvilib/tal/kvi_tal_listbox.h index f7c53560..95302d80 100644 --- a/src/kvilib/tal/kvi_tal_listbox.h +++ b/src/kvilib/tal/kvi_tal_listbox.h @@ -27,24 +27,6 @@ #include "kvi_settings.h" -// -// This is the only reasonable CROSS-QT3-QT4-COMPATIBLE implementation -// of TQListBox I've been able to find. -// Note that using macros for the items will NOT work since moc -// doesn't expand them. Note also that KviTalListBoxText must -// be fully reimplemented and not be inherited from TQListBoxText -// to build up a consistent item object hierarchy. To complete -// the obscenity, we need TWO COMPLETE implementations: one for TQt3 -// and one for TQt4... bleah :D -// -// The code for KviTalListBoxText is adapted from qlistbox.h/cpp -// present in qt 3.3.6 AND in qt 4.1.2. -// - -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_listbox_qt4.h" -#else - #include "kvi_tal_listbox_qt3.h" -#endif +#include "kvi_tal_listbox_qt3.h" #endif // _KVI_TAL_LISTBOX_H_ diff --git a/src/kvilib/tal/kvi_tal_listbox_qt4.h b/src/kvilib/tal/kvi_tal_listbox_qt4.h deleted file mode 100644 index f2b34a19..00000000 --- a/src/kvilib/tal/kvi_tal_listbox_qt4.h +++ /dev/null @@ -1,153 +0,0 @@ -#ifndef _KVI_TAL_LISTBOX_QT4_H_ -#define _KVI_TAL_LISTBOX_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_listbox_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include <tq3listbox.h> - -class KviTalListBoxItem; - - -class KVILIB_API KviTalListBox : public Q3ListBox -{ - TQ_OBJECT - -public: - KviTalListBox(TQWidget * pParent,TQt::WFlags f = 0); - virtual ~KviTalListBox() {}; -public: - KviTalListBoxItem * firstItem() const { return (KviTalListBoxItem *)Q3ListBox::firstItem(); }; - KviTalListBoxItem * selectedItem() const { return (KviTalListBoxItem *)Q3ListBox::selectedItem(); }; - KviTalListBoxItem * item(int iIndex) const { return (KviTalListBoxItem *)Q3ListBox::item(iIndex); }; -signals: - void highlighted(KviTalListBoxItem *); - void selected(KviTalListBoxItem *); - void selectionChanged(KviTalListBoxItem * item); - void currentChanged(KviTalListBoxItem * item); - void clicked(KviTalListBoxItem * item); - void clicked(KviTalListBoxItem * item,const TQPoint & pnt); - void pressed(KviTalListBoxItem * item); - void pressed(KviTalListBoxItem * item,const TQPoint & pnt); - void doubleClicked(KviTalListBoxItem * item); - void returnPressed(KviTalListBoxItem * item); - void rightButtonClicked(KviTalListBoxItem *, const TQPoint &); - void rightButtonPressed(KviTalListBoxItem *, const TQPoint &); - void mouseButtonPressed(int button,KviTalListBoxItem * item,const TQPoint & pos); - void mouseButtonClicked(int button,KviTalListBoxItem * item,const TQPoint & pos); - void contextMenuRequested(KviTalListBoxItem * item,const TQPoint & pos); - void onItem(KviTalListBoxItem * i); -protected slots: - void redirect_highlighted(Q3ListBoxItem *); - void redirect_selected(Q3ListBoxItem *); - void redirect_selectionChanged(Q3ListBoxItem * item); - void redirect_currentChanged(Q3ListBoxItem * item); - void redirect_clicked(Q3ListBoxItem * item); - void redirect_clicked(Q3ListBoxItem * item,const TQPoint & pnt); - void redirect_pressed(Q3ListBoxItem * item); - void redirect_pressed(Q3ListBoxItem * item,const TQPoint & pnt); - void redirect_doubleClicked(Q3ListBoxItem * item); - void redirect_returnPressed(Q3ListBoxItem *); - void redirect_rightButtonClicked(Q3ListBoxItem *, const TQPoint &); - void redirect_rightButtonPressed(Q3ListBoxItem *, const TQPoint &); - void redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const TQPoint & pos); - void redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const TQPoint & pos); - void redirect_contextMenuRequested(Q3ListBoxItem * item,const TQPoint & pos); - void redirect_onItem(Q3ListBoxItem * i); -}; - -class KVILIB_API KviTalListBoxItem : public Q3ListBoxItem -{ -public: - KviTalListBoxItem() - : Q3ListBoxItem() {}; - KviTalListBoxItem(KviTalListBox * pParent) - : Q3ListBoxItem(pParent) {}; - KviTalListBoxItem(KviTalListBox * pParent,KviTalListBoxItem * pAfter) - : Q3ListBoxItem(pParent,pAfter) {}; - virtual ~KviTalListBoxItem() {}; -public: - KviTalListBoxItem * next() const { return (KviTalListBoxItem *)Q3ListBoxItem::next(); }; - KviTalListBoxItem * prev() const { return (KviTalListBoxItem *)Q3ListBoxItem::prev(); }; - KviTalListBox * listBox() const { return (KviTalListBox *)Q3ListBoxItem::listBox(); }; - virtual int height(const KviTalListBox *) const { return 0; }; - int height(const Q3ListBox *lb) const { return height((KviTalListBox *)lb); }; - virtual int width(const KviTalListBox *) const { return 0; }; - int width(const Q3ListBox *lb) const { return width((KviTalListBox *)lb); }; -}; - - -class KVILIB_API KviTalListBoxText : public KviTalListBoxItem -{ -public: - KviTalListBoxText(KviTalListBox* listbox, const TQString & text=TQString()); - KviTalListBoxText(const TQString & text=TQString()); - KviTalListBoxText(KviTalListBox* listbox, const TQString & text, KviTalListBoxItem *after); - ~KviTalListBoxText(); - - int height(const KviTalListBox *) const; - int width(const KviTalListBox *) const; - - int rtti() const; - enum { RTTI = 1 }; - -protected: - virtual void paint(TQPainter *); - -private: - TQ_DISABLE_COPY(KviTalListBoxText) -}; - - -class KVILIB_API KviTalListBoxPixmap : public KviTalListBoxItem -{ -public: - KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &); - KviTalListBoxPixmap(const TQPixmap &); - KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap & pix, KviTalListBoxItem *after); - KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &, const TQString&); - KviTalListBoxPixmap(const TQPixmap &, const TQString&); - KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap & pix, const TQString&, KviTalListBoxItem *after); - ~KviTalListBoxPixmap(); - - const TQPixmap *pixmap() const { return ± } - - int height(const KviTalListBox *) const; - int width(const KviTalListBox *) const; - - int rtti() const; - enum { RTTI = 2 }; - -protected: - virtual void paint(TQPainter *); - -private: - TQ_DISABLE_COPY(KviTalListBoxPixmap) - - TQPixmap pm; -}; - -#endif // _KVI_TAL_LISTBOX_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_listview.cpp b/src/kvilib/tal/kvi_tal_listview.cpp index 997eda30..c41c909e 100644 --- a/src/kvilib/tal/kvi_tal_listview.cpp +++ b/src/kvilib/tal/kvi_tal_listview.cpp @@ -28,779 +28,6 @@ #include "kvi_pointerhashtable.h" -#ifdef COMPILE_USE_QT4 - #include <tqpainter.h> - #include <tqstyle.h> - #include <tq3header.h> - #include <tqapplication.h> - #include <tqhash.h> - #include <tqstyleoption.h> - #include <tqaccessible.h> - - static TQStyleOptionQ3ListView getStyleOption(const Q3ListView *lv, const Q3ListViewItem *item) - { - TQStyleOptionQ3ListView opt; - opt.init(lv); - opt.subControls = TQStyle::SC_None; - opt.activeSubControls = TQStyle::SC_None; - TQWidget *vp = lv->viewport(); - opt.viewportPalette = vp->palette(); - opt.viewportBGRole = vp->backgroundRole(); - opt.itemMargin = lv->itemMargin(); - opt.sortColumn = 0; - opt.treeStepSize = lv->treeStepSize(); - opt.rootIsDecorated = lv->rootIsDecorated(); - bool firstItem = true; - while (item) { - TQStyleOptionQ3ListViewItem lvi; - lvi.height = item->height(); - lvi.totalHeight = item->totalHeight(); - lvi.itemY = item->itemPos(); - lvi.childCount = item->childCount(); - lvi.features = TQStyleOptionQ3ListViewItem::None; - lvi.state = TQStyle::State_None; - if (item->isEnabled()) - lvi.state |= TQStyle::State_Enabled; - if (item->isOpen()) - lvi.state |= TQStyle::State_Open; - if (item->isExpandable()) - lvi.features |= TQStyleOptionQ3ListViewItem::Expandable; - if (item->multiLinesEnabled()) - lvi.features |= TQStyleOptionQ3ListViewItem::MultiLine; - if (item->isVisible()) - lvi.features |= TQStyleOptionQ3ListViewItem::Visible; - if (item->parent() && item->parent()->rtti() == 1 - && static_cast<Q3CheckListItem *>(item->parent())->type() == Q3CheckListItem::Controller) - lvi.features |= TQStyleOptionQ3ListViewItem::ParentControl; - opt.items.append(lvi); - if (!firstItem) { - item = item->nextSibling(); - } else { - firstItem = false; - item = item->firstChild(); - } - } - return opt; - } - - KviTalListView::KviTalListView(TQWidget * pParent) - : Q3ListView(pParent) - { - connect(this,TQT_SIGNAL(selectionChanged(Q3ListViewItem *)),this,TQT_SLOT(redirect_selectionChanged(Q3ListViewItem *))); - connect(this,TQT_SIGNAL(currentChanged(Q3ListViewItem *)),this,TQT_SLOT(redirect_currentChanged(Q3ListViewItem *))); - connect(this,TQT_SIGNAL(clicked(Q3ListViewItem *)),this,TQT_SLOT(redirect_clicked(Q3ListViewItem *))); - connect(this,TQT_SIGNAL(clicked(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_clicked(Q3ListViewItem *,const TQPoint &,int))); - connect(this,TQT_SIGNAL(pressed(Q3ListViewItem *)),this,TQT_SLOT(redirect_pressed(Q3ListViewItem *))); - connect(this,TQT_SIGNAL(pressed(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_pressed(Q3ListViewItem *,const TQPoint &,int))); - connect(this,TQT_SIGNAL(doubleClicked(Q3ListViewItem *)),this,TQT_SLOT(redirect_doubleClicked(Q3ListViewItem *))); - connect(this,TQT_SIGNAL(doubleClicked(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_doubleClicked(Q3ListViewItem *,const TQPoint &,int))); - connect(this,TQT_SIGNAL(returnPressed(Q3ListViewItem *)),this,TQT_SLOT(redirect_returnPressed(Q3ListViewItem *))); - connect(this,TQT_SIGNAL(spacePressed(Q3ListViewItem *)),this,TQT_SLOT(redirect_spacePressed(Q3ListViewItem *))); - connect(this,TQT_SIGNAL(rightButtonClicked(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_rightButtonClicked(Q3ListViewItem *,const TQPoint &,int))); - connect(this,TQT_SIGNAL(rightButtonPressed(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_rightButtonPressed(Q3ListViewItem *,const TQPoint &,int))); - connect(this,TQT_SIGNAL(mouseButtonClicked(int,Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_mouseButtonClicked(int,Q3ListViewItem *,const TQPoint &,int))); - connect(this,TQT_SIGNAL(mouseButtonPressed(int,Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_mouseButtonPressed(int,Q3ListViewItem *,const TQPoint &,int))); - connect(this,TQT_SIGNAL(contextMenuRequested(Q3ListViewItem *,const TQPoint &,int)),this,TQT_SLOT(redirect_contextMenuRequested(Q3ListViewItem *,const TQPoint &,int))); - connect(this,TQT_SIGNAL(onItem(Q3ListViewItem *)),this,TQT_SLOT(redirect_onItem(Q3ListViewItem *))); - connect(this,TQT_SIGNAL(expanded(Q3ListViewItem *)),this,TQT_SLOT(redirect_expanded(Q3ListViewItem *))); - connect(this,TQT_SIGNAL(collapsed(Q3ListViewItem *)),this,TQT_SLOT(redirect_collapsed(Q3ListViewItem *))); - } - - void KviTalListView::redirect_selectionChanged(Q3ListViewItem * pItem) - { - emit selectionChanged((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_currentChanged(Q3ListViewItem * pItem) - { - emit currentChanged((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_clicked(Q3ListViewItem * pItem) - { - emit clicked((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_clicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) - { - emit clicked((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_pressed(Q3ListViewItem * pItem) - { - emit pressed((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_pressed(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) - { - emit pressed((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_doubleClicked(Q3ListViewItem * pItem) - { - emit doubleClicked((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_doubleClicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) - { - emit doubleClicked((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_returnPressed(Q3ListViewItem * pItem) - { - emit returnPressed((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_spacePressed(Q3ListViewItem * pItem) - { - emit spacePressed((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_rightButtonClicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) - { - emit rightButtonClicked((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_rightButtonPressed(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) - { - emit rightButtonPressed((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_mouseButtonClicked(int iButton,Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) - { - emit mouseButtonClicked(iButton,(KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_mouseButtonPressed(int iButton,Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) - { - emit mouseButtonPressed(iButton,(KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_contextMenuRequested(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn) - { - emit contextMenuRequested((KviTalListViewItem *)pItem,pnt,uColumn); - } - - void KviTalListView::redirect_onItem(Q3ListViewItem * pItem) - { - emit onItem((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_expanded(Q3ListViewItem * pItem) - { - emit expanded((KviTalListViewItem *)pItem); - } - - void KviTalListView::redirect_collapsed(Q3ListViewItem * pItem) - { - emit collapsed((KviTalListViewItem *)pItem); - } - - - struct KviTalCheckListItemPrivate - { - KviTalCheckListItemPrivate(): - exclusive(0), - currentState(KviTalCheckListItem::Off), - tristate(false) {} - - KviTalCheckListItem *exclusive; - KviTalCheckListItem::ToggleState currentState; - TQHash<KviTalCheckListItem *, KviTalCheckListItem::ToggleState> statesDict; - bool tristate; - }; - - KviTalCheckListItem::KviTalCheckListItem(KviTalCheckListItem *parent, const TQString &text, - Type tt) - : KviTalListViewItem(parent, text, TQString()) - { - myType = tt; - init(); - if (myType == RadioButton) { - if (parent->type() != RadioButtonController) - tqWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a controller"); - else - d->exclusive = parent; - } - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalCheckListItem *parent, KviTalListViewItem *after, - const TQString &text, Type tt) - : KviTalListViewItem(parent, after, text) - { - myType = tt; - init(); - if (myType == RadioButton) { - if (parent->type() != RadioButtonController) - tqWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a controller"); - else - d->exclusive = parent; - } - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *parent, const TQString &text, - Type tt) - : KviTalListViewItem(parent, text, TQString()) - { - myType = tt; - if (myType == RadioButton) { - tqWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem"); - } - init(); - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *parent, KviTalListViewItem *after, - const TQString &text, Type tt) - : KviTalListViewItem(parent, after, text) - { - myType = tt; - if (myType == RadioButton) { - tqWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem"); - } - init(); - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListView *parent, const TQString &text, - Type tt) - : KviTalListViewItem(parent, text) - { - myType = tt; - if (tt == RadioButton) - tqWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem"); - init(); - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListView *parent, KviTalListViewItem *after, - const TQString &text, Type tt) - : KviTalListViewItem(parent, after, text) - { - myType = tt; - if (tt == RadioButton) - tqWarning("KviTalCheckListItem::KviTalCheckListItem(), radio button must be " - "child of a KviTalCheckListItem"); - init(); - } - - int KviTalCheckListItem::rtti() const - { - return RTTI; - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListView *parent, const TQString &text, - const TQPixmap & p) - : KviTalListViewItem(parent, text) - { - myType = RadioButtonController; - setPixmap(0, p); - init(); - } - - KviTalCheckListItem::KviTalCheckListItem(KviTalListViewItem *parent, const TQString &text, - const TQPixmap & p) - : KviTalListViewItem(parent, text) - { - myType = RadioButtonController; - setPixmap(0, p); - init(); - } - - void KviTalCheckListItem::init() - { - d = new KviTalCheckListItemPrivate(); - on = false; // ### remove on ver 4 - // CheckBoxControllers by default have tristate set to true - if (myType == CheckBoxController) - setTristate(true); - } - - KviTalCheckListItem::~KviTalCheckListItem() - { - if (myType == RadioButton - && d->exclusive && d->exclusive->d - && d->exclusive->d->exclusive == this) - d->exclusive->turnOffChild(); - d->exclusive = 0; // so the children won't try to access us. - delete d; - d = 0; - } - - void KviTalCheckListItem::setTristate(bool b) - { - if ((myType != CheckBoxController) && (myType != CheckBox)) { - tqWarning("KviTalCheckListItem::setTristate(), has no effect on RadioButton " - "or RadioButtonController."); - return; - } - d->tristate = b; - } - - bool KviTalCheckListItem::isTristate() const - { - return d->tristate; - } - - KviTalCheckListItem::ToggleState KviTalCheckListItem::state() const - { - if (!isTristate() && internalState() == NoChange) - return Off; - else - return d->currentState; - } - - KviTalCheckListItem::ToggleState KviTalCheckListItem::internalState() const - { - return d->currentState; - } - - void KviTalCheckListItem::setState(ToggleState s) - { - if (myType == CheckBoxController && state() == NoChange) - updateStoredState(this); - setState(s, true, true); - } - - void KviTalCheckListItem::setState(ToggleState s, bool update, bool store) - { - - if (s == internalState()) - return; - - if (myType == CheckBox) { - setCurrentState(s); - stateChange(state()); - if (update && parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - ((KviTalCheckListItem*)parent())->updateController(update, store); - } else if (myType == CheckBoxController) { - if (s == NoChange && childCount()) { - restoreState(this); - } else { - KviTalListViewItem *item = firstChild(); - int childCount = 0; - while(item) { - if (item->rtti() == 1 && - (((KviTalCheckListItem*)item)->type() == CheckBox || - ((KviTalCheckListItem*)item)->type() == CheckBoxController)) { - KviTalCheckListItem *checkItem = (KviTalCheckListItem*)item; - checkItem->setState(s, false, false); - childCount++; - } - item = item->nextSibling(); - } - if (update) { - if (childCount > 0) { - ToggleState oldState = internalState(); - updateController(false, false); - if (oldState != internalState() && - parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - ((KviTalCheckListItem*)parent())->updateController(update, store); - - updateController(update, store); - } else { - // if there are no children we simply set the CheckBoxController and update its parent - setCurrentState(s); - stateChange(state()); - if (parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - ((KviTalCheckListItem*)parent())->updateController(update, store); - } - } else { - setCurrentState(s); - stateChange(state()); - } - - } - } else if (myType == RadioButton) { - if (s == On) { - if (d->exclusive && d->exclusive->d->exclusive != this) - d->exclusive->turnOffChild(); - setCurrentState(s); - if (d->exclusive) - d->exclusive->d->exclusive = this; - } else { - if (d->exclusive && d->exclusive->d->exclusive == this) - d->exclusive->d->exclusive = 0; - setCurrentState(Off); - } - stateChange(state()); - } - repaint(); - } - - void KviTalCheckListItem::setCurrentState(ToggleState s) - { - ToggleState old = d->currentState; - d->currentState = s; - if (d->currentState == On) - on = true; - else - on = false; - - //#ifndef TQT_NO_ACCESSIBILITY - // if (old != d->currentState && listView()) - // TQAccessible::updateAccessibility(listView()->viewport(), indexOfItem(this), TQAccessible::StateChanged); - //#else - // Q_UNUSED(old); - //#endif - } - - void KviTalCheckListItem::setStoredState(ToggleState newState, KviTalCheckListItem *key) - { - if (myType == CheckBox || myType == CheckBoxController) - d->statesDict[key] = newState; - } - - KviTalCheckListItem::ToggleState KviTalCheckListItem::storedState(KviTalCheckListItem *key) const - { - TQHash<KviTalCheckListItem *, KviTalCheckListItem::ToggleState>::Iterator it = d->statesDict.find(key); - if (it != d->statesDict.end()) - return it.value(); - else - return Off; - } - - void KviTalCheckListItem::turnOffChild() - { - if (myType == RadioButtonController && d->exclusive) - d->exclusive->setOn(false); - } - - void KviTalCheckListItem::activate() - { - KviTalListView * lv = listView(); - - if (lv && !lv->isEnabled() || !isEnabled()) - return; - - TQPoint pos; - int boxsize = lv->style()->pixelMetric(TQStyle::PM_CheckListButtonSize, 0, lv); - if (activatedPos(pos)) { - bool parentControl = false; - if (parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController) - parentControl = true; - - int x = parentControl ? 0 : 3; - int align = lv->columnAlignment(0); - int marg = lv->itemMargin(); - int y = 0; - - if (align & TQt::AlignVCenter) - y = ((height() - boxsize) / 2) + marg; - else - y = (lv->fontMetrics().height() + 2 + marg - boxsize) / 2; - - TQRect r(x, y, boxsize-3, boxsize-3); - // columns might have been swapped - r.moveBy(lv->header()->sectionPos(0), 0); - if (!r.contains(pos)) - return; - } - if ((myType == CheckBox) || (myType == CheckBoxController)) { - //lv->d->startEdit = FALSE; - switch (internalState()) { - case On: - setState(Off); - break; - case Off: - if (!isTristate() && myType == CheckBox) { - setState(On); - } else { - setState(NoChange); - if (myType == CheckBoxController && internalState() != NoChange) - setState(On); - } - break; - case NoChange: - setState(On); - break; - } - ignoreDoubleClick(); - } else if (myType == RadioButton) { - setOn(true); - ignoreDoubleClick(); - } - } - - void KviTalCheckListItem::setOn(bool b ) - { - if (b) - setState(On , true, true); - else - setState(Off , true, true); - } - - void KviTalCheckListItem::stateChange(bool) - { - } - - void KviTalCheckListItem::stateChange(ToggleState s) - { - stateChange(s == On); - } - - void KviTalCheckListItem::restoreState(KviTalCheckListItem *key, int depth) - { - switch (type()) { - case CheckBox: - setCurrentState(storedState(key)); - stateChange(state()); - repaint(); - break; - case CheckBoxController: { - KviTalListViewItem *item = firstChild(); - int childCount = 0; - while (item) { - // recursively calling restoreState for children of type CheckBox and CheckBoxController - if (item->rtti() == 1 && - (((KviTalCheckListItem*)item)->type() == CheckBox || - ((KviTalCheckListItem*)item)->type() == CheckBoxController)) { - ((KviTalCheckListItem*)item)->restoreState(key , depth+1); - childCount++; - } - item = item->nextSibling(); - } - if (childCount > 0) { - if (depth == 0) - updateController(true); - else - updateController(false); - } else { - // if there are no children we retrieve the CheckBoxController state directly. - setState(storedState(key), true, false); - } - } - break; - default: - break; - } - } - - void KviTalCheckListItem::updateController(bool update , bool store) - { - if (myType != CheckBoxController) - return; - - KviTalCheckListItem *controller = 0; - // checks if this CheckBoxController has another CheckBoxController as parent - if (parent() && parent()->rtti() == 1 - && ((KviTalCheckListItem*)parent())->type() == CheckBoxController) - controller = (KviTalCheckListItem*)parent(); - - ToggleState theState = Off; - bool first = true; - KviTalListViewItem *item = firstChild(); - while(item && theState != NoChange) { - if (item->rtti() == 1 && - (((KviTalCheckListItem*)item)->type() == CheckBox || - ((KviTalCheckListItem*)item)->type() == CheckBoxController)) { - KviTalCheckListItem *checkItem = (KviTalCheckListItem*)item; - if (first) { - theState = checkItem->internalState(); - first = false; - } else { - if (checkItem->internalState() == NoChange || - theState != checkItem->internalState()) - theState = NoChange; - else - theState = checkItem->internalState(); - } - } - item = item->nextSibling(); - } - if (internalState() != theState) { - setCurrentState(theState); - if (store && (internalState() == On || internalState() == Off)) - updateStoredState(this); - stateChange(state()); - if (update && controller) { - controller->updateController(update, store); - } - repaint(); - } - } - - void KviTalCheckListItem::updateStoredState(KviTalCheckListItem *key) - { - if (myType != CheckBoxController) - return; - - KviTalListViewItem *item = firstChild(); - while(item) { - if (item->rtti() == 1) { - KviTalCheckListItem *checkItem = (KviTalCheckListItem*)item; - if (checkItem->type() == CheckBox) - checkItem->setStoredState(checkItem->internalState(), key); - else if (checkItem->type() == CheckBoxController) - checkItem->updateStoredState(key); - } - item = item->nextSibling(); - } - // this state is only needed if the CheckBoxController has no CheckBox / CheckBoxController children. - setStoredState(internalState() , key); - } - - void KviTalCheckListItem::setup() - { - KviTalListViewItem::setup(); - int h = height(); - KviTalListView *lv = listView(); - if (lv) - h = qMax(lv->style()->pixelMetric(TQStyle::PM_CheckListButtonSize, 0, lv), - h); - h = qMax(h, TQApplication::globalStrut().height()); - setHeight(h); - } - - int KviTalCheckListItem::width(const TQFontMetrics& fm, const KviTalListView* lv, int column) const - { - int r = KviTalListViewItem::width(fm, lv, column); - if (column == 0) { - r += lv->itemMargin(); - if (myType == RadioButtonController && pixmap(0)) { - // r += 0; - } else { - r += lv->style()->pixelMetric(TQStyle::PM_CheckListButtonSize, 0, lv) + 4; - } - } - return qMax(r, TQApplication::globalStrut().width()); - } - - void KviTalCheckListItem::paintCell(TQPainter * p, const TQColorGroup & cg, - int column, int width, int align) - { - if (!p) - return; - - KviTalListView *lv = listView(); - if (!lv) - return; - - const TQPalette::ColorRole crole = lv->foregroundRole(); - if (cg.brush(crole) != lv->palette().brush(crole)) - p->fillRect(0, 0, width, height(), cg.brush(crole)); - else - lv->paintEmptyArea(p, TQRect(0, 0, width, height())); - - if (column != 0) { - // The rest is text, or for subclasses to change. - KviTalListViewItem::paintCell(p, cg, column, width, align); - return; - } - - bool parentControl = false; - if (parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController) - parentControl = true; - - TQFontMetrics fm(lv->fontMetrics()); - int boxsize = lv->style()->pixelMetric(myType == RadioButtonController ? TQStyle::PM_CheckListControllerSize : - TQStyle::PM_CheckListButtonSize, 0, lv); - int marg = lv->itemMargin(); - int r = marg; - - // Draw controller / checkbox / radiobutton --------------------- - TQStyle::State styleflags = TQStyle::State_None; - if (internalState() == On) { - styleflags |= TQStyle::State_On; - } else if (internalState() == NoChange) { - if (myType == CheckBoxController && !isTristate()) - styleflags |= TQStyle::State_Off; - else - styleflags |= TQStyle::State_NoChange; - } else { - styleflags |= TQStyle::State_Off; - } - if (isSelected()) - styleflags |= TQStyle::State_Selected; - if (isEnabled() && lv->isEnabled()) - styleflags |= TQStyle::State_Enabled; - if (lv->window()->isActiveWindow()) - styleflags |= TQStyle::State_Active; - - if (myType == RadioButtonController) { - int x = 0; - if(!parentControl) - x += 3; - if (!pixmap(0)) { - TQStyleOptionQ3ListView opt = getStyleOption(lv, this); - opt.rect.setRect(x, 0, boxsize, fm.height() + 2 + marg); - opt.palette = cg; - opt.state = styleflags; - lv->style()->drawPrimitive(TQStyle::PE_Q3CheckListController, &opt, p, lv); - r += boxsize + 4; - } - } else { - Q_ASSERT(lv); //### - int x = 0; - int y = 0; - if (!parentControl) - x += 3; - if (align & TQt::AlignVCenter) - y = ((height() - boxsize) / 2) + marg; - else - y = (fm.height() + 2 + marg - boxsize) / 2; - - TQStyleOptionQ3ListView opt = getStyleOption(lv, this); - opt.rect.setRect(x, y, boxsize, fm.height() + 2 + marg); - opt.palette = cg; - opt.state = styleflags; - lv->style()->drawPrimitive((myType == CheckBox || myType == CheckBoxController) - ? TQStyle::PE_Q3CheckListIndicator - : TQStyle::PE_Q3CheckListExclusiveIndicator, &opt, p, lv); - r += boxsize + 4; - } - - // Draw text ---------------------------------------------------- - p->translate(r, 0); - p->setPen(TQPen(cg.text())); - KviTalListViewItem::paintCell(p, cg, column, width - r, align); - } - - void KviTalCheckListItem::paintFocus(TQPainter *p, const TQColorGroup & cg, - const TQRect & r) - { - bool intersect = true; - KviTalListView *lv = listView(); - if (lv && lv->header()->mapToActual(0) != 0) { - int xdepth = lv->treeStepSize() * (depth() + (lv->rootIsDecorated() ? 1 : 0)) + lv->itemMargin(); - int p = lv->header()->cellPos(lv->header()->mapToActual(0)); - xdepth += p; - intersect = r.intersects(TQRect(p, r.y(), xdepth - p + 1, r.height())); - } - bool parentControl = false; - if (parent() && parent()->rtti() == 1 && - ((KviTalCheckListItem*) parent())->type() == RadioButtonController) - parentControl = true; - if (myType != RadioButtonController && intersect && - (lv->rootIsDecorated() || myType == RadioButton || - (myType == CheckBox && parentControl))) { - TQRect rect; - int boxsize = lv->style()->pixelMetric(TQStyle::PM_CheckListButtonSize, 0, lv); - if (lv->columnAlignment(0) == TQt::AlignCenter) { - TQFontMetrics fm(lv->font()); - int bx = (lv->columnWidth(0) - (boxsize + fm.width(text())))/2 + boxsize; - if (bx < 0) bx = 0; - rect.setRect(r.x() + bx + 5, r.y(), r.width() - bx - 5, - r.height()); - } else - rect.setRect(r.x() + boxsize + 5, r.y(), r.width() - boxsize - 5, - r.height()); - KviTalListViewItem::paintFocus(p, cg, rect); - } else { - KviTalListViewItem::paintFocus(p, cg, r); - } - } - - - #include "kvi_tal_listview_qt4.moc" -#else #include <tqpainter.h> #include <tqstyle.h> #include <tqheader.h> @@ -1536,7 +763,6 @@ } #include "kvi_tal_listview_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_listview.h b/src/kvilib/tal/kvi_tal_listview.h index 9e1b46fa..b343507f 100644 --- a/src/kvilib/tal/kvi_tal_listview.h +++ b/src/kvilib/tal/kvi_tal_listview.h @@ -26,26 +26,8 @@ //============================================================================= -// -// This is the only reasonable CROSS-QT3-QT4-COMPATIBLE implementation -// of TQListView I've been able to find. -// Note that using macros for the items will NOT work since moc -// doesn't expand them. Note also that KviTalCheckListItem must -// be fully reimplemented and not be inherited from TQCheckListItem -// to build up a consistent item object hierarchy. To complete -// the obscenity, we need TWO COMPLETE implementations: one for TQt3 -// and one for TQt4... bleah :D -// -// The code for KviTalCheckListItem is adapted from qlistview.h/cpp -// present in qt 3.3.6 AND in qt 4.1.2. -// - #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_listview_qt4.h" -#else - #include "kvi_tal_listview_qt3.h" -#endif +#include "kvi_tal_listview_qt3.h" #endif // _KVI_TAL_LISTVIEW_H_ diff --git a/src/kvilib/tal/kvi_tal_listview_qt4.h b/src/kvilib/tal/kvi_tal_listview_qt4.h deleted file mode 100644 index 3f0caf00..00000000 --- a/src/kvilib/tal/kvi_tal_listview_qt4.h +++ /dev/null @@ -1,200 +0,0 @@ -#ifndef _KVI_TAL_LISTVIEW_QT4_H_ -#define _KVI_TAL_LISTVIEW_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_listview_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include "kvi_qstring.h" - -#include <tq3listview.h> - -class KviTalListViewItem; - - -class KVILIB_API KviTalListView : public Q3ListView -{ - friend class KviTalCheckListItem; - TQ_OBJECT - -public: - KviTalListView(TQWidget * pParent); - virtual ~KviTalListView() {}; -public: - // Shadow the internal TQt methods - KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)Q3ListView::firstChild(); }; - KviTalListViewItem * lastItem() const { return (KviTalListViewItem *)Q3ListView::lastItem(); }; - KviTalListViewItem * selectedItem() const { return (KviTalListViewItem *)Q3ListView::selectedItem(); }; - KviTalListViewItem * currentItem() const { return (KviTalListViewItem *)Q3ListView::currentItem(); }; - KviTalListViewItem * itemAt(const TQPoint &pnt) const { return (KviTalListViewItem *)Q3ListView::itemAt(pnt); }; -signals: - void selectionChanged(KviTalListViewItem * pItem); - void currentChanged(KviTalListViewItem * pItem); - void clicked(KviTalListViewItem * pItem); - void clicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); - void pressed(KviTalListViewItem * pItem); - void pressed(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); - void doubleClicked(KviTalListViewItem * pItem); - void doubleClicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); - void returnPressed(KviTalListViewItem * pItem); - void spacePressed(KviTalListViewItem * pItem); - void rightButtonClicked(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); - void rightButtonPressed(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); - void mouseButtonClicked(int iButton,KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); - void mouseButtonPressed(int iButton,KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); - void contextMenuRequested(KviTalListViewItem * pItem,const TQPoint &pnt,int uColumn); - void onItem(KviTalListViewItem * pItem); - void expanded(KviTalListViewItem * pItem); - void collapsed(KviTalListViewItem * pItem); -protected slots: - void redirect_selectionChanged(Q3ListViewItem * pItem); - void redirect_currentChanged(Q3ListViewItem * pItem); - void redirect_clicked(Q3ListViewItem * pItem); - void redirect_clicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); - void redirect_pressed(Q3ListViewItem * pItem); - void redirect_pressed(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); - void redirect_doubleClicked(Q3ListViewItem * pItem); - void redirect_doubleClicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); - void redirect_returnPressed(Q3ListViewItem * pItem); - void redirect_spacePressed(Q3ListViewItem * pItem); - void redirect_rightButtonClicked(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); - void redirect_rightButtonPressed(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); - void redirect_mouseButtonClicked(int iButton,Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); - void redirect_mouseButtonPressed(int iButton,Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); - void redirect_contextMenuRequested(Q3ListViewItem * pItem,const TQPoint &pnt,int uColumn); - void redirect_onItem(Q3ListViewItem * pItem); - void redirect_expanded(Q3ListViewItem * pItem); - void redirect_collapsed(Q3ListViewItem * pItem); - -}; - - -class KVILIB_API KviTalListViewItem : public Q3ListViewItem -{ -public: - KviTalListViewItem(KviTalListView * pParent) - : Q3ListViewItem(pParent) {}; - KviTalListViewItem(KviTalListViewItem * pParent) - : Q3ListViewItem(pParent) {}; - KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter) - : Q3ListViewItem(pParent,pAfter) {}; - KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter) - : Q3ListViewItem(pParent,pAfter) {}; - KviTalListViewItem(KviTalListView * pParent,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty,const TQString &szLabel5 = KviTQString::empty) - : Q3ListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; - KviTalListViewItem(KviTalListView * pParent,KviTalListViewItem * pAfter,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty,const TQString &szLabel5 = KviTQString::empty) - : Q3ListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4,szLabel5) {}; - KviTalListViewItem(KviTalListViewItem * pParent,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty) - : Q3ListViewItem(pParent,szLabel1,szLabel2,szLabel3,szLabel4) {}; - KviTalListViewItem(KviTalListViewItem * pParent,KviTalListViewItem * pAfter,const TQString &szLabel1,const TQString &szLabel2 = KviTQString::empty,const TQString &szLabel3 = KviTQString::empty,const TQString &szLabel4 = KviTQString::empty) - : Q3ListViewItem(pParent,pAfter,szLabel1,szLabel2,szLabel3,szLabel4) {}; -public: - // Shadow the internal TQt methods - KviTalListViewItem * firstChild() const { return (KviTalListViewItem *)Q3ListViewItem::firstChild(); }; - KviTalListViewItem * nextSibling() const { return (KviTalListViewItem *)Q3ListViewItem::nextSibling(); }; - KviTalListViewItem * parent() const { return (KviTalListViewItem *)Q3ListViewItem::parent(); }; - KviTalListView * listView() const { return (KviTalListView *)Q3ListViewItem::listView(); }; - KviTalListViewItem * itemAbove() { return (KviTalListViewItem *)Q3ListViewItem::itemAbove(); }; - KviTalListViewItem * itemBelow() { return (KviTalListViewItem *)Q3ListViewItem::itemBelow(); }; -}; - -struct KviTalCheckListItemPrivate; - -class KVILIB_API KviTalCheckListItem : public KviTalListViewItem -{ -public: - enum Type { RadioButton, - CheckBox, - Controller, - RadioButtonController=Controller, - CheckBoxController }; - - enum ToggleState { Off, NoChange, On }; - - KviTalCheckListItem(KviTalCheckListItem *parent, const TQString &text, - Type = RadioButtonController); - KviTalCheckListItem(KviTalCheckListItem *parent, KviTalListViewItem *after, - const TQString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListViewItem *parent, const TQString &text, - Type = RadioButtonController); - KviTalCheckListItem(KviTalListViewItem *parent, KviTalListViewItem *after, - const TQString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListView *parent, const TQString &text, - Type = RadioButtonController); - KviTalCheckListItem(KviTalListView *parent, KviTalListViewItem *after, - const TQString &text, Type = RadioButtonController); - KviTalCheckListItem(KviTalListViewItem *parent, const TQString &text, - const TQPixmap &); - KviTalCheckListItem(KviTalListView *parent, const TQString &text, - const TQPixmap &); - ~KviTalCheckListItem(); - - void paintCell(TQPainter *, const TQColorGroup & cg, - int column, int width, int alignment); - virtual void paintFocus(TQPainter *, const TQColorGroup &cg, - const TQRect & r); - int width(const TQFontMetrics&, const KviTalListView*, int column) const; - void setup(); - - virtual void setOn(bool); - bool isOn() const { return on; } - Type type() const { return myType; } - TQString text() const { return KviTalListViewItem::text(0); } - TQString text(int n) const { return KviTalListViewItem::text(n); } - - void setTristate(bool); - bool isTristate() const; - ToggleState state() const; - void setState(ToggleState s); - - int rtti() const; - enum { RTTI = 1 }; - -protected: - void activate(); - void turnOffChild(); - virtual void stateChange(bool); - -private: - void init(); - ToggleState internalState() const; - void setStoredState(ToggleState newState, KviTalCheckListItem *key); - ToggleState storedState(KviTalCheckListItem *key) const; - void stateChange(ToggleState s); - void restoreState(KviTalCheckListItem *key, int depth = 0); - void updateController(bool update = true , bool store = false); - void updateStoredState(KviTalCheckListItem *key); - void setState(ToggleState s, bool update, bool store); - void setCurrentState(ToggleState s); - - Type myType; - bool on; - KviTalCheckListItemPrivate *d; -}; - -#define KviTalListViewItemIterator Q3ListViewItemIterator - - -#endif // _KVI_TAL_LISTVIEW_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_mainwindow.cpp b/src/kvilib/tal/kvi_tal_mainwindow.cpp index 0a83e90e..5ba6e653 100644 --- a/src/kvilib/tal/kvi_tal_mainwindow.cpp +++ b/src/kvilib/tal/kvi_tal_mainwindow.cpp @@ -36,30 +36,11 @@ #else - #ifdef COMPILE_USE_QT4 - KviTalMainWindow::KviTalMainWindow(TQWidget * par,const char * nam) - : TQMainWindow(par,nam) - { - } - - bool KviTalMainWindow::usesBigPixmaps() - { - return (iconSize().width() > 40); - } - - void KviTalMainWindow::setUsesBigPixmaps(bool b) - { - if(b)setIconSize(TQSize(48,48)); - else setIconSize(TQSize(24,24)); - } - #include "kvi_tal_mainwindow_qt4.moc" - #else KviTalMainWindow::KviTalMainWindow(TQWidget * par,const char * nam) : TQMainWindow(par,nam) { } #include "kvi_tal_mainwindow_qt3.moc" - #endif #endif diff --git a/src/kvilib/tal/kvi_tal_mainwindow.h b/src/kvilib/tal/kvi_tal_mainwindow.h index 904e18e3..d32705d7 100644 --- a/src/kvilib/tal/kvi_tal_mainwindow.h +++ b/src/kvilib/tal/kvi_tal_mainwindow.h @@ -28,11 +28,7 @@ #ifdef COMPILE_TDE_SUPPORT #include "kvi_tal_mainwindow_kde.h" #else - #ifdef COMPILE_USE_QT4 - #include "kvi_tal_mainwindow_qt4.h" - #else #include "kvi_tal_mainwindow_qt3.h" - #endif #endif #endif // _KVI_TAL_MAINWINDOW_H_ diff --git a/src/kvilib/tal/kvi_tal_mainwindow_qt4.h b/src/kvilib/tal/kvi_tal_mainwindow_qt4.h deleted file mode 100644 index 76450240..00000000 --- a/src/kvilib/tal/kvi_tal_mainwindow_qt4.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef _KVI_TAL_MAINWINDOW_TQT_H_ -#define _KVI_TAL_MAINWINDOW_TQT_H_ - -// -// File : kvi_tal_mainwindow_qt.h -// Creation date : Sun Aug 12 2001 04:43:58 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// - -#include <tqmainwindow.h> - -class KVILIB_API KviTalMainWindow : public TQMainWindow -{ - TQ_OBJECT - -public: - KviTalMainWindow(TQWidget * par,const char * nam); - ~KviTalMainWindow(); -public: - bool usesBigPixmaps(); - void setUsesBigPixmaps(bool b); -}; - -#endif // _KVI_TAL_MAINWINDOW_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_menubar.cpp b/src/kvilib/tal/kvi_tal_menubar.cpp index e0dcd2df..1ccc17e9 100644 --- a/src/kvilib/tal/kvi_tal_menubar.cpp +++ b/src/kvilib/tal/kvi_tal_menubar.cpp @@ -41,11 +41,7 @@ #else KviTalMenuBar::KviTalMenuBar(TQWidget * par,const char * nam) -#ifdef COMPILE_USE_QT4 - : TQMenuBar(par) -#else : TQMenuBar(par,nam) -#endif { } diff --git a/src/kvilib/tal/kvi_tal_popupmenu.cpp b/src/kvilib/tal/kvi_tal_popupmenu.cpp index ad3c8463..2033453c 100644 --- a/src/kvilib/tal/kvi_tal_popupmenu.cpp +++ b/src/kvilib/tal/kvi_tal_popupmenu.cpp @@ -25,9 +25,5 @@ #define __KVILIB__ #include "kvi_tal_popupmenu.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_popupmenu_qt4.moc" -#else #include "kvi_tal_popupmenu_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_popupmenu.h b/src/kvilib/tal/kvi_tal_popupmenu.h index 5035f031..e5dd9a8c 100644 --- a/src/kvilib/tal/kvi_tal_popupmenu.h +++ b/src/kvilib/tal/kvi_tal_popupmenu.h @@ -27,10 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_popupmenu_qt4.h" -#else #include "kvi_tal_popupmenu_qt3.h" -#endif #endif // _KVI_TAL_POPUPMENU_H_ diff --git a/src/kvilib/tal/kvi_tal_popupmenu_qt4.h b/src/kvilib/tal/kvi_tal_popupmenu_qt4.h deleted file mode 100644 index b8db526d..00000000 --- a/src/kvilib/tal/kvi_tal_popupmenu_qt4.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef _KVI_TAL_POPUPMENU_QT4_H_ -#define _KVI_TAL_POPUPMENU_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_popupmenu_qt3.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include "kvi_settings.h" -#include "kvi_qstring.h" - -#include <tq3popupmenu.h> -#include <tqwidgetaction.h> - -class KVILIB_API KviTalPopupMenu : public Q3PopupMenu -{ - TQ_OBJECT - -public: - KviTalPopupMenu(TQWidget * pParent=0,const TQString &szName = KviTQString::empty) - : Q3PopupMenu(pParent) - { - setName(szName); - }; - virtual ~KviTalPopupMenu() {}; - - int insertItem(const TQString &szText) - { - return Q3PopupMenu::insertItem(szText); - } - int insertItem(const TQPixmap &pix,const TQString &szText) - { - return Q3PopupMenu::insertItem(TQIcon(pix),szText,-1,-1); - } - int insertItem(const TQString &szText,int id) - { - return Q3PopupMenu::insertItem(szText,id); - } - int insertItem(const TQPixmap &pix,const TQString &szText,int id) - { - return Q3PopupMenu::insertItem(TQIcon(pix),szText,id,-1); - } - int insertItem(const TQString &szText,const TQObject * pReceiver,const char * szSlot) - { - return Q3PopupMenu::insertItem(szText,pReceiver,szSlot); - } - int insertItem(const TQPixmap &pix,const TQString &szText,const TQObject * pReceiver,const char * szSlot) - { - return Q3PopupMenu::insertItem(TQIcon(pix),szText,pReceiver,szSlot); - } - int insertItem(const TQPixmap &pix,const TQString &szText,TQMenu *pMenu) - { - return Q3PopupMenu::insertItem(TQIcon(pix),szText,pMenu,-1,-1); - } - int insertItem(const TQString &szText,TQMenu *pMenu) - { - return Q3PopupMenu::insertItem(szText,pMenu,-1,-1); - } - int insertItem(TQWidget * pWidget) - { - // needs TQt 4.2 - TQWidgetAction * pAct = new TQWidgetAction(this); - pAct->setDefaultWidget(pWidget); - addAction(pAct); - return 0; - } - - -}; - -#endif // _KVI_TAL_POPUPMENU_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_scrollview.cpp b/src/kvilib/tal/kvi_tal_scrollview.cpp index 7e3e5eba..8cd3810c 100644 --- a/src/kvilib/tal/kvi_tal_scrollview.cpp +++ b/src/kvilib/tal/kvi_tal_scrollview.cpp @@ -25,9 +25,5 @@ #define __KVILIB__ #include "kvi_tal_scrollview.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_scrollview_qt4.moc" -#else #include "kvi_tal_scrollview_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_scrollview.h b/src/kvilib/tal/kvi_tal_scrollview.h index ff27acf4..ce9fcf77 100644 --- a/src/kvilib/tal/kvi_tal_scrollview.h +++ b/src/kvilib/tal/kvi_tal_scrollview.h @@ -27,10 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_scrollview_qt4.h" -#else #include "kvi_tal_scrollview_qt3.h" -#endif #endif // _KVI_TAL_SCROLLVIEW_H_ diff --git a/src/kvilib/tal/kvi_tal_scrollview_qt4.h b/src/kvilib/tal/kvi_tal_scrollview_qt4.h deleted file mode 100644 index 26c22f45..00000000 --- a/src/kvilib/tal/kvi_tal_scrollview_qt4.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef _KVI_TAL_SCROLLVIEW_QT4_H_ -#define _KVI_TAL_SCROLLVIEW_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_scrollview_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include <tq3scrollview.h> - -class KVILIB_API KviTalScrollView : public Q3ScrollView -{ - TQ_OBJECT - -public: - KviTalScrollView(TQWidget * pParent) - : Q3ScrollView(pParent) {}; - virtual ~KviTalScrollView() {}; -}; - -#endif // _KVI_TAL_SCROLLVIEW_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_tabdialog.cpp b/src/kvilib/tal/kvi_tal_tabdialog.cpp index 81bd5b39..3e76dd30 100644 --- a/src/kvilib/tal/kvi_tal_tabdialog.cpp +++ b/src/kvilib/tal/kvi_tal_tabdialog.cpp @@ -26,9 +26,5 @@ #include "kvi_tal_tabdialog.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_tabdialog_qt4.moc" -#else #include "kvi_tal_tabdialog_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_tabdialog.h b/src/kvilib/tal/kvi_tal_tabdialog.h index 46e09843..1eb12dfe 100644 --- a/src/kvilib/tal/kvi_tal_tabdialog.h +++ b/src/kvilib/tal/kvi_tal_tabdialog.h @@ -27,10 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_tabdialog_qt4.h" -#else #include "kvi_tal_tabdialog_qt3.h" -#endif #endif // _KVI_TAL_TABDIALOG_H_ diff --git a/src/kvilib/tal/kvi_tal_tabdialog_qt4.h b/src/kvilib/tal/kvi_tal_tabdialog_qt4.h deleted file mode 100644 index 43c67c3e..00000000 --- a/src/kvilib/tal/kvi_tal_tabdialog_qt4.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef _KVI_TAL_TABDIALOG_QT4_H_ -#define _KVI_TAL_TABDIALOG_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_tabdialog_qt4.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include <tq3tabdialog.h> - -class KVILIB_API KviTalTabDialog : public Q3TabDialog -{ - TQ_OBJECT - -public: - KviTalTabDialog(TQWidget * pParent = 0,const char * name = 0,bool bModal = false) - : Q3TabDialog(pParent,name,bModal) {}; - ~KviTalTabDialog() {}; -}; - -#endif // _KVI_TAL_TABDIALOG_QT3_H_ diff --git a/src/kvilib/tal/kvi_tal_textedit.cpp b/src/kvilib/tal/kvi_tal_textedit.cpp index 686c8cba..e40c81b3 100644 --- a/src/kvilib/tal/kvi_tal_textedit.cpp +++ b/src/kvilib/tal/kvi_tal_textedit.cpp @@ -26,9 +26,5 @@ #include "kvi_tal_textedit.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_textedit_qt4.moc" -#else #include "kvi_tal_textedit_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_textedit.h b/src/kvilib/tal/kvi_tal_textedit.h index fb7381ae..05986836 100644 --- a/src/kvilib/tal/kvi_tal_textedit.h +++ b/src/kvilib/tal/kvi_tal_textedit.h @@ -27,10 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_textedit_qt4.h" -#else #include "kvi_tal_textedit_qt3.h" -#endif #endif // _KVI_TAL_TEXTEDIT_H_ diff --git a/src/kvilib/tal/kvi_tal_textedit_qt4.h b/src/kvilib/tal/kvi_tal_textedit_qt4.h deleted file mode 100644 index ec920392..00000000 --- a/src/kvilib/tal/kvi_tal_textedit_qt4.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef _KVI_TAL_TEXTEDIT_QT4_H_ -#define _KVI_TAL_TEXTEDIT_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_textedit_qt4.h -// Creation date : Tue Feb 06 2007 14:35:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include <tq3textedit.h> - -class KVILIB_API KviTalTextEdit : public Q3TextEdit -{ - TQ_OBJECT - -public: - KviTalTextEdit(TQWidget * pParent = 0,const char * name = 0) - : Q3TextEdit(pParent,name) {}; - ~KviTalTextEdit() {}; -}; - -#endif // _KVI_TAL_TEXTEDIT_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_toolbar.cpp b/src/kvilib/tal/kvi_tal_toolbar.cpp index 393b15d6..914825fe 100644 --- a/src/kvilib/tal/kvi_tal_toolbar.cpp +++ b/src/kvilib/tal/kvi_tal_toolbar.cpp @@ -41,52 +41,6 @@ #else - #ifdef COMPILE_USE_QT4 - - KviTalToolBar::KviTalToolBar(const TQString &label,TQMainWindow *w,TQT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) - //: Q3ToolBar(label,w,dock,bNewLine,nam) - : TQToolBar(label,w) - { - //setFrameStyle(TQFrame::NoFrame); - setObjectName(nam); - if(!layout()) - this->setLayout(new TQBoxLayout(TQBoxLayout::LeftToRight)); - w->addToolBar(dock,this); - } - KviTalToolBar::KviTalToolBar(TQMainWindow *w,const char * name) - : TQToolBar(w) - { - //setFrameStyle(TQFrame::NoFrame); - setObjectName(name); - if(!layout()) - this->setLayout(new TQBoxLayout(TQBoxLayout::LeftToRight)); - w->addToolBar(this); - } - - TQBoxLayout * KviTalToolBar::boxLayout() - { - return (TQBoxLayout*)this->layout(); - } - - void KviTalToolBar::setBoxLayout(TQBoxLayout * l) - { - this->setLayout(l); - } - - bool KviTalToolBar::usesBigPixmaps() - { - return (iconSize().width() > 40); - } - - void KviTalToolBar::setUsesBigPixmaps(bool b) - { - if(b)setIconSize(TQSize(48,48)); - else setIconSize(TQSize(22,22)); - } - - #include "kvi_tal_toolbar_qt4.moc" - - #else KviTalToolBar::KviTalToolBar(const TQString &label,TQMainWindow *w,TQT_TOOLBARDOCK_TYPE dock,bool bNewLine,const char * nam) : TQToolBar(label,w,dock,bNewLine,nam) { @@ -97,7 +51,6 @@ } #include "kvi_tal_toolbar_qt3.moc" - #endif KviTalToolBar::~KviTalToolBar() { diff --git a/src/kvilib/tal/kvi_tal_toolbar.h b/src/kvilib/tal/kvi_tal_toolbar.h index f9da5eff..c17b21ca 100644 --- a/src/kvilib/tal/kvi_tal_toolbar.h +++ b/src/kvilib/tal/kvi_tal_toolbar.h @@ -27,11 +27,7 @@ #ifdef COMPILE_TDE_SUPPORT #include "kvi_tal_toolbar_kde.h" #else - #ifdef COMPILE_USE_QT4 - #include "kvi_tal_toolbar_qt4.h" - #else #include "kvi_tal_toolbar_qt3.h" - #endif #endif #endif //_KVI_TAL_TOOLBAR_H_ diff --git a/src/kvilib/tal/kvi_tal_toolbar_qt4.h b/src/kvilib/tal/kvi_tal_toolbar_qt4.h deleted file mode 100644 index b670c42c..00000000 --- a/src/kvilib/tal/kvi_tal_toolbar_qt4.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _KVI_TAL_TOOLBAR_QT4_H_ -#define _KVI_TAL_TOOLBAR_QT4_H_ -// -// File : kvi_tal_toolbar_qt4.h -// Creation date : Wed Feb 1 2007 04:11:11 2001 GMT by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// - -#include "kvi_settings.h" -#include "kvi_tal_toolbardocktype.h" - -#include <TQToolBar> -#include <TQMainWindow> -#include <TQBoxLayout> - - -class KVILIB_API KviTalToolBar : public TQToolBar -{ - TQ_OBJECT - -public: - KviTalToolBar(const TQString &label,TQMainWindow *w,TQT_TOOLBARDOCK_TYPE dock = TQT_DOCK_TOP,bool bNewLine = false,const char * nam = 0); - KviTalToolBar(TQMainWindow *w,const char * name=0); - ~KviTalToolBar(); -public: - TQBoxLayout * boxLayout(); - void setBoxLayout(TQBoxLayout *l); - bool usesBigPixmaps(); - void setUsesBigPixmaps(bool b); -}; - -#endif //_KVI_TAL_TOOLBAR_TQT_H_ diff --git a/src/kvilib/tal/kvi_tal_toolbardocktype.h b/src/kvilib/tal/kvi_tal_toolbardocktype.h index 0295f7d4..b4e5f4df 100644 --- a/src/kvilib/tal/kvi_tal_toolbardocktype.h +++ b/src/kvilib/tal/kvi_tal_toolbardocktype.h @@ -23,38 +23,14 @@ // #include "kvi_settings.h" -//#define COMPILE_USE_QT4 -#ifdef COMPILE_USE_QT4 -/* - #define TQT_TOOLBARDOCK_TYPE TQt::Dock - #define TQT_DOCK_TOP TQt::DockTop - #define TQT_DOCK_LEFT TQt::DockLeft - #define TQT_DOCK_RIGHT TQt::DockRight - #define TQT_DOCK_BOTTOM TQt::DockBottom - #define TQT_DOCK_MINIMIZED TQt::DockMinimized - #define TQT_DOCK_TORNOFF TQt::DockTornOff - #define TQT_DOCK_UNMANAGED TQt::DockUnmanaged -*/ - // We will need these when we'll use the real TQToolBar in TQt 4.x - #define TQT_TOOLBARDOCK_TYPE TQt::ToolBarArea - #define TQT_DOCK_TOP TQt::TopToolBarArea - #define TQT_DOCK_LEFT TQt::LeftToolBarArea - #define TQT_DOCK_RIGHT TQt::RightToolBarArea - #define TQT_DOCK_BOTTOM TQt::BottomToolBarArea - // THESE ARE UNSUPPORTED UNDER QT4! - #define TQT_DOCK_MINIMIZED TQt::TopToolBarArea - #define TQT_DOCK_TORNOFF TQt::TopToolBarArea - #define TQT_DOCK_UNMANAGED TQt::TopToolBarArea -#else - #define TQT_TOOLBARDOCK_TYPE TQt::Dock - #define TQT_DOCK_TOP TQt::DockTop - #define TQT_DOCK_LEFT TQt::DockLeft - #define TQT_DOCK_RIGHT TQt::DockRight - #define TQT_DOCK_BOTTOM TQt::DockBottom - #define TQT_DOCK_MINIMIZED TQt::DockMinimized - #define TQT_DOCK_TORNOFF TQt::DockTornOff - #define TQT_DOCK_UNMANAGED TQt::DockUnmanaged -#endif +#define TQT_TOOLBARDOCK_TYPE TQt::Dock +#define TQT_DOCK_TOP TQt::DockTop +#define TQT_DOCK_LEFT TQt::DockLeft +#define TQT_DOCK_RIGHT TQt::DockRight +#define TQT_DOCK_BOTTOM TQt::DockBottom +#define TQT_DOCK_MINIMIZED TQt::DockMinimized +#define TQT_DOCK_TORNOFF TQt::DockTornOff +#define TQT_DOCK_UNMANAGED TQt::DockUnmanaged #endif //_KVI_TAL_TOOLBARDOCKTYPE_H_ diff --git a/src/kvilib/tal/kvi_tal_tooltip.cpp b/src/kvilib/tal/kvi_tal_tooltip.cpp index 486c0feb..b7a5a516 100644 --- a/src/kvilib/tal/kvi_tal_tooltip.cpp +++ b/src/kvilib/tal/kvi_tal_tooltip.cpp @@ -30,90 +30,32 @@ KviTalToolTipHelper::KviTalToolTipHelper(KviTalToolTip * pToolTip,TQWidget * pWidget) : TQObject(pWidget) { -#ifdef COMPILE_USE_QT4 - m_pToolTip = pToolTip; - pWidget->installEventFilter(this); -#endif } KviTalToolTipHelper::~KviTalToolTipHelper() { -#ifdef COMPILE_USE_QT4 - if(m_pToolTip) - { - m_pToolTip->helperDying(); - delete m_pToolTip; - } -#endif } void KviTalToolTipHelper::toolTipDying() { -#ifdef COMPILE_USE_QT4 - m_pToolTip = 0; -#endif } bool KviTalToolTipHelper::eventFilter(TQObject * pObject,TQEvent * pEvent) { -#ifdef COMPILE_USE_QT4 - if((pEvent->type() == TQEvent::ToolTip) && m_pToolTip) - { - tqDebug("TOOL TIP EVENT WITH POSITION %d,%d",((TQHelpEvent *)pEvent)->pos().x(),((TQHelpEvent *)pEvent)->pos().y()); - m_pToolTip->maybeTip(((TQHelpEvent *)pEvent)->pos()); - return true; - } -#endif return false; } KviTalToolTip::KviTalToolTip(TQWidget * pParent) -#ifndef COMPILE_USE_QT4 : TQToolTip(pParent) -#endif { -#ifdef COMPILE_USE_QT4 - m_pHelper = new KviTalToolTipHelper(this,pParent); - m_pParent = pParent; -#endif } KviTalToolTip::~KviTalToolTip() { -#ifdef COMPILE_USE_QT4 - if(m_pHelper) - { - m_pHelper->toolTipDying(); - delete m_pHelper; - } -#endif } -#ifdef COMPILE_USE_QT4 -void KviTalToolTip::helperDying() -{ - m_pHelper = 0; -} -#endif -#ifdef COMPILE_USE_QT4 -void KviTalToolTip::add(TQWidget * widget,const TQString & text) -{ - TQToolTip::add(widget,text); -} - -void KviTalToolTip::remove(TQWidget * widget) -{ - TQToolTip::remove(widget); -} - -void KviTalToolTip::tip(const TQRect & rect,const TQString & text) -{ - tqDebug("TOOL TIP AT %d,%d",rect.topLeft().x(),rect.topLeft().y()); - TQToolTip::showText(m_pParent->mapToGlobal(rect.topLeft()),text); -} -#endif void KviTalToolTip::maybeTip(const TQPoint & p) { diff --git a/src/kvilib/tal/kvi_tal_tooltip.h b/src/kvilib/tal/kvi_tal_tooltip.h index 1e220e14..345ae54f 100644 --- a/src/kvilib/tal/kvi_tal_tooltip.h +++ b/src/kvilib/tal/kvi_tal_tooltip.h @@ -32,8 +32,6 @@ class KviTalToolTip; -// This is useful only with TQt4, but we put it here anyway -// to have both a consistent API and make moc happy class KviTalToolTipHelper : public TQObject { friend class KviTalToolTip; @@ -51,30 +49,16 @@ protected: class KVILIB_API KviTalToolTip -#ifndef COMPILE_USE_QT4 : public TQToolTip -#endif { friend class KviTalToolTipHelper; public: KviTalToolTip(TQWidget * pParent); virtual ~KviTalToolTip(); protected: -#ifdef COMPILE_USE_QT4 - KviTalToolTipHelper * m_pHelper; - TQWidget * m_pParent; -#endif public: -#ifdef COMPILE_USE_QT4 - static void add(TQWidget * widget,const TQString & text); - static void remove(TQWidget * widget); - virtual void tip(const TQRect & rect,const TQString & text); -#endif protected: virtual void maybeTip(const TQPoint & p); -#ifdef COMPILE_USE_QT4 - void helperDying(); -#endif }; #endif // _KVI_TAL_TOOLTIP_H_ diff --git a/src/kvilib/tal/kvi_tal_vbox.cpp b/src/kvilib/tal/kvi_tal_vbox.cpp index 5ef67152..0e02e6ce 100644 --- a/src/kvilib/tal/kvi_tal_vbox.cpp +++ b/src/kvilib/tal/kvi_tal_vbox.cpp @@ -25,9 +25,5 @@ #define __KVILIB__ #include "kvi_tal_vbox.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_vbox_qt4.moc" -#else #include "kvi_tal_vbox_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_vbox.h b/src/kvilib/tal/kvi_tal_vbox.h index a27df527..b868a69f 100644 --- a/src/kvilib/tal/kvi_tal_vbox.h +++ b/src/kvilib/tal/kvi_tal_vbox.h @@ -27,10 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_vbox_qt4.h" -#else #include "kvi_tal_vbox_qt3.h" -#endif #endif // _KVI_TAL_VBOX_H_ diff --git a/src/kvilib/tal/kvi_tal_vbox_qt4.h b/src/kvilib/tal/kvi_tal_vbox_qt4.h deleted file mode 100644 index 7dc576ec..00000000 --- a/src/kvilib/tal/kvi_tal_vbox_qt4.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _KVI_TAL_VBOX_QT4_H_ -#define _KVI_TAL_VBOX_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_vbox_qt4.h -// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -#include <tq3vbox.h> - -class KVILIB_API KviTalVBox : public Q3VBox -{ - TQ_OBJECT - -public: - KviTalVBox(TQWidget * pParent) - : Q3VBox(pParent) {}; - virtual ~KviTalVBox() {}; -}; - - -#endif // _KVI_TAL_VBOX_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_widgetstack.cpp b/src/kvilib/tal/kvi_tal_widgetstack.cpp index 1a99e3f9..6b89138b 100644 --- a/src/kvilib/tal/kvi_tal_widgetstack.cpp +++ b/src/kvilib/tal/kvi_tal_widgetstack.cpp @@ -25,9 +25,5 @@ #define __KVILIB__ #include "kvi_tal_widgetstack.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_widgetstack_qt4.moc" -#else #include "kvi_tal_widgetstack_qt3.moc" -#endif diff --git a/src/kvilib/tal/kvi_tal_widgetstack.h b/src/kvilib/tal/kvi_tal_widgetstack.h index 7c9133c8..5047f5a9 100644 --- a/src/kvilib/tal/kvi_tal_widgetstack.h +++ b/src/kvilib/tal/kvi_tal_widgetstack.h @@ -27,10 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_widgetstack_qt4.h" -#else #include "kvi_tal_widgetstack_qt3.h" -#endif #endif // _KVI_TAL_WIDGETSTACK_H_ diff --git a/src/kvilib/tal/kvi_tal_widgetstack_qt4.h b/src/kvilib/tal/kvi_tal_widgetstack_qt4.h deleted file mode 100644 index 61931851..00000000 --- a/src/kvilib/tal/kvi_tal_widgetstack_qt4.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _KVI_TAL_WIDGETSTACK_QT4_H_ -#define _KVI_TAL_WIDGETSTACK_QT4_H_ - -//============================================================================= -// -// File : kvi_tal_widgetstack_qt4.h -// Creation date : Mon Jan 22 2007 11:17:08 by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// -//============================================================================= - -#include "kvi_settings.h" - -//#include <tqstackedwidget.h> -#include <tq3widgetstack.h> - -class KVILIB_API KviTalWidgetStack : public Q3WidgetStack -{ - TQ_OBJECT - -public: - KviTalWidgetStack(TQWidget * pParent) - : Q3WidgetStack(pParent) {}; - virtual ~KviTalWidgetStack() {}; -}; - -#endif // _KVI_TAL_WIDGETSTACK_QT4_H_ diff --git a/src/kvilib/tal/kvi_tal_windowstate.h b/src/kvilib/tal/kvi_tal_windowstate.h index bbd7c925..95276a7f 100644 --- a/src/kvilib/tal/kvi_tal_windowstate.h +++ b/src/kvilib/tal/kvi_tal_windowstate.h @@ -27,16 +27,9 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #define TQT_WINDOWSTATE_FLAGS TQt::WindowState - - #define TQT_WINDOWSTATE_MAXIMIZED TQt::WindowMaximized - #define TQT_WINDOWSTATE_MINIMIZED TQt::WindowMinimized -#else #define TQT_WINDOWSTATE_FLAGS TQt::WidgetState #define TQT_WINDOWSTATE_MAXIMIZED TQt::WState_Maximized #define TQT_WINDOWSTATE_MINIMIZED TQt::WState_Minimized -#endif #endif // _KVI_TAL_WINDOWSTATE_H_ diff --git a/src/kvilib/tal/kvi_tal_wizard.cpp b/src/kvilib/tal/kvi_tal_wizard.cpp index 81ccda5f..4ab58566 100644 --- a/src/kvilib/tal/kvi_tal_wizard.cpp +++ b/src/kvilib/tal/kvi_tal_wizard.cpp @@ -28,15 +28,6 @@ #include "kvi_pointerlist.h" #include "kvi_locale.h" -#ifdef COMPILE_USE_QT4 - #include <TQShowEvent> - #include <TQLabel> - #include <TQPushButton> - #include <TQGridLayout> - #include <TQFrame> - #include <TQStackedWidget> - #include <TQPalette> -#else #include <tqlabel.h> #include <tqpushbutton.h> #include <tqlayout.h> @@ -44,7 +35,6 @@ #include <tqframe.h> #include <tqwidgetstack.h> #include <tqpalette.h> -#endif class KviTalWizardPageData @@ -82,11 +72,7 @@ public: TQWidget * pNextSpacer; TQPushButton * pFinishButton; TQWidget * pFinishSpacer; -#ifdef COMPILE_USE_QT4 - TQStackedWidget * pWidgetStack; -#else TQWidgetStack * pWidgetStack; -#endif public: KviTalWizardPageData * findPage(TQWidget * pWidget) { @@ -177,50 +163,25 @@ KviTalWizard::KviTalWizard(TQWidget * pParent) m_p->pLayout = new TQGridLayout(this); m_p->pTitleLabel = new TQLabel(this); -#ifdef COMPILE_USE_QT4 - m_p->pLayout->addWidget(m_p->pTitleLabel,0,0,1,3); -#else m_p->pLayout->addMultiCellWidget(m_p->pTitleLabel,0,0,0,3); -#endif m_p->pStepsLabel = new TQLabel(this); m_p->pStepsLabel->setMinimumWidth(80); m_p->pStepsLabel->setAlignment(TQt::AlignRight); -#ifdef COMPILE_USE_QT4 - m_p->pLayout->addWidget(m_p->pStepsLabel,0,4,1,3); -#else m_p->pLayout->addMultiCellWidget(m_p->pStepsLabel,0,0,4,6); -#endif TQFrame * f1 = new TQFrame(this); f1->setFrameStyle(TQFrame::Sunken | TQFrame::HLine); -#ifdef COMPILE_USE_QT4 - m_p->pLayout->addWidget(f1,1,0,1,7); -#else m_p->pLayout->addMultiCellWidget(f1,1,1,0,6); -#endif -#ifdef COMPILE_USE_QT4 - m_p->pWidgetStack = new TQStackedWidget(this); - m_p->pLayout->addWidget(m_p->pWidgetStack,2,0,1,7); -#else m_p->pWidgetStack = new TQWidgetStack(this); m_p->pLayout->addMultiCellWidget(m_p->pWidgetStack,2,2,0,6); -#endif TQFrame * f2 = new TQFrame(this); f2->setFrameStyle(TQFrame::Sunken | TQFrame::HLine); -#ifdef COMPILE_USE_QT4 - m_p->pLayout->addWidget(f2,3,0,1,7); -#else m_p->pLayout->addMultiCellWidget(f2,3,3,0,6); -#endif KviTalHBox * pButtonBox = new KviTalHBox(this); -#ifdef COMPILE_USE_QT4 - m_p->pLayout->addWidget(pButtonBox,4,0,1,7); -#else m_p->pLayout->addMultiCellWidget(pButtonBox,4,4,0,6); -#endif pButtonBox->setMargin(0); pButtonBox->setSpacing(0); @@ -388,22 +349,13 @@ void KviTalWizard::setCurrentPage(KviTalWizardPageData * pData) bCancelEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableCancel); bFinishEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableFinish); bHelpEnabled = (pData->iEnableFlags & KviTalWizardPageData::EnableHelp); -#ifdef COMPILE_USE_QT4 - m_p->pWidgetStack->setCurrentWidget(pData->pWidget); -#else m_p->pWidgetStack->raiseWidget(pData->pWidget); -#endif szTitle = "<b>"; szTitle += pData->szTitle; szTitle += "</b>"; TQPalette pal = m_p->pStepsLabel->palette(); -#ifdef COMPILE_USE_QT4 - TQColor clrWin = pal.color(TQPalette::Active,TQPalette::Window); - TQColor clrTxt = pal.color(TQPalette::Active,TQPalette::WindowText); -#else TQColor clrWin = pal.color(TQPalette::Active,TQColorGroup::Foreground); TQColor clrTxt = pal.color(TQPalette::Active,TQColorGroup::Background); -#endif TQColor clrMid = tqRgb( (clrWin.red() + clrTxt.red()) / 2, (clrWin.green() + clrTxt.green()) / 2, diff --git a/src/kvilib/tal/kvi_tal_wizard.h b/src/kvilib/tal/kvi_tal_wizard.h index 0d7ead79..2606913a 100644 --- a/src/kvilib/tal/kvi_tal_wizard.h +++ b/src/kvilib/tal/kvi_tal_wizard.h @@ -27,11 +27,7 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include <TQDialog> -#else #include <tqdialog.h> -#endif class TQShowEvent; class TQPushButton; diff --git a/src/kvirc/kernel/kvi_action.cpp b/src/kvirc/kernel/kvi_action.cpp index 490a1ac2..91da5b43 100644 --- a/src/kvirc/kernel/kvi_action.cpp +++ b/src/kvirc/kernel/kvi_action.cpp @@ -418,9 +418,6 @@ TQWidget * KviAction::addToCustomToolBar(KviCustomToolBar *pParentToolBar) visibleName(), visibleName(), this,TQT_SLOT(activate()),pParentToolBar,m_szName); -#ifdef COMPILE_USE_QT4 - pParentToolBar->addWidget(b); -#endif if(!isEnabled())b->setEnabled(false); registerWidget(b); return b; diff --git a/src/kvirc/kernel/kvi_app.cpp b/src/kvirc/kernel/kvi_app.cpp index a9080236..0cfc7b7b 100644 --- a/src/kvirc/kernel/kvi_app.cpp +++ b/src/kvirc/kernel/kvi_app.cpp @@ -90,9 +90,6 @@ #include <tqstringlist.h> #include "kvi_pointerhashtable.h" #include <tqmime.h> -#ifdef COMPILE_USE_QT4 - #include <tq3mimefactory.h> -#endif #include "kvi_tal_listbox.h" #include <tqclipboard.h> #include <tqmessagebox.h> @@ -103,17 +100,8 @@ #include "kvi_ssl.h" #endif -#ifdef COMPILE_USE_QT4 -#ifdef COMPILE_ON_WINDOWS -#include <TQPluginLoader> -#endif -#endif -#ifdef COMPILE_USE_QT4 - #include <TQTextDocument> -#else #include <tqstylesheet.h> -#endif KVIRC_API KviApp * g_pApp = 0; // global application pointer @@ -223,16 +211,6 @@ void KviApp::setup() loadDirectories(); KviStringConversion::init(m_szGlobalKvircDir,m_szLocalKvircDir); -#ifdef COMPILE_USE_QT4 -#ifdef COMPILE_ON_WINDOWS - //need to load image plugins:( - TQString szPluginsDir; - getGlobalKvircDirectory(szPluginsDir,None,"qt-plugins/"); - setLibraryPaths(TQStringList(szPluginsDir)); - //KviMessageBox::information(libraryPaths().join(";")); - //tqDebug("%1",loader.isLoaded()); -#endif -#endif // check if we want to permanently disable the splash screen // we do it once for every version: the user should see the new splash screens at least once @@ -269,11 +247,7 @@ void KviApp::setup() list.append(tmp); getGlobalKvircDirectory(tmp,HelpNoIntl); list.append(tmp); -#ifdef COMPILE_USE_QT4 - Q3MimeSourceFactory::defaultFactory()->setFilePath(list); -#else TQMimeSourceFactory::defaultFactory()->setFilePath(list); -#endif KVI_SPLASH_SET_PROGRESS(1) @@ -475,18 +449,6 @@ void KviApp::setup() KviDoubleBuffer::init(); -#ifdef COMPILE_USE_QT4 - TQString szStylesheetFile; - getGlobalKvircDirectory(szStylesheetFile,Config,"style.css"); - if(KviFileUtils::fileExists(szStylesheetFile)) - { - TQString szStyleData; - KviFileUtils::readFile(szStylesheetFile,szStyleData); - szStyleData.replace("global://",m_szGlobalKvircDir); - szStyleData.replace("local://",m_szLocalKvircDir); - setStyleSheet(szStyleData); - } -#endif // create the frame window, we're almost up and running... createFrame(); @@ -693,7 +655,6 @@ TQTextCodec * KviApp::defaultTextCodec() void KviApp::contextSensitiveHelp() { // this stuff doesn't work with TQt 4.x -#ifndef COMPILE_USE_QT4 // the F1 Key has been pressed // try to pass it to the active widget or one of its parents TQWidget * w = g_pApp->focusWidget(); @@ -716,7 +677,6 @@ void KviApp::contextSensitiveHelp() // no way // FIXME: just show up simple plain online help //tqDebug("No way: found no focus widget for that..."); -#endif } @@ -737,9 +697,7 @@ void KviApp::loadDefaultScript() #endif KviKvsScript::run(cmd,g_pFrame->firstConsole()); // now line up the toolbars (they may get messed while loading the script) -#ifndef COMPILE_USE_QT4 g_pFrame->lineUpDockWindows(); // missing on TQt 4.x -#endif } // 07.01.2005 06:01: Got this curious gcc error while writing @@ -1054,11 +1012,7 @@ void KviApp::fileDownloadTerminated(bool bSuccess,const TQString &szRemoteUrl,co szMsg += szLocalFileName; szMsg += ")"; } -#ifdef COMPILE_USE_QT4 - notifierMessage(0,iIconId,TQt::escape(szMsg),30); -#else notifierMessage(0,iIconId,TQStyleSheet::escape(szMsg),30); -#endif } return; } diff --git a/src/kvirc/kernel/kvi_coreactions.cpp b/src/kvirc/kernel/kvi_coreactions.cpp index 8a664309..9650e6d3 100644 --- a/src/kvirc/kernel/kvi_coreactions.cpp +++ b/src/kvirc/kernel/kvi_coreactions.cpp @@ -466,13 +466,10 @@ void KviIrcContextDisplayAction::setup() bool KviIrcContextDisplayAction::addToPopupMenu(KviTalPopupMenu *p) { - // QT4SUX: Widgets can be no longer added to popup menus.. what about labels ? -#ifndef COMPILE_USE_QT4 if(!setupDone())setup(); KviIrcContextDisplay * w = new KviIrcContextDisplay(p,"kvirc.irccontextdisplay"); registerWidget(w); p->insertItem(w); -#endif return true; } @@ -480,9 +477,6 @@ TQWidget * KviIrcContextDisplayAction::addToCustomToolBar(KviCustomToolBar *t) { if(!setupDone())setup(); KviIrcContextDisplay * w = new KviIrcContextDisplay(t,"kvirc.irccontextdisplay"); -#ifdef COMPILE_USE_QT4 - t->addWidget(w); -#endif registerWidget(w); return w; } @@ -538,9 +532,6 @@ TQWidget * KviSeparatorAction::addToCustomToolBar(KviCustomToolBar *t) if(!setupDone())setup(); TQWidget * w = new KviCustomToolBarSeparator(t,"kvirc.separator"); registerWidget(w); -#ifdef COMPILE_USE_QT4 - t->addWidget(w); -#endif return w; } @@ -689,9 +680,6 @@ TQWidget * KviConnectAction::addToCustomToolBar(KviCustomToolBar *t) m_szConnectString, this,TQT_SLOT(activate()),t,name()); registerWidget(b); -#ifdef COMPILE_USE_QT4 - t->addWidget(b); -#endif activeContextStateChanged(); return b; } @@ -766,13 +754,8 @@ TQWidget * KviSubmenuAction::addToCustomToolBar(KviCustomToolBar *t) this,TQT_SLOT(activate()),t,name()); b->setPopup(m_pPopup); -#ifdef COMPILE_USE_QT4 - b->setPopupMode( scriptCode().isEmpty() ? TQToolButton::InstantPopup : TQToolButton::MenuButtonPopup); - t->addWidget(b); -#else b->setShowSubmenuIndicator(true); b->setPopupDelay(1); -#endif registerWidget(b); if(!isEnabled())b->setEnabled(false); return b; @@ -1113,9 +1096,6 @@ TQWidget * KviGoAwayAction::addToCustomToolBar(KviCustomToolBar *t) m_szAwayString, this,TQT_SLOT(activate()),t,name()); registerWidget(b); -#ifdef COMPILE_USE_QT4 - t->addWidget(b); -#endif activeContextStateChanged(); return b; } diff --git a/src/kvirc/kernel/kvi_iconmanager.cpp b/src/kvirc/kernel/kvi_iconmanager.cpp index 44d17883..3bc1c362 100644 --- a/src/kvirc/kernel/kvi_iconmanager.cpp +++ b/src/kvirc/kernel/kvi_iconmanager.cpp @@ -39,15 +39,9 @@ #include <tqlayout.h> #include <tqlabel.h> -#ifndef COMPILE_USE_QT4 - // In TQt.4 we need to use TQMimeData ? - #include <tqdragobject.h> -#endif +#include <tqdragobject.h> #include <tqcursor.h> -#ifdef COMPILE_USE_QT4 - #include <tqevent.h> -#endif // kvi_app.cpp extern TQPixmap * g_pUserChanStatePixmap; @@ -352,11 +346,7 @@ static const char * g_szIconNames[KVI_NUM_SMALL_ICONS]= }; KviIconWidget::KviIconWidget() -#ifdef COMPILE_USE_QT4 -: TQWidget(0,"global_icon_widget" /*,WType_TopLevel | WStyle_Customize | WStyle_Title | WStyle_StaysOnTop | WStyle_DialogBorder | WStyle_SysMenu | WStyle_Minimize*/) -#else : TQWidget(0,"global_icon_widget",WType_TopLevel | WStyle_Customize | WStyle_Title | WStyle_StaysOnTop | WStyle_DialogBorder | WStyle_SysMenu | WStyle_Minimize) -#endif { init(); } @@ -428,11 +418,9 @@ bool KviIconWidget::eventFilter(TQObject * o,TQEvent *e) if(const TQPixmap * pix = ((TQLabel *)o)->pixmap()) { // FIXME: In TQt 4.x this stuff needs to be ported to a different api.. which one ? -#ifndef COMPILE_USE_QT4 TQDragObject * drobj = new TQTextDrag(o->name(),this); drobj->setPixmap(*pix,((TQLabel *)o)->mapFromGlobal(TQCursor::pos())); drobj->dragCopy(); -#endif return true; } } diff --git a/src/kvirc/kernel/kvi_ipc.cpp b/src/kvirc/kernel/kvi_ipc.cpp index 7e61fe9f..c4b15db8 100644 --- a/src/kvirc/kernel/kvi_ipc.cpp +++ b/src/kvirc/kernel/kvi_ipc.cpp @@ -54,14 +54,8 @@ #include <unistd.h> // for getuid #include <sys/types.h> // for getuid - #ifdef COMPILE_USE_QT4 - #include <tqx11info_x11.h> - #define kvi_ipc_get_xdisplay QX11Info::display - #define kvi_ipc_get_xrootwin QX11Info::appRootWindow - #else #define kvi_ipc_get_xdisplay tqt_xdisplay #define kvi_ipc_get_xrootwin tqt_xrootwin - #endif static Atom kvi_atom_ipc_sentinel_window; static Atom kvi_atom_ipc_remote_command; diff --git a/src/kvirc/kernel/kvi_ipc.h b/src/kvirc/kernel/kvi_ipc.h index 39745eb5..26c50ef0 100644 --- a/src/kvirc/kernel/kvi_ipc.h +++ b/src/kvirc/kernel/kvi_ipc.h @@ -38,11 +38,6 @@ #include <windows.h> #else //!COMPILE_ON_WINDOWS #ifndef COMPILE_NO_X - #ifdef COMPILE_USE_QT4 - // We need this to be included BEFORE X11/Xlib.h - // because of preprocessor constant collisions... - #include <tqcoreevent.h> - #endif #include "kvi_xlib.h" // for XEvent #endif //!COMPILE_NO_X #endif //!COMPILE_ON_WINDOWS diff --git a/src/kvirc/kernel/kvi_lagmeter.cpp b/src/kvirc/kernel/kvi_lagmeter.cpp index 43b3fa16..8d8d2aeb 100644 --- a/src/kvirc/kernel/kvi_lagmeter.cpp +++ b/src/kvirc/kernel/kvi_lagmeter.cpp @@ -66,9 +66,7 @@ KviLagMeter::KviLagMeter(KviIrcConnection * c) KviLagMeter::~KviLagMeter() { if(m_pDeletionSignal)*m_pDeletionSignal = true; -#ifndef COMPILE_USE_QT4 killTimers(); -#endif delete m_pCheckList; } diff --git a/src/kvirc/kernel/kvi_options.h b/src/kvirc/kernel/kvi_options.h index 881042c7..3739b0ee 100644 --- a/src/kvirc/kernel/kvi_options.h +++ b/src/kvirc/kernel/kvi_options.h @@ -312,7 +312,6 @@ DECLARE_OPTION_STRUCT(KviStringListOption,TQStringList) #define KviOption_boolUseSystemUrlHandlers 218 /* Windoze only*/ #define KviOption_boolScaleAvatarsOnLoad 219 #define KviOption_boolDisableNotifierFadein 220 /* interface::notifier */ -#define KviOption_boolUseAntiAliasing 221 /* qt4 only! */ #define KVI_NUM_BOOL_OPTIONS 222 @@ -651,16 +650,6 @@ extern KVIRC_API KviStringListOption g_stringlistOptionsTable[KVI_NUM_STRINGLIST #define _OUTPUT_QUIET (KVI_OPTION_UINT(KviOption_uintOutputVerbosityLevel) <= KVI_VERBOSITY_LEVEL_QUIET) #define _OUTPUT_MUTE (KVI_OPTION_UINT(KviOption_uintOutputVerbosityLevel) <= KVI_VERBOSITY_LEVEL_MUTE) -#ifdef COMPILE_USE_QT4 - #define START_TABLE_BOLD_ROW "<tr><td style=\"background-color: rgb(0,0,0); font-weight: bold; color: rgb(200,200,255); text-indent: 5px;\"><nobr>" - #define END_TABLE_BOLD_ROW "</nobr></td></tr>" - - #define START_TABLE_NORMAL_ROW "<tr><td>" - - #define SET_ANTI_ALIASING(p) \ - (p).setRenderHint(TQPainter::Antialiasing, KVI_OPTION_BOOL(KviOption_boolUseAntiAliasing)); \ - (p).setRenderHint(TQPainter::TextAntialiasing, KVI_OPTION_BOOL(KviOption_boolUseAntiAliasing)); -#else #define START_TABLE_BOLD_ROW "<tr><td bgcolor=\"#303030\">" \ "<font color=\"#FFFFFF\"><nobr><b>" #define END_TABLE_BOLD_ROW "</b></nobr></font></td></tr>" @@ -668,7 +657,6 @@ extern KVIRC_API KviStringListOption g_stringlistOptionsTable[KVI_NUM_STRINGLIST #define START_TABLE_NORMAL_ROW "<tr><td bgcolor=\"#F0F0F0\">" #define SET_ANTI_ALIASING(p) -#endif #if defined(_KVI_OPTIONS_CPP_) || defined(_WANT_OPTION_FLAGS_) diff --git a/src/kvirc/kernel/kvi_theme.cpp b/src/kvirc/kernel/kvi_theme.cpp index 4d1d06fb..30b1932e 100644 --- a/src/kvirc/kernel/kvi_theme.cpp +++ b/src/kvirc/kernel/kvi_theme.cpp @@ -36,11 +36,7 @@ #define KVI_THEME_MEDIUM_SCREENSHOT_NAME "screenshot_medium.png" #define KVI_THEME_LARGE_SCREENSHOT_NAME "screenshot.png" -#ifdef COMPILE_USE_QT4 - #define TQIMAGE_SCALE_MIN TQt::KeepAspectRatio -#else #define TQIMAGE_SCALE_MIN TQ_ScaleMin -#endif KviThemeInfo::KviThemeInfo() : KviHeapObject() diff --git a/src/kvirc/kvs/kvi_kvs_corefunctions_af.cpp b/src/kvirc/kvs/kvi_kvs_corefunctions_af.cpp index cc48db19..93d729f2 100644 --- a/src/kvirc/kvs/kvi_kvs_corefunctions_af.cpp +++ b/src/kvirc/kvs/kvi_kvs_corefunctions_af.cpp @@ -947,11 +947,7 @@ namespace KviKvsCoreFunctions #ifdef COMPILE_SCRIPTTOOLBAR "ScriptToolBar", #endif // COMPILE_SCRIPTTOOLBAR - #ifdef COMPILE_USE_QT4 - "TQt4", - #else "TQt3", - #endif #ifdef COMPILE_NEW_KVS "KVS", #endif diff --git a/src/kvirc/kvs/kvi_kvs_coresimplecommands_af.cpp b/src/kvirc/kvs/kvi_kvs_coresimplecommands_af.cpp index 6eb820e9..66d3d969 100644 --- a/src/kvirc/kvs/kvi_kvs_coresimplecommands_af.cpp +++ b/src/kvirc/kvs/kvi_kvs_coresimplecommands_af.cpp @@ -47,12 +47,7 @@ #include "kvi_xlib.h" // XBell : THIS SHOULD BE INCLUDED AS LAST! #include <unistd.h> // for usleep(); - #ifdef COMPILE_USE_QT4 - #include <tqx11info_x11.h> - #define get_xdisplay QX11Info::display - #else #define get_xdisplay tqt_xdisplay - #endif #endif diff --git a/src/kvirc/kvs/kvi_kvs_coresimplecommands_gl.cpp b/src/kvirc/kvs/kvi_kvs_coresimplecommands_gl.cpp index c46ecb26..d7664acf 100644 --- a/src/kvirc/kvs/kvi_kvs_coresimplecommands_gl.cpp +++ b/src/kvirc/kvs/kvi_kvs_coresimplecommands_gl.cpp @@ -37,9 +37,6 @@ #include "kvi_out.h" -#ifdef COMPILE_USE_QT4 - #include <tq3mimefactory.h> -#endif namespace KviKvsCoreSimpleCommands { @@ -139,11 +136,7 @@ namespace KviKvsCoreSimpleCommands TQString szOriginal = szTopic; TQString topik = szTopic; -#ifdef COMPILE_USE_QT4 - TQStringList pl = Q3MimeSourceFactory::defaultFactory()->filePath(); -#else TQStringList pl = TQMimeSourceFactory::defaultFactory()->filePath(); -#endif bool bLowCaseTried = false; bool bFound = KviFileUtils::fileExists(szTopic); diff --git a/src/kvirc/kvs/kvi_kvs_coresimplecommands_mr.cpp b/src/kvirc/kvs/kvi_kvs_coresimplecommands_mr.cpp index d398b18d..701a265a 100644 --- a/src/kvirc/kvs/kvi_kvs_coresimplecommands_mr.cpp +++ b/src/kvirc/kvs/kvi_kvs_coresimplecommands_mr.cpp @@ -1320,15 +1320,9 @@ namespace KviKvsCoreSimpleCommands KVSCSC_PARAMETER("parameters",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,l) KVSCSC_PARAMETERS_END -#ifdef COMPILE_USE_QT4 - TQProcess proc; - proc.start(szCommand,l); - // FIXME: KVSCSC_pContext->warning(__tr2qs("Failed to execute command '%Q'"),&szCommand); -#else TQProcess proc(szCommand); for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it ) proc.addArgument(*it); if(!proc.start())KVSCSC_pContext->warning(__tr2qs("Failed to execute command '%Q'"),&szCommand); -#endif return true; } }; diff --git a/src/kvirc/kvs/kvi_kvs_object.cpp b/src/kvirc/kvs/kvi_kvs_object.cpp index 46f6efbf..3bfca497 100644 --- a/src/kvirc/kvs/kvi_kvs_object.cpp +++ b/src/kvirc/kvs/kvi_kvs_object.cpp @@ -1017,10 +1017,7 @@ bool KviKvsObject::function_killTimer(KviKvsObjectFunctionCall * c) bool KviKvsObject::function_killTimers(KviKvsObjectFunctionCall * c) { - // FIXME: QT4 does not seem to have TQObject::killTimers() -#ifndef COMPILE_USE_QT4 killTimers(); -#endif return true; } @@ -1045,27 +1042,16 @@ bool KviKvsObject::function_listProperties(KviKvsObjectFunctionCall * c) const TQMetaObject *o = m_pObject->metaObject(); if(!bArray) w->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Properties for TQt class %s"),o->className()); -#ifndef COMPILE_USE_QT4 while(o) { -#endif kvs_int_t idx = 0; - #ifdef COMPILE_USE_QT4 - TQMetaProperty prop = o->property(idx); - const TQMetaProperty *p = ∝ - #else const TQMetaProperty *p = o->property(idx); - #endif while(p) { TQString szOut; TQString szName = p->name(); - #ifdef COMPILE_USE_QT4 - TQString szType = p->typeName(); - #else TQString szType = p->type(); - #endif if(bArray) KviTQString::sprintf(szOut,"%Q, %Q",&szName,&szType); else { @@ -1076,7 +1062,6 @@ bool KviKvsObject::function_listProperties(KviKvsObjectFunctionCall * c) if(p->isEnumType()) { szOut += ", enum("; -#ifndef COMPILE_USE_QT4 // FIXME: TQt 4.x needs TQMetaEnum for this loop TQStrList le = p->enumKeys(); int i = 0; @@ -1088,41 +1073,23 @@ bool KviKvsObject::function_listProperties(KviKvsObjectFunctionCall * c) szOut.append(", "); szOut.append(c2); } -#endif szOut += ")"; } -#ifdef COMPILE_USE_QT4 - // FIXME: QT4 Need to read better the docs and check the changes: there seem to be too many - // for me to fix now. Actually I need to get the whole executable working... - if(p->isWritable())szOut += ", writable"; -#else if(p->isSetType())szOut += ", set"; if(p->writable())szOut += ", writable"; -#endif if(bArray) a->set(cnt,new KviKvsVariant(szOut)); else w->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,szOut); -#ifdef COMPILE_USE_QT4 - idx++; - if (idx<o->propertyCount()){ - prop = o->property(idx); - p = ∝ - } - else p=0; -#else p = o->property(idx); idx++; -#endif cnt++; } -#ifndef COMPILE_USE_QT4 o = o->superClass(); } -#endif } @@ -1153,22 +1120,13 @@ bool KviKvsObject::function_setProperty(KviKvsObjectFunctionCall * c) return true; } -#ifdef COMPILE_USE_QT4 - int idx = m_pObject->metaObject()->indexOfProperty(szName); -#else int idx = m_pObject->metaObject()->findProperty(szName,true); -#endif if(idx < 0) { c->warning(__tr2qs("No TQt property named \"%Q\" for object named \"%Q\" of class %Q"),&szName,&m_szName,&(m_pClass->name())); return true; } -#ifdef COMPILE_USE_QT4 - TQMetaProperty prop = m_pObject->metaObject()->property(idx); - const TQMetaProperty * p = ∝ -#else const TQMetaProperty * p = m_pObject->metaObject()->property(idx,true); -#endif if(!p) { c->warning(__tr2qs("Can't find property named \"%Q\" for object named \"%Q\" of class %Q: the property is indexed but it doesn't really exist"),&szName,&m_szName,&(m_pClass->name())); @@ -1186,11 +1144,7 @@ bool KviKvsObject::function_setProperty(KviKvsObjectFunctionCall * c) { TQString szKey; v->asString(szKey); -#ifdef COMPILE_USE_QT4 - int val = p->enumerator().keyToValue(szKey); -#else int val = p->keyToValue(szKey); -#endif TQVariant var(val); m_pObject->setProperty(szName,var); return true; @@ -1274,8 +1228,6 @@ bool KviKvsObject::function_setProperty(KviKvsObjectFunctionCall * c) m_pObject->setProperty(szName,TQVariant(TQRect(iX,iY,iW,iH))); } break; -#ifndef COMPILE_USE_QT4 - // FIXME: QT4 ???? case TQVariant::Color: { if(!v->isArray())WRONG_TYPE("array(integer,integer,integer)") @@ -1354,7 +1306,6 @@ bool KviKvsObject::function_setProperty(KviKvsObjectFunctionCall * c) } } break; -#endif default: c->warning(__tr2qs("Property \"%Q\" for object named \"%Q\" of class %Q has an unsupported data type"),&szName,&m_szName,&(m_pClass->name())); c->returnValue()->setNothing(); @@ -1384,11 +1335,7 @@ bool KviKvsObject::function_property(KviKvsObjectFunctionCall * c) return true; } -#ifdef COMPILE_USE_QT4 - int idx = m_pObject->metaObject()->indexOfProperty(szName); -#else int idx = m_pObject->metaObject()->findProperty(szName,true); -#endif if(idx < 0) { if (bNoerror) c->returnValue()->setString("No TQt properties"); @@ -1399,12 +1346,7 @@ bool KviKvsObject::function_property(KviKvsObjectFunctionCall * c) } return true; } -#ifdef COMPILE_USE_QT4 - TQMetaProperty prop = m_pObject->metaObject()->property(idx); - const TQMetaProperty * p = ∝ -#else const TQMetaProperty * p = m_pObject->metaObject()->property(idx,true); -#endif if(!p) { c->warning(__tr2qs("Can't find property named \"%Q\" for object named \"%Q\" of class %Q: the property is indexed but it doesn't really exist"),&szName,&m_szName,&(m_pClass->name())); @@ -1422,11 +1364,7 @@ bool KviKvsObject::function_property(KviKvsObjectFunctionCall * c) if(p->isEnumType()) { -#ifdef COMPILE_USE_QT4 - c->returnValue()->setString(p->enumerator().valueToKey(v.toInt())); -#else c->returnValue()->setString(p->valueToKey(v.toInt())); -#endif return true; } @@ -1476,8 +1414,6 @@ bool KviKvsObject::function_property(KviKvsObjectFunctionCall * c) c->returnValue()->setArray(a); } break; -#ifndef COMPILE_USE_QT4 - // FIXME: QT4 ? case TQVariant::Color: { TQColor clr = v.toColor(); @@ -1505,7 +1441,6 @@ bool KviKvsObject::function_property(KviKvsObjectFunctionCall * c) c->returnValue()->setString(szFlags); } break; -#endif default: if (bNoerror) c->returnValue()->setString("Unsupported_data_type"); else diff --git a/src/kvirc/kvs/kvi_kvs_popupmenu.cpp b/src/kvirc/kvs/kvi_kvs_popupmenu.cpp index ef52beed..b531904a 100644 --- a/src/kvirc/kvs/kvi_kvs_popupmenu.cpp +++ b/src/kvirc/kvs/kvi_kvs_popupmenu.cpp @@ -324,10 +324,7 @@ void KviKvsPopupMenuItemLabel::fill(KviKvsPopupMenu * pMenu,KviKvsPopupMenuTopLe } m_pLabel = new TQLabel(szText,pMenu); TQObject::connect(m_pLabel,TQT_SIGNAL(destroyed()),m_pSignalRelay,TQT_SLOT(labelDestroyed())); -#ifndef COMPILE_USE_QT4 - // FIXME: QT4 Seems to not allow widgets as TQMenu items pMenu->insertItem(m_pLabel); -#endif m_pLabel->setFrameStyle(TQFrame::StyledPanel | TQFrame::Raised); if(pPix)m_pLabel->setPixmap(*pPix); } diff --git a/src/kvirc/kvs/kvi_kvs_processmanager.cpp b/src/kvirc/kvs/kvi_kvs_processmanager.cpp index c6925e6b..ab4a7c16 100644 --- a/src/kvirc/kvs/kvi_kvs_processmanager.cpp +++ b/src/kvirc/kvs/kvi_kvs_processmanager.cpp @@ -80,11 +80,7 @@ bool KviKvsProcessAsyncOperation::start() // // [02:50:21] <kode54> if ( TQApplication::winVersion() & TQt::WV_NT_based ) // [02:50:41] <kode54> I see another implementation using that, maybe it is the official way of detecting that :[ -#ifdef COMPILE_USE_QT4 - szShell = !(TQSysInfo::WindowsVersion & TQSysInfo::WV_DOS_based) ? "cmd.exe /c" : "command.com /c"; -#else szShell = "command.com /c"; -#endif // Thnx kode54 :) #else diff --git a/src/kvirc/kvs/kvi_kvs_variant.cpp b/src/kvirc/kvs/kvi_kvs_variant.cpp index 1510f10d..14608bea 100644 --- a/src/kvirc/kvs/kvi_kvs_variant.cpp +++ b/src/kvirc/kvs/kvi_kvs_variant.cpp @@ -1365,11 +1365,7 @@ KviKvsVariant* KviKvsVariant::unserialize(const TQString& data) { KviKvsVariant* pResult = 0; -#ifdef COMPILE_USE_QT4 - const TQChar * aux = (const TQChar *)data.constData(); -#else const TQChar * aux = (const TQChar *)data.ucs2(); -#endif pResult = unserialize(&aux); diff --git a/src/kvirc/sparser/kvi_sp_ctcp.cpp b/src/kvirc/sparser/kvi_sp_ctcp.cpp index b6d82022..002e9b1e 100644 --- a/src/kvirc/sparser/kvi_sp_ctcp.cpp +++ b/src/kvirc/sparser/kvi_sp_ctcp.cpp @@ -60,11 +60,7 @@ #include <tqdatetime.h> -#ifdef COMPILE_USE_QT4 - #include <TQTextDocument> -#else #include <tqstylesheet.h> -#endif @@ -1147,20 +1143,8 @@ void KviServerParser::parseCtcpRequestVersion(KviCtcpMessage *msg) { if(!KVI_OPTION_BOOL(KviOption_boolIgnoreCtcpVersion)) { - TQString szVersion; -#ifdef COMPILE_USE_QT4 - #define QT4_TAG " (QT4) " -#else - #define QT4_TAG -#endif - -#ifdef COMPILE_ON_WINDOWS - szVersion = "KVIrc " KVI_VERSION QT4_TAG " '" KVI_RELEASE_NAME "' " KVI_SOURCES_DATE " - build " KVI_BUILD_DATE; - szVersion.append(TQString(" - %1").arg(KviOsInfo::version())); -#else - szVersion = "KVIrc " KVI_VERSION QT4_TAG " '" KVI_RELEASE_NAME "' " KVI_SOURCES_DATE " - build " KVI_BUILD_DATE " - " KVI_BUILD_FLAGS; + TQString szVersion = "KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "' " KVI_SOURCES_DATE " - build " KVI_BUILD_DATE " - " KVI_BUILD_FLAGS; szVersion.append(TQString(" - %1 (%2)").arg(KviOsInfo::name()).arg(KviOsInfo::release())); -#endif //szVersion.append(TQString(" - QT Version: %1 - %2").arg(tqVersion()).arg(__tr2qs("http://www.kvirc.net/"))); if(!KVI_OPTION_STRING(KviOption_stringCtcpVersionPostfix).isEmpty()) { @@ -1447,11 +1431,7 @@ void KviServerParser::parseCtcpRequestAction(KviCtcpMessage *msg) TQString szMsg = "<b>"; szMsg += msg->pSource->nick(); szMsg += "</b> "; - #ifdef COMPILE_USE_QT4 - szMsg += TQt::escape(szData); - #else szMsg += TQStyleSheet::escape(szData); - #endif //tqDebug("kvi_sp_ctcp.cpp:975 debug: %s",szMsg.data()); g_pApp->notifierMessage(pOut,KVI_OPTION_MSGTYPE(KVI_OUT_ACTION).pixId(),szMsg,90); } diff --git a/src/kvirc/sparser/kvi_sp_literal.cpp b/src/kvirc/sparser/kvi_sp_literal.cpp index 00cfe7df..35d50950 100644 --- a/src/kvirc/sparser/kvi_sp_literal.cpp +++ b/src/kvirc/sparser/kvi_sp_literal.cpp @@ -72,11 +72,7 @@ //#include "kvi_iconmanager.h" #include <tqdatetime.h> -#ifdef COMPILE_USE_QT4 - #include <TQTextDocument> -#else #include <tqstylesheet.h> -#endif extern KviNickServRuleSet * g_pNickServRuleSet; @@ -916,11 +912,7 @@ void KviServerParser::parseLiteralPrivmsg(KviIrcMessage *msg) { // don't send the message to the notifier twice iFlags |= KviConsole::NoNotifier; - #ifdef COMPILE_USE_QT4 - TQString szMsg = TQt::escape(szMsgText); - #else TQString szMsg = TQStyleSheet::escape(szMsgText); - #endif //tqDebug("kvi_sp_literal.cpp:908 debug: %s",szMsg.data()); g_pApp->notifierMessage(query,KVI_SMALLICON_QUERYPRIVMSG,szMsg,1800); } @@ -1274,11 +1266,7 @@ void KviServerParser::parseLiteralNotice(KviIrcMessage *msg) { // don't send the message twice to the notifier iFlags |= KviConsole::NoNotifier; - #ifdef COMPILE_USE_QT4 - TQString szMsg = TQt::escape(szMsgText); - #else TQString szMsg = TQStyleSheet::escape(szMsgText); - #endif //tqDebug("kvi_sp_literal.cpp:908 debug: %s",szMsg.data()); g_pApp->notifierMessage(query,KVI_SMALLICON_QUERYNOTICE,szMsg,1800); } diff --git a/src/kvirc/ui/kvi_actiondrawer.cpp b/src/kvirc/ui/kvi_actiondrawer.cpp index d4b02e02..2637d4d8 100644 --- a/src/kvirc/ui/kvi_actiondrawer.cpp +++ b/src/kvirc/ui/kvi_actiondrawer.cpp @@ -35,15 +35,8 @@ //#include <tqscrollview.h> #include <tqpainter.h> #include <tqpixmap.h> -#ifdef COMPILE_USE_QT4 - #include <tq3header.h> - #include <tq3simplerichtext.h> - #include <tqmime.h> - #include <tqevent.h> -#else - #include <tqheader.h> - #include <tqsimplerichtext.h> -#endif +#include <tqheader.h> +#include <tqsimplerichtext.h> #include "kvi_draganddrop.h" @@ -64,11 +57,7 @@ KviActionDrawerPageListViewItem::KviActionDrawerPageListViewItem(KviTalListView t += " <font color=\"#a0a0a0\">[" + __tr2qs("Script") + "]</font>"; t += "<br><font size=\"-1\">" + a->description()+ "</font>"; m_szKey = a->visibleName().upper(); -#ifdef COMPILE_USE_QT4 - m_pText = new Q3SimpleRichText(t,v->font()); -#else m_pText = new TQSimpleRichText(t,v->font()); -#endif TQPixmap * p = a->bigIcon(); m_pIcon = p ? new TQPixmap(*p) : new TQPixmap(LVI_ICON_SIZE,LVI_ICON_SIZE); } diff --git a/src/kvirc/ui/kvi_actiondrawer.h b/src/kvirc/ui/kvi_actiondrawer.h index c2689056..bea83073 100644 --- a/src/kvirc/ui/kvi_actiondrawer.h +++ b/src/kvirc/ui/kvi_actiondrawer.h @@ -34,11 +34,7 @@ class KviActionDrawerPage; class TQPixmap; -#ifdef COMPILE_USE_QT4 - class Q3SimpleRichText; -#else - class TQSimpleRichText; -#endif +class TQSimpleRichText; class KviAction; class KVIRC_API KviActionDrawerPageListViewItem : public KviTalListViewItem @@ -48,11 +44,7 @@ public: ~KviActionDrawerPageListViewItem(); protected: TQString m_szName; -#ifdef COMPILE_USE_QT4 - Q3SimpleRichText * m_pText; -#else TQSimpleRichText * m_pText; -#endif TQPixmap * m_pIcon; KviTalListView * m_pListView; TQString m_szKey; diff --git a/src/kvirc/ui/kvi_channel.cpp b/src/kvirc/ui/kvi_channel.cpp index d1ec58ad..b9971038 100644 --- a/src/kvirc/ui/kvi_channel.cpp +++ b/src/kvirc/ui/kvi_channel.cpp @@ -135,22 +135,14 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name // Central splitter m_pSplitter = new TQSplitter(Qt::Horizontal,this); - #ifdef COMPILE_USE_QT4 - m_pSplitter->setObjectName(name); - #else m_pSplitter->setName(name); - #endif m_pSplitter->setOpaqueResize(false); // Spitted vertially on the left m_pVertSplitter = new TQSplitter(Qt::Vertical,m_pSplitter); m_pVertSplitter->setOpaqueResize(false); // With the IRC view over m_pIrcView = new KviIrcView(m_pVertSplitter,lpFrm,this); - #ifdef COMPILE_USE_QT4 - m_pIrcView->setObjectName(name); - #else m_pIrcView->setName(name); - #endif connect(m_pIrcView,TQT_SIGNAL(rightClicked()),this,TQT_SLOT(textViewRightClicked())); // And the double view (that may be unused) m_pMessageView = 0; @@ -191,11 +183,7 @@ KviChannel::KviChannel(KviFrame * lpFrm,KviConsole * lpConsole,const char * name m_pHideToolsButton = new KviStyledToolButton(m_pButtonBox,"hide_container_button"); -#ifndef COMPILE_USE_QT4 m_pHideToolsButton->setUsesBigPixmap(false); -#else - m_pHideToolsButton->setAutoRaise(true); -#endif m_pHideToolsButton->setFixedWidth(10); if(g_pIconManager->getBigIcon("kvi_horizontal_left.png")) @@ -301,15 +289,7 @@ void KviChannel::saveProperties(KviConfig *cfg) KviWindow::saveProperties(cfg); cfg->writeEntry("TopSplitter",m_pTopSplitter->sizes()); cfg->writeEntry("Splitter",m_pSplitter->sizes()); -#ifdef COMPILE_USE_QT4 - TQPtrList<int> tmp = m_pVertSplitter->sizes(); - KviValueList<int> tmp2; - for(TQPtrList<int>::Iterator it = tmp.begin();it != tmp.end();++it) - tmp2.append(*it); - cfg->writeEntry("VertSplitter",m_pMessageView ? tmp2 : m_VertSplitterSizesList); -#else cfg->writeEntry("VertSplitter",m_pMessageView ? m_pVertSplitter->sizes() : m_VertSplitterSizesList); -#endif cfg->writeEntry("PrivateBackground",m_privateBackground); cfg->writeEntry("DoubleView",m_pMessageView ? true : false); if(m_pUserListView) @@ -545,19 +525,11 @@ TQPixmap * KviChannel::myIconPtr() void KviChannel::resizeEvent(TQResizeEvent *e) { -#ifdef COMPILE_USE_QT4 - int hght = m_pInput->heightHint(); - int hght2 = m_pTopicWidget->sizeHint().height(); - m_pButtonBox->setGeometry(0,0,width(),hght2); - m_pSplitter->setGeometry(0,hght2,width(),height() - (hght + hght2)); - m_pInput->setGeometry(0,height() - hght,width(),hght); -#else int hght = m_pInput->heightHint(); int hght2 = m_pButtonBox->sizeHint().height(); m_pButtonBox->setGeometry(0,0,width(),hght2); m_pSplitter->setGeometry(0,hght2,width(),height() - (hght + hght2)); m_pInput->setGeometry(0,height() - hght,width(),hght); -#endif } TQSize KviChannel::sizeHint() const diff --git a/src/kvirc/ui/kvi_colorwin.cpp b/src/kvirc/ui/kvi_colorwin.cpp index 8b27750e..af190b53 100644 --- a/src/kvirc/ui/kvi_colorwin.cpp +++ b/src/kvirc/ui/kvi_colorwin.cpp @@ -38,11 +38,7 @@ KviColorWindow::KviColorWindow() :TQWidget(0,"toplevel_color_window",TQt::WType_Popup) { -#ifdef COMPILE_USE_QT4 setFocusPolicy(TQ_NoFocus); -#else - setFocusPolicy(TQ_NoFocus); -#endif setBackgroundMode(TQt::NoBackground); setFixedSize(146,38); m_pOwner = 0; diff --git a/src/kvirc/ui/kvi_console.cpp b/src/kvirc/ui/kvi_console.cpp index 46a7b382..ba7f5606 100644 --- a/src/kvirc/ui/kvi_console.cpp +++ b/src/kvirc/ui/kvi_console.cpp @@ -90,18 +90,11 @@ #include <tqmessagebox.h> #include <tqstringlist.h> -#ifdef COMPILE_USE_QT4 - #include <tq3mimefactory.h> -#endif #define __KVI_DEBUG__ #include "kvi_debug.h" -#ifdef COMPILE_USE_QT4 - #include <TQTextDocument> -#else #include <tqstylesheet.h> -#endif extern KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase; extern KVIRC_API KviProxyDataBase * g_pProxyDataBase; @@ -139,9 +132,6 @@ KviConsole::KviConsole(KviFrame * lpFrm,int iFlags) m_pAddressEdit->setInsertionPolicy(TQComboBox::NoInsertion); m_pAddressEdit->setMinimumHeight(24); //icon is 16px, + margins m_pButtonBox->setStretchFactor(m_pAddressEdit,1); -#ifdef COMPILE_USE_QT4 - m_pButtonBox->setObjectName( TQLatin1String( "kvi_window_button_box" ) ); -#endif KviTalToolTip::add(m_pAddressEdit,__tr2qs("Current IRC URI")); connect(m_pAddressEdit,TQT_SIGNAL(activated(const TQString & )),this,TQT_SLOT(ircUriChanged(const TQString & ))); connect(g_pApp,TQT_SIGNAL(recentUrlsChanged()),this,TQT_SLOT(recentUrlsChanged())); @@ -348,11 +338,7 @@ void KviConsole::getUserTipText(const TQString &nick,KviIrcUserEntry *e,TQString } if(e->avatar()) { -#ifdef COMPILE_USE_QT4 - Q3MimeSourceFactory::defaultFactory()->setPixmap("ulv_avatar",*(e->avatar()->pixmap())); -#else TQMimeSourceFactory::defaultFactory()->setPixmap("ulv_avatar",*(e->avatar()->pixmap())); -#endif buffer += TQString("<tr><td><center><img src=\"ulv_avatar\" width=\"%1\"></center></td></tr>").arg(e->avatar()->pixmap()->width()); } @@ -767,11 +753,7 @@ void KviConsole::outputPrivmsg(KviWindow *wnd, TQString szMsg = "<b><"; szMsg += nick; szMsg += "></b> "; - #ifdef COMPILE_USE_QT4 - szMsg += TQt::escape(szDecodedMessage); - #else szMsg += TQStyleSheet::escape(szDecodedMessage); - #endif //tqDebug("kvi_console.cpp:629 debug: %s",szMsg.data()); g_pApp->notifierMessage(wnd,KVI_OPTION_MSGTYPE(iSaveType).pixId(),szMsg,90); } diff --git a/src/kvirc/ui/kvi_cryptcontroller.cpp b/src/kvirc/ui/kvi_cryptcontroller.cpp index 2a763163..6b768587 100644 --- a/src/kvirc/ui/kvi_cryptcontroller.cpp +++ b/src/kvirc/ui/kvi_cryptcontroller.cpp @@ -78,11 +78,7 @@ m_pWindow = wnd; -#ifdef COMPILE_USE_QT4 setFocusPolicy(TQ_ClickFocus); -#else - setFocusPolicy(TQ_ClickFocus); -#endif TQGridLayout *g = new TQGridLayout(this,10,4,2,2); @@ -106,11 +102,7 @@ m_pDescriptionLabel = new TQLabel(this); m_pDescriptionLabel->setFrameStyle(TQFrame::Sunken | TQFrame::StyledPanel); -#ifdef COMPILE_USE_QT4 - m_pDescriptionLabel->setAlignment(TQt::AlignTop | TQt::AlignLeft); -#else m_pDescriptionLabel->setAlignment(TQt::AlignTop | TQt::AlignLeft); -#endif g->addMultiCellWidget(m_pDescriptionLabel,3,3,1,3); m_pAuthorLabel = new TQLabel(this); diff --git a/src/kvirc/ui/kvi_cryptcontroller.h b/src/kvirc/ui/kvi_cryptcontroller.h index 1304c2f4..6f93b42c 100644 --- a/src/kvirc/ui/kvi_cryptcontroller.h +++ b/src/kvirc/ui/kvi_cryptcontroller.h @@ -26,13 +26,7 @@ #include "kvi_settings.h" -#ifdef Q_MOC_RUN -#define COMPILE_CRYPT_SUPPORT -#endif // Q_MOC_RUN - -// TQt4 moc bails out on this ?????? - -#if defined(COMPILE_CRYPT_SUPPORT) || defined(Q_MOC_RUN) +#if defined(COMPILE_CRYPT_SUPPORT) #include <tqwidget.h> #include "kvi_tal_listbox.h" #include <tqpushbutton.h> diff --git a/src/kvirc/ui/kvi_ctcppagedialog.cpp b/src/kvirc/ui/kvi_ctcppagedialog.cpp index 8a151e61..96d25e88 100644 --- a/src/kvirc/ui/kvi_ctcppagedialog.cpp +++ b/src/kvirc/ui/kvi_ctcppagedialog.cpp @@ -34,20 +34,13 @@ #include <tqlabel.h> #include <tqpixmap.h> -#ifdef COMPILE_USE_QT4 - #include <tqdesktopwidget.h> -#endif // kvi_app.cpp extern KVIRC_API KviCtcpPageDialog * g_pCtcpPageDialog; KviCtcpPageDialog::KviCtcpPageDialog() : TQWidget(0,"kvirc_ctcppage_dialog", -#ifdef COMPILE_USE_QT4 - TQt::WindowStaysOnTopHint | TQt::Tool | TQt::Dialog | TQt::Window) -#else WStyle_StaysOnTop | WStyle_Tool | WType_Dialog | WType_TopLevel) -#endif { TQGridLayout * g = new TQGridLayout(this,4,1,6,0); m_pWidgetStack = new KviTalWidgetStack(this); @@ -95,11 +88,7 @@ void KviCtcpPageDialog::tabSelected(int id) void KviCtcpPageDialog::addPage(const TQString &szNick,const TQString &szUser,const TQString &szHost,const TQString &szMsg) { -#ifdef COMPILE_USE_QT4 - int id = m_pTabBar->addTab(szNick); -#else int id = m_pTabBar->addTab(new TQTab(szNick)); -#endif TQLabel * l = new TQLabel(this); l->setFrameStyle(TQFrame::Raised | TQFrame::StyledPanel); //l->setMaximumWidth(600); diff --git a/src/kvirc/ui/kvi_customtoolbar.cpp b/src/kvirc/ui/kvi_customtoolbar.cpp index 844b0e2e..f398bd40 100644 --- a/src/kvirc/ui/kvi_customtoolbar.cpp +++ b/src/kvirc/ui/kvi_customtoolbar.cpp @@ -40,19 +40,8 @@ #include <tqpainter.h> #include <tqstyle.h> -#ifdef COMPILE_USE_QT4 - #include <tqevent.h> - #include <tq3dragobject.h> - - #define TQDragObject Q3DragObject - #define TQTextDrag Q3TextDrag - #define TQIconDrag Q3IconDrag - - #include <tqstyleoption.h> -#else #include <tqobjectlist.h> #include <tqdragobject.h> -#endif @@ -67,13 +56,7 @@ KviCustomToolBarSeparator::KviCustomToolBarSeparator(KviCustomToolBar *pParent,c TQSize KviCustomToolBarSeparator::sizeHint() const { -#ifdef COMPILE_USE_QT4 - TQStyleOption opt; - opt.initFrom(this); - int extent = style()->pixelMetric(TQStyle::PM_ToolBarSeparatorExtent,&opt,this); -#else int extent = style().pixelMetric(TQStyle::PM_DockWindowSeparatorExtent,this); -#endif if(m_pToolBar->orientation() == Qt::Horizontal)return TQSize(extent,0); else return TQSize(0,extent); } @@ -81,15 +64,9 @@ TQSize KviCustomToolBarSeparator::sizeHint() const void KviCustomToolBarSeparator::paintEvent(TQPaintEvent *) { TQPainter p(this); -#ifdef COMPILE_USE_QT4 - TQStyleOption opt; - opt.initFrom(this); - style()->drawPrimitive(TQStyle::PE_Q3DockWindowSeparator,&opt,&p,this); -#else TQStyle::SFlags flags = TQStyle::Style_Default; if(m_pToolBar->orientation() == Qt::Horizontal)flags |= TQStyle::Style_Horizontal; style().tqdrawPrimitive(TQStyle::PE_DockWindowSeparator,&p,rect(),colorGroup(),flags); -#endif } @@ -170,14 +147,6 @@ void KviCustomToolBar::beginCustomize() m_pFilteredChildren = new KviPointerHashTable<void *,bool>; m_pFilteredChildren->setAutoDelete(true); // filter the events for all the children -#ifdef COMPILE_USE_QT4 - TQPtrList<TQObject*> l = children(); - for(TQPtrList<TQObject*>::Iterator it = l.begin();it != l.end();++it) - { - if((*it)->isWidgetType()) - filterChild(*it); - } -#else const TQObjectList l = childrenListObject(); TQObjectListIterator it(l); while(TQObject * o = it.current()) @@ -186,20 +155,11 @@ void KviCustomToolBar::beginCustomize() filterChild(o); ++it; } -#endif } void KviCustomToolBar::endCustomize() { // stop filtering events -#ifdef COMPILE_USE_QT4 - TQPtrList<TQObject*> l = children(); - for(TQPtrList<TQObject*>::Iterator it = l.begin();it != l.end();++it) - { - if((*it)->isWidgetType()) - unfilterChild(*it); - } -#else const TQObjectList l = childrenListObject(); TQObjectListIterator it(l); while(TQObject * o = it.current()) @@ -208,7 +168,6 @@ void KviCustomToolBar::endCustomize() unfilterChild(o); ++it; } -#endif // FIXME: We SHOULD MAKE SURE that the children are re-enabled... // this could be done by calling setEnabled(isEnabled()) on each action ? if(m_pFilteredChildren) @@ -272,30 +231,12 @@ void KviCustomToolBar::dragEnterEvent(TQDragEnterEvent *e) e->accept(true); int idx = dropIndexAt(mapFromGlobal(TQCursor::pos()),0,0); m_pDraggedChild = a->addToCustomToolBar(this); -#ifdef COMPILE_USE_QT4 - TQWidget * pWidgetToMove = widgetAt(idx); - bool bDone = false; - TQAction * a; - if(pWidgetToMove) - { - a = actionForWidget(pWidgetToMove); - if(a) - { - bDone = true; - a = insertWidget(a,m_pDraggedChild); - } - } - if(!bDone) - a = addWidget(m_pDraggedChild); - a->setVisible(true); -#else boxLayout()->remove(m_pDraggedChild); // in case it was already added boxLayout()->insertWidget(idx,m_pDraggedChild); #ifdef COMPILE_TDE_SUPPORT // bleah :///// insertWidget(-1,m_pDraggedChild->sizeHint().width(),m_pDraggedChild,idx); #endif -#endif TQEvent ev(TQEvent::LayoutHint); TQApplication::sendEvent(this,&ev); } else e->accept(false); @@ -333,11 +274,7 @@ int KviCustomToolBar::dropIndexAt(const TQPoint &pnt,TQWidget * exclude,int * ex // find the widget at the current poisition // treating exclude as if it was going to be removed // find also the exclude index if needed -#ifdef COMPILE_USE_QT4 - TQLayout * l = layout(); -#else TQBoxLayout * l = boxLayout(); -#endif TQLayoutItem * i = 0; if(excludeIdx)*excludeIdx = -1; int idx = 0; @@ -450,24 +387,6 @@ int KviCustomToolBar::dropIndexAt(const TQPoint &pnt,TQWidget * exclude,int * ex } -#ifdef COMPILE_USE_QT4 -TQWidget * KviCustomToolBar::widgetAt(int index) -{ - TQLayout * l = layout(); - if(!l) - return NULL; - TQLayoutItem * it = l->itemAt(index); - if(!it) - return NULL; - return it->widget(); -} - -TQAction * KviCustomToolBar::actionForWidget(TQWidget * pWidget) -{ - return actionAt(pWidget->x() + 1,pWidget->y() + 1); -} - -#endif void KviCustomToolBar::drag(TQWidget * child,const TQPoint &pnt) { @@ -476,41 +395,12 @@ void KviCustomToolBar::drag(TQWidget * child,const TQPoint &pnt) tqDebug("DROP INDEX IS %d, ME IS %d",idx,me); if(idx == me) return; // would move over itself -#ifdef COMPILE_USE_QT4 - TQWidget * pWidgetToMove = widgetAt(idx > me ? idx-1 : idx); - tqDebug("SEARCHING FOR WIDGET TO MOVE AT %d AND FOUND %x (ME=%x)",idx > me ? idx-1 : idx,pWidgetToMove,child); - if(pWidgetToMove == child) - return; // hmmm - bool bDone = false; - TQAction * pMyOwnAction = actionForWidget(child); - if(!pMyOwnAction) - return; - TQAction * a; - removeAction(pMyOwnAction); - if(pWidgetToMove) - { - a = actionForWidget(pWidgetToMove); - if(a) - { - tqDebug("AND GOT ACTION FOR THAT WIDGET"); - - bDone = true; - a = insertWidget(a,child); - } - } else { - addAction(a); - } - if(!bDone) - a = addWidget(child); - a->setVisible(true); -#else boxLayout()->remove(child); boxLayout()->insertWidget(idx,child); #ifdef COMPILE_TDE_SUPPORT // bleah :///// insertWidget(-1,child->width(),child,idx); #endif -#endif TQEvent ev(TQEvent::LayoutHint); TQApplication::sendEvent(this,&ev); } @@ -587,69 +477,34 @@ bool KviCustomToolBar::eventFilter(TQObject *o,TQEvent *e) if((pnt.y() < 0) || (pnt.y() > height()) || (pnt.x() < 0) || (pnt.x() > width())) { // drag out! -// FIXME: This is screwed up in TQt4.... :/ -#ifdef COMPILE_USE_QT4 - TQDrag * d = new TQDrag(this); - TQMimeData * m = new TQMimeData(); - m->setText(m_pMovedChild->name()); - d->setMimeData(m); -#else TQDragObject * d = new TQTextDrag(m_pMovedChild->name(),this); -#endif KviAction * act = KviActionManager::instance()->getAction(m_pMovedChild->name()); if(act) { TQPixmap * pixie = act->bigIcon(); -#ifdef COMPILE_USE_QT4 - if(pixie) - { - d->setPixmap(*pixie); - d->setHotSpot(TQPoint(3,3)); - } -#else if(pixie)d->setPixmap(*pixie,TQPoint(3,3)); -#endif } //d->setPixmap(TQPixmap::grabWidget(m_pMovedChild),TQPoint(m_pMovedChild->width() / 2,m_pMovedChild->height() / 2)); // throw it somewhere else for now if(m_pFilteredChildren) unfilterChild(TQT_TQOBJECT(m_pMovedChild)); -#ifdef COMPILE_USE_QT4 - TQAction * pActionForMovedChild = actionForWidget(m_pMovedChild); - if(pActionForMovedChild) - pActionForMovedChild->setVisible(false); - m_pMovedChild->hide(); -#else m_pMovedChild->hide(); m_pMovedChild->reparent(g_pFrame,TQPoint(-1000,-1000),false); -#endif TQEvent ev(TQEvent::LayoutHint); TQApplication::sendEvent(this,&ev); -#ifdef COMPILE_USE_QT4 - if(!d->exec(TQt::MoveAction) != TQt::MoveAction) -#else if(!d->dragMove()) -#endif { // the user has probably failed to remove the action from the toolbar // flash the trashcan in the customize toolbars dialog KviActionManager::instance()->emitRemoveActionsHintRequest(); // will filter it as ChildInserted -#ifndef COMPILE_USE_QT4 m_pMovedChild->reparent(this,TQPoint(0,0),false); -#endif -#ifdef COMPILE_USE_QT4 - TQAction * pActionForMovedChild = actionForWidget(m_pMovedChild); - if(pActionForMovedChild) - pActionForMovedChild->setVisible(false); -#else boxLayout()->insertWidget(0,m_pMovedChild); m_pMovedChild->show(); #ifdef COMPILE_TDE_SUPPORT // bleah :///// insertWidget(-1,m_pMovedChild->width(),m_pMovedChild,0); #endif -#endif TQEvent ev(TQEvent::LayoutHint); TQApplication::sendEvent(this,&ev); } else { diff --git a/src/kvirc/ui/kvi_customtoolbar.h b/src/kvirc/ui/kvi_customtoolbar.h index b6dcc668..3a439fe2 100644 --- a/src/kvirc/ui/kvi_customtoolbar.h +++ b/src/kvirc/ui/kvi_customtoolbar.h @@ -73,10 +73,6 @@ protected: virtual void childEvent(TQChildEvent *e); virtual bool eventFilter(TQObject *o,TQEvent *e); int dropIndexAt(const TQPoint &pnt,TQWidget * exclude,int * excludeIdx); -#ifdef COMPILE_USE_QT4 - TQWidget * widgetAt(int index); - TQAction * actionForWidget(TQWidget * pWidget); -#endif void drag(TQWidget * child,const TQPoint &pnt); void filterChild(TQObject * o); void unfilterChild(TQObject * o); diff --git a/src/kvirc/ui/kvi_frame.cpp b/src/kvirc/ui/kvi_frame.cpp index 6cca7b8e..d5c08b09 100644 --- a/src/kvirc/ui/kvi_frame.cpp +++ b/src/kvirc/ui/kvi_frame.cpp @@ -71,21 +71,10 @@ #include <tqfile.h> #include <tqtextstream.h> -#ifdef COMPILE_USE_QT4 - #include <tq3dockarea.h> - #define TQDockArea Q3DockArea -#else #include <tqdockarea.h> -#endif -#ifdef COMPILE_USE_QT4 - #include <tqdesktopwidget.h> - #include <tqevent.h> - #include <TQShortcut> -#else #include <tqaccel.h> -#endif #include <time.h> @@ -131,16 +120,10 @@ KviFrame::KviFrame() // This theoretically had to exists before KviMdiManager (that uses enterSdiMode) m_pMenuBar = new KviMenuBar(this,"main_menu_bar"); -#ifdef COMPILE_USE_QT4 - setMenuWidget(m_pMenuBar); -#endif if(KVI_OPTION_BOOL(KviOption_boolStatusBarVisible)) { m_pStatusBar = new KviStatusBar(this); -#ifdef COMPILE_USE_QT4 - setStatusBar(m_pStatusBar); -#endif // torque: moved out of status bar constructor // because module init functions exectued in load() // couldn't access the status bar via g_pFrame->mainStatusBar() @@ -346,15 +329,6 @@ KviMexToolBar * KviFrame::moduleExtensionToolBar(int extensionId) KviAccel * KviFrame::installAccelerators(TQWidget * wnd) { TQWidget * pParent = wnd ? (TQWidget *)wnd : (TQWidget *)this; -#ifdef COMPILE_USE_QT4 - new TQShortcut(TQKeySequence(TQt::Key_Left + TQt::ALT),pParent,TQT_SLOT(switchToPrevWindow())); - new TQShortcut(TQKeySequence(TQt::Key_Right + TQt::ALT),pParent,TQT_SLOT(switchToNextWindow())); - new TQShortcut(TQKeySequence(TQt::Key_Up + TQt::CTRL),pParent,TQT_SLOT(maximizeWindow())); - new TQShortcut(TQKeySequence(TQt::Key_Down + TQt::CTRL),pParent,TQT_SLOT(minimizeWindow())); - new TQShortcut(TQKeySequence(TQt::Key_Escape +TQt::CTRL),pParent,TQT_SLOT(minimizeWindow())); - new TQShortcut(TQKeySequence(TQt::Key_Left + TQt::ALT + TQt::SHIFT),pParent,TQT_SLOT(switchToPrevWindowInContext())); - new TQShortcut(TQKeySequence(TQt::Key_Right + TQt::ALT + TQt::SHIFT),pParent,TQT_SLOT(switchToNextWindowInContext())); -#endif KviAccel *ac = new KviAccel(pParent); static int accel_table[] = { @@ -1060,13 +1034,8 @@ void KviFrame::toggleStatusBar() m_pStatusBar = new KviStatusBar(this); m_pStatusBar->load(); -#ifdef COMPILE_USE_QT4 - setStatusBar(m_pStatusBar); -#endif m_pStatusBar->show(); -#ifndef COMPILE_USE_QT4 setUpLayout(); -#endif //!COMPILE_USE_QT4 } } @@ -1168,11 +1137,7 @@ bool KviFrame::focusNextPrevChild(bool next) TQWidget * w = focusWidget(); if(w) { -#ifdef COMPILE_USE_QT4 - if(w->focusPolicy() == TQ_StrongFocus)return false; -#else if(w->focusPolicy() == TQ_StrongFocus)return false; -#endif //TQVariant v = w->property("KviProperty_FocusOwner"); //if(v.isValid())return false; // Do NOT change the focus widget! @@ -1204,13 +1169,9 @@ void KviFrame::saveToolBarPositions() TQFile f(szTemp); if(f.open(IO_WriteOnly | IO_Truncate)) { -#ifdef COMPILE_USE_QT4 - f.write(saveState(1)); -#else //!COMPILE_USE_QT4 TQTextStream ts(&f); ts << *this; f.close(); -#endif //!COMPILE_USE_QT4 } } @@ -1225,26 +1186,15 @@ void KviFrame::restoreToolBarPositions() if(f.open(IO_ReadOnly)) { -#ifdef COMPILE_USE_QT4 - if(!restoreState(f.readAll(),1)) - tqDebug("Error while restoring toolbars position"); -#else //!COMPILE_USE_QT4 TQTextStream ts(&f); ts >> *this; f.close(); -#endif //!COMPILE_USE_QT4 } else { bNeedDefaults = true; } if(m_pTaskBar->inherits("KviTreeTaskBar")) { -#ifdef COMPILE_USE_QT4 - // ensure that it is not too wide - m_pTaskBar->setMaximumWidth(600); - if(m_pTaskBar->width() > 600) - m_pTaskBar->setFixedWidth(250); -#else //!COMPILE_USE_QT4 TQDockArea * a = m_pTaskBar->area(); if((a == topDock()) || (a == bottomDock())) { @@ -1259,7 +1209,6 @@ void KviFrame::restoreToolBarPositions() // ensure that it is not too wide if(m_pTaskBar->width() > 600) m_pTaskBar->setFixedExtentWidth(250); -#endif //!COMPILE_USE_QT4 } /*else if(m_pTaskBar->inherits("KviClassicTaskBar")) { TQDockArea * a = m_pTaskBar->area(); @@ -1272,10 +1221,8 @@ void KviFrame::restoreToolBarPositions() } }*/ -#ifndef COMPILE_USE_QT4 if(bNeedDefaults) lineUpDockWindows(false); -#endif //!COMPILE_USE_QT4 } @@ -1284,27 +1231,15 @@ void KviFrame::createTaskBar() if(KVI_OPTION_BOOL(KviOption_boolUseTreeWindowListTaskBar)) { m_pTaskBar = new KviTreeTaskBar(); -#ifdef COMPILE_USE_QT4 - m_pTaskBar->setAllowedAreas(TQt::LeftDockWidgetArea | TQt::RightDockWidgetArea); - addDockWidget(TQt::LeftDockWidgetArea,m_pTaskBar); -#else //!COMPILE_USE_QT4 setDockEnabled(m_pTaskBar,TQt::DockTop,false); setDockEnabled(m_pTaskBar,TQt::DockBottom,false); -#endif //!COMPILE_USE_QT4 } else { m_pTaskBar = new KviClassicTaskBar(); -#ifdef COMPILE_USE_QT4 - m_pTaskBar->setAllowedAreas(TQt::AllDockWidgetAreas); - addDockWidget(TQt::BottomDockWidgetArea,m_pTaskBar); -#else //!COMPILE_USE_QT4 setDockEnabled(m_pTaskBar,TQt::DockTop,true); setDockEnabled(m_pTaskBar,TQt::DockBottom,true); -#endif //!COMPILE_USE_QT4 } -#ifndef COMPILE_USE_QT4 setDockEnabled(m_pTaskBar,TQt::DockLeft,true); setDockEnabled(m_pTaskBar,TQt::DockRight,true); -#endif //!COMPILE_USE_QT4 } void KviFrame::recreateTaskBar() @@ -1317,9 +1252,7 @@ void KviFrame::recreateTaskBar() { w->destroyTaskBarItem(); } -#ifndef COMPILE_USE_QT4 removeDockWindow(m_pTaskBar); -#endif //!COMPILE_USE_QT4 delete m_pTaskBar; createTaskBar(); for(w = m_pWinList->first();w;w = m_pWinList->next()) diff --git a/src/kvirc/ui/kvi_historywin.cpp b/src/kvirc/ui/kvi_historywin.cpp index 6e8219fb..d657c444 100644 --- a/src/kvirc/ui/kvi_historywin.cpp +++ b/src/kvirc/ui/kvi_historywin.cpp @@ -33,27 +33,16 @@ #include <tqnamespace.h> -#ifdef COMPILE_USE_QT4 - #include <tqevent.h> -#endif #include <ctype.h> extern KviInputHistory * g_pInputHistory; KviHistoryWindow::KviHistoryWindow() -#ifdef COMPILE_USE_QT4 -: KviTalListBox(0,TQt::Popup) -#else : KviTalListBox(0,TQt::WType_Popup) -#endif { m_pOwner = 0; -#ifdef COMPILE_USE_QT4 - setHScrollBarMode(Q3ScrollView::AlwaysOff); -#else setHScrollBarMode(TQScrollView::AlwaysOff); -#endif connect(this,TQT_SIGNAL(selected(const TQString &)),this,TQT_SLOT(itemSelected(const TQString &))); m_iTimerId = -1; diff --git a/src/kvirc/ui/kvi_imagedialog.cpp b/src/kvirc/ui/kvi_imagedialog.cpp index 03eeeee4..bb5d9416 100644 --- a/src/kvirc/ui/kvi_imagedialog.cpp +++ b/src/kvirc/ui/kvi_imagedialog.cpp @@ -281,11 +281,7 @@ void KviImageDialog::heartbeat() TQImage i(szPath); if(i.isNull())continue; TQPixmap pix; -#ifdef COMPILE_USE_QT4 - if((i.width() > 80) || (i.height() > 80))pix = i.scaled(80,80,TQt::KeepAspectRatio); -#else if((i.width() > 80) || (i.height() > 80))pix = i.scale(80,80,TQ_ScaleMin); -#endif else pix = i; TQString tip = szFile; diff --git a/src/kvirc/ui/kvi_input.cpp b/src/kvirc/ui/kvi_input.cpp index fe887135..095b5812 100644 --- a/src/kvirc/ui/kvi_input.cpp +++ b/src/kvirc/ui/kvi_input.cpp @@ -194,13 +194,8 @@ KviInputEditor::KviInputEditor(TQWidget * par,KviWindow *wnd,KviUserListView * v setInputMethodEnabled(true); -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); - setFocusPolicy(TQ_StrongFocus); -#else setBackgroundMode(TQt::NoBackground); setFocusPolicy(TQ_StrongFocus); -#endif setAcceptDrops(true); setFrameStyle( LineEditPanel ); setFrameShadow( Plain ); @@ -208,11 +203,7 @@ KviInputEditor::KviInputEditor(TQWidget * par,KviWindow *wnd,KviUserListView * v m_pIconMenu = new KviTalPopupMenu(); connect(m_pIconMenu,TQT_SIGNAL(activated(int)),this,TQT_SLOT(iconPopupActivated(int))); -#ifdef COMPILE_USE_QT4 - setCursor(TQt::IBeamCursor); -#else setCursor(IbeamCursor); -#endif } KviInputEditor::~KviInputEditor() @@ -301,31 +292,14 @@ TQSize KviInputEditor::sizeHint() const int h = TQMAX(fm.lineSpacing(), 14) + 2*2; /* innerMargin */ int w = fm.width( 'x' ) * 17; // "some" int m = frameWidth() * 2; -#ifdef COMPILE_USE_QT4 - TQStyleOption opt; - opt.initFrom(this); - return (style()->sizeFromContents(TQStyle::CT_LineEdit,&opt, - TQSize( w + m, h + m ). - expandedTo(TQApplication::globalStrut()),this)); -#else return (style().tqsizeFromContents(TQStyle::CT_LineEdit, this, TQSize( w + m, h + m ). expandedTo(TQApplication::globalStrut()))); -#endif } #define KVI_INPUT_DEF_BACK 100 #define KVI_INPUT_DEF_FORE 101 -#ifdef COMPILE_USE_QT4 -void KviInputEditor::paintEvent(TQPaintEvent *e) -{ - TQPainter p(this); - SET_ANTI_ALIASING(p); - drawFrame(&p); - drawContents(&p); -} -#endif void KviInputEditor::drawContents(TQPainter *p) { @@ -513,11 +487,7 @@ void KviInputEditor::drawContents(TQPainter *p) while(m_iBlockLen < m_iCursorPosition) { TQChar c = m_szTextBuffer.at(m_iBlockLen); -#ifdef COMPILE_USE_QT4 - m_iLastCursorXPosition+= c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c); -#else m_iLastCursorXPosition+= (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); -#endif m_iBlockLen++; } @@ -531,12 +501,7 @@ void KviInputEditor::drawContents(TQPainter *p) pa.setPen(KVI_OPTION_COLOR(KviOption_colorInputForeground)); } -#ifdef COMPILE_USE_QT4 - // The other version of drawPixmap seems to be buggy - p->drawPixmap(rect.x(),rect.y(),rect.width(),rect.height(),*pDoubleBufferPixmap,0,0,widgetWidth,widgetHeight); -#else p->drawPixmap(rect.x(),rect.y(),*pDoubleBufferPixmap,0,0,widgetWidth,widgetHeight); -#endif } void KviInputEditor::drawTextBlock(TQPainter * pa,TQFontMetrics & fm,int curXPos,int textBaseline,int charIdx,int len,bool bSelected) @@ -635,11 +600,7 @@ void KviInputEditor::extractNextBlock(int idx,TQFontMetrics & fm,int curXPos,int (c != TQChar(KVI_TEXT_ICON)))) { m_iBlockLen++; -#ifdef COMPILE_USE_QT4 - int xxx = c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; -#else int xxx = (c.unicode() < 256 ? g_iInputFontCharWidth[c.unicode()] : fm.width(c)); -#endif m_iBlockWidth +=xxx; curXPos +=xxx; idx++; @@ -785,11 +746,7 @@ void KviInputEditor::mousePressEvent(TQMouseEvent *e) { szClip = c->text(TQClipboard::Clipboard); -#ifdef COMPILE_USE_QT4 - int occ = szClip.count(TQChar('\n')); -#else int occ = szClip.contains(TQChar('\n')); -#endif if(!szClip.isEmpty()) { @@ -821,11 +778,7 @@ void KviInputEditor::mousePressEvent(TQMouseEvent *e) l->setFrameStyle(TQFrame::Raised | TQFrame::StyledPanel); l->setMargin(5); // FIXME: This does NOT work under TQt 4.x (they seem to consider it as bad UI design) -#ifndef COMPILE_USE_QT4 g_pInputPopup->insertItem(l); -#else - delete l; -#endif } } @@ -1229,10 +1182,7 @@ void KviInputEditor::focusInEvent(TQFocusEvent *) update(); } // XIM handling... -#ifndef COMPILE_USE_QT4 - // THIS SEEMS TO BE GONE IN TQt4.x ? (even if the documentation states that it *should* be there) setMicroFocusHint(1,1,width() - 2,height() - 2,true,0); -#endif } void KviInputEditor::focusOutEvent(TQFocusEvent *) @@ -1297,23 +1247,12 @@ void KviInputEditor::imComposeEvent(TQIMEvent *e) { // replace the old pre-edit string with e->text() m_bUpdatesEnabled = false; -#ifdef COMPILE_USE_QT4 - // TQt 4.x ?????????? - m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->commitString()); - - // update selection inside the pre-edit - m_iIMSelectionBegin = m_iIMStart + e->replacementStart(); - m_iIMSelectionLength = e->replacementLength(); - moveCursorTo(m_iIMSelectionBegin); - -#else m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->text()); // update selection inside the pre-edit m_iIMSelectionBegin = m_iIMStart + e->cursorPos(); m_iIMSelectionLength = e->selectionLength(); moveCursorTo(m_iIMSelectionBegin); -#endif // repaint @@ -1328,12 +1267,7 @@ void KviInputEditor::imEndEvent(TQIMEvent *e) { // replace the preedit area with the IM result text m_bUpdatesEnabled = false; -#ifdef COMPILE_USE_QT4 - // TQt 4.x ?????????? - m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->commitString()); -#else m_iIMLength = replaceSegment(m_iIMStart, m_iIMLength, e->text()); -#endif // move cursor to after the IM result text moveCursorTo(m_iIMStart + m_iIMLength); @@ -2074,19 +2008,11 @@ void KviInputEditor::moveRightFirstVisibleCharToShowCursor() TQChar c = m_szTextBuffer.at(m_iCursorPosition); -#ifdef COMPILE_USE_QT4 - m_iLastCursorXPosition += c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; -#else m_iLastCursorXPosition += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); -#endif while(m_iLastCursorXPosition >= contentsRect().width()-2*KVI_INPUT_MARGIN) { c = m_szTextBuffer.at(m_iFirstVisibleChar); -#ifdef COMPILE_USE_QT4 - m_iLastCursorXPosition -= c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; -#else m_iLastCursorXPosition -= (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); -#endif m_iFirstVisibleChar++; } } @@ -2117,11 +2043,7 @@ int KviInputEditor::charIndexFromXPosition(int xPos) while(curChar < bufLen) { TQChar c = m_szTextBuffer.at(curChar); -#ifdef COMPILE_USE_QT4 - int widthCh = c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; -#else int widthCh = (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); -#endif if(xPos < (curXPos+(widthCh/2)))return curChar; else if(xPos < (curXPos+widthCh))return (curChar+1); { @@ -2140,11 +2062,7 @@ int KviInputEditor::xPositionFromCharIndex(TQFontMetrics& fm,int chIdx,bool bCo while(curChar < chIdx) { TQChar c = m_szTextBuffer.at(curChar); -#ifdef COMPILE_USE_QT4 - curXPos += c.unicode() < 32 ? fm.width(getSubstituteChar(c.unicode())) + 3 : fm.width(c);; -#else curXPos += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : fm.width(c); -#endif curChar++; } return curXPos; @@ -2160,11 +2078,7 @@ int KviInputEditor::xPositionFromCharIndex(int chIdx,bool bContentsCoords) while(curChar < chIdx) { TQChar c = m_szTextBuffer.at(curChar); -#ifdef COMPILE_USE_QT4 - curXPos += c.unicode() < 32 ? g_pLastFontMetrics->width(getSubstituteChar(c.unicode())) + 3 : g_pLastFontMetrics->width(c); -#else curXPos += (c.unicode() < 256) ? g_iInputFontCharWidth[c.unicode()] : g_pLastFontMetrics->width(c); -#endif curChar++; } return curXPos; @@ -2325,11 +2239,6 @@ KviInput::KviInput(KviWindow *par,KviUserListView * view) m_pButtonContainer=new KviTalHBox(this); m_pButtonContainer->setSpacing(0); -#ifdef COMPILE_USE_QT4 - m_pButtonContainer->setSizePolicy(TQSizePolicy(TQSizePolicy::Minimum,TQSizePolicy::Preferred)); -// if(m_pButtonContainer->layout()) -// m_pButtonContainer->layout()->setSizeConstraint(TQLayout::SetMinimumSize); -#endif m_pHistoryButton = new KviStyledToolButton(m_pButtonContainer,"historybutton"); m_pHistoryButton->setUsesBigPixmap(false); @@ -2386,20 +2295,9 @@ KviInput::KviInput(KviWindow *par,KviUserListView * view) m_pInputEditor = new KviInputEditor(this,par,view); connect(m_pInputEditor,TQT_SIGNAL(enterPressed()),this,TQT_SLOT(inputEditorEnterPressed())); -#ifdef COMPILE_USE_QT4 - m_pInputEditor->setSizePolicy(TQSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Ignored)); -#else m_pInputEditor->setSizePolicy(TQSizePolicy(TQSizePolicy::Ignored,TQSizePolicy::Ignored)); -#endif -#ifdef COMPILE_USE_QT4 - m_pMultiEditorButton->setAutoRaise(true); - m_pCommandlineModeButton->setAutoRaise(true); - m_pIconButton->setAutoRaise(true); - m_pHistoryButton->setAutoRaise(true); - m_pHideToolsButton->setAutoRaise(true); -#endif pLayout->setStretchFactor(m_pInputEditor,100000); pLayout->setStretchFactor(m_pButtonContainer,0); @@ -2473,11 +2371,7 @@ void KviInput::keyPressEvent(TQKeyEvent *e) { if(szText[0] != '/') { -#ifdef COMPILE_USE_QT4 - int nLines = szText.count('\n') + 1; -#else int nLines = szText.contains('\n') + 1; -#endif if(nLines > 15) { int nRet = TQMessageBox::question( diff --git a/src/kvirc/ui/kvi_input.h b/src/kvirc/ui/kvi_input.h index 9be5fc08..45a8fcb9 100644 --- a/src/kvirc/ui/kvi_input.h +++ b/src/kvirc/ui/kvi_input.h @@ -71,9 +71,6 @@ public: void load(const char * filename); }; -#ifdef COMPILE_USE_QT4 - #define TQIMEvent TQInputMethodEvent -#endif class KVIRC_API KviInputEditor : public TQFrame { @@ -210,9 +207,6 @@ protected: virtual void imStartEvent(TQIMEvent *e); virtual void imComposeEvent(TQIMEvent *e); virtual void imEndEvent(TQIMEvent *e); -#ifdef COMPILE_USE_QT4 - virtual void paintEvent(TQPaintEvent *e); -#endif }; class KviScriptEditor; diff --git a/src/kvirc/ui/kvi_ipeditor.cpp b/src/kvirc/ui/kvi_ipeditor.cpp index ea0d94d6..bed11680 100644 --- a/src/kvirc/ui/kvi_ipeditor.cpp +++ b/src/kvirc/ui/kvi_ipeditor.cpp @@ -45,11 +45,7 @@ KviIpEditor::KviIpEditor(TQWidget * parent,AddressType addrType,const TQString & m_pEdit[7] = 0; setFrameStyle(TQFrame::Sunken|TQFrame::StyledPanel); -#ifdef COMPILE_USE_QT4 - setBackgroundRole(TQPalette::Base); -#else setBackgroundMode(TQWidget::PaletteBase); -#endif setAddressType(addrType); @@ -70,19 +66,11 @@ void KviIpEditor::setEnabled(bool bEnabled) if(i<7)if(m_pLabel[i]) { // Is this the right way ? -#ifdef COMPILE_USE_QT4 - m_pLabel[i]->setBackgroundRole(isEnabled() ? TQPalette::Base : TQPalette::Background); -#else m_pLabel[i]->setBackgroundMode(isEnabled() ? TQWidget::PaletteBase : TQWidget::PaletteBackground); -#endif m_pLabel[i]->setEnabled(bEnabled); } } -#ifdef COMPILE_USE_QT4 - setBackgroundRole(isEnabled() ? TQPalette::Base : TQPalette::Background); -#else setBackgroundMode(isEnabled() ? TQWidget::PaletteBase : TQWidget::PaletteBackground); -#endif } void KviIpEditor::setAddressType(AddressType addrType) @@ -219,11 +207,7 @@ void KviIpEditor::recreateChildren() m_pLabel[i]->setText(bIpV4 ? "." : ":"); m_pLabel[i]->show(); // Is this the right way ? setBackgroundMode seems to not work well -#ifdef COMPILE_USE_QT4 - m_pLabel[i]->setBackgroundRole(isEnabled() ? TQPalette::Base : TQPalette::Background); -#else m_pLabel[i]->setBackgroundMode(isEnabled() ? TQWidget::PaletteBase : TQWidget::PaletteBackground); -#endif } } // Kill the unused widgets , if any diff --git a/src/kvirc/ui/kvi_irctoolbar.cpp b/src/kvirc/ui/kvi_irctoolbar.cpp index 2f2a2377..5820a5f2 100644 --- a/src/kvirc/ui/kvi_irctoolbar.cpp +++ b/src/kvirc/ui/kvi_irctoolbar.cpp @@ -46,9 +46,6 @@ #include "kvi_tal_popupmenu.h" #include <tqlayout.h> -#ifdef COMPILE_USE_QT4 - #include <tqevent.h> -#endif #ifdef COMPILE_PSEUDO_TRANSPARENCY extern TQPixmap * g_pShadedChildGlobalDesktopBackground; @@ -68,11 +65,7 @@ KviToolBarGraphicalApplet::KviToolBarGraphicalApplet(TQWidget * par,const char * } g_pToolBarGraphicalAppletList->append(this); -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#else setBackgroundMode(TQWidget::NoBackground); -#endif setMouseTracking(true); m_bResizeMode = false; @@ -215,12 +208,7 @@ void KviToolBarGraphicalApplet::paintEvent(TQPaintEvent *e) pa.drawLine(1,height() - 1,width() - 1,height() - 1); pa.drawLine(width() - 1,1,width() - 1,height()); -#ifdef COMPILE_USE_QT4 - TQPainter qt4SucksBecauseItNeedsAnAdditionalTQPainter(this); - qt4SucksBecauseItNeedsAnAdditionalTQPainter.drawPixmap(e->rect().left(),e->rect().top(),e->rect().width(),e->rect().height(),*g_pIccMemBuffer,e->rect().left(),e->rect().top(),e->rect().width(),e->rect().height()); -#else bitBlt(this,e->rect().left(),e->rect().top(),g_pIccMemBuffer,e->rect().left(),e->rect().top(),e->rect().width(),e->rect().height(),TQt::CopyROP); -#endif } void KviToolBarGraphicalApplet::drawContents(TQPainter *) diff --git a/src/kvirc/ui/kvi_ircview.cpp b/src/kvirc/ui/kvi_ircview.cpp index 4cb54252..af2da64f 100644 --- a/src/kvirc/ui/kvi_ircview.cpp +++ b/src/kvirc/ui/kvi_ircview.cpp @@ -135,10 +135,6 @@ #include <time.h> -#ifdef COMPILE_USE_QT4 - #include <tq3mimefactory.h> - #define TQMimeSourceFactory Q3MimeSourceFactory -#endif #ifdef COMPILE_ON_WINDOWS @@ -280,11 +276,6 @@ KviIrcView::KviIrcView(TQWidget *parent,KviFrame *pFrm,KviWindow *pWnd) // Ok...here we go // initialize the initializable -#ifdef COMPILE_USE_QT4 - setAttribute(TQt::WA_NoSystemBackground); // This disables automatic qt double buffering - setAttribute(TQt::WA_OpaquePaintEvent); - //setAttribute(TQt::WA_PaintOnScreen); // disable qt backing store (that would force us to trigger repaint() instead of the 10 times faster paintEvent(0)) -#endif m_iFlushTimer = 0; m_pToolsPopup = 0; @@ -340,22 +331,14 @@ KviIrcView::KviIrcView(TQWidget *parent,KviFrame *pFrm,KviWindow *pWnd) m_pMessagesStoppedWhileSelecting->setAutoDelete(false); // say qt to avoid erasing on repaint -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#else setBackgroundMode(NoBackground); -#endif m_pFm = 0; // will be updated in the first paint event m_pToolTip = new KviIrcViewToolTip(this); // Create the scroll bar -#ifdef COMPILE_USE_QT4 - m_pScrollBar = new TQScrollBar(0,0,1,10,0,Qt::Vertical,this,"irc_view_scrollbar"); -#else m_pScrollBar = new TQScrollBar(0,0,1,10,0,Qt::Vertical,this,"irc_view_scrollbar"); -#endif m_pScrollBar->setTracking(true); m_pScrollBar->show(); @@ -363,12 +346,7 @@ KviIrcView::KviIrcView(TQWidget *parent,KviFrame *pFrm,KviWindow *pWnd) m_pToolsButton = new KviStyledToolButton(this,"btntools"); -#ifdef COMPILE_USE_QT4 - TQIcon is1(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUPMENU))); - m_pToolsButton->setAutoRaise(true); -#else TQIconSet is1(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_POPUPMENU)),TQIconSet::Small); -#endif m_pToolsButton->setIconSet(is1); KviTalToolTip::add(m_pToolsButton,__tr2qs("Search tools")); @@ -914,15 +892,7 @@ bool KviIrcView::event(TQEvent *e) void KviIrcView::wheelEvent(TQWheelEvent *e) { -#ifdef COMPILE_USE_QT4 - static bool bHere = false; - if(bHere)return; - bHere = true; // TQt4 tends to jump into infinite recursion here -#endif g_pApp->sendEvent(m_pScrollBar,e); -#ifdef COMPILE_USE_QT4 - bHere = false; -#endif } @@ -2739,9 +2709,6 @@ void KviIrcView::fastScroll(int lines) } else lines = 0; } -#ifdef COMPILE_USE_QT4 - scroll(0,-(heightToPaint-1),TQRect(1,1,widgetWidth-2,widgetHeight-2)); -#else bitBlt(this,1,1,this,1,heightToPaint,widgetWidth -2,widgetHeight - (heightToPaint + KVI_IRCVIEW_VERTICAL_BORDER)); TQRect r(0,widgetHeight - (heightToPaint + KVI_IRCVIEW_VERTICAL_BORDER), @@ -2750,7 +2717,6 @@ void KviIrcView::fastScroll(int lines) TQPaintEvent * e = new TQPaintEvent(r); paintEvent(e); delete e; -#endif if(m_iLastLinkRectHeight > -1) { @@ -2819,14 +2785,10 @@ void KviIrcView::paintEvent(TQPaintEvent *p) int rectWidth = r.width(); if(rectWidth > widgetWidth)rectWidth = widgetWidth; -#ifdef COMPILE_USE_QT4 - TQPainter pa(this); // we use qt4 double buffering -#else KviDoubleBuffer doublebuffer(width(),height()); TQPixmap * pDoubleBufferPixmap = doublebuffer.pixmap(); TQPainter pa(pDoubleBufferPixmap); -#endif SET_ANTI_ALIASING(pa); pa.setFont(font()); @@ -3325,17 +3287,9 @@ no_selection_paint: { // paint the cursor line int iH = lineWrapsHeight + m_iFontLineSpacing; -#ifdef COMPILE_USE_QT4 - pa.setCompositionMode(TQPainter::CompositionMode_SourceOut); -#else pa.setRasterOp(NotROP); -#endif pa.fillRect(0,curBottomCoord - iH,widgetWidth,iH + (m_iFontDescent << 1),TQt::black); -#ifdef COMPILE_USE_QT4 - pa.setCompositionMode(TQPainter::CompositionMode_SourceOver); -#else pa.setRasterOp(CopyROP); -#endif } if(m_bMouseIsDown) @@ -3357,11 +3311,7 @@ no_selection_paint: // visible! bLineMarkPainted = true; //pa.setRasterOp(NotROP); -#ifdef COMPILE_USE_QT4 - pa.setPen(TQPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,TQt::DotLine)); -#else pa.setPen(TQPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,TQPen::DotLine)); -#endif pa.drawLine(0,curBottomCoord,widgetWidth,curBottomCoord); //pa.setRasterOp(CopyROP); } // else was partially visible only @@ -3403,11 +3353,7 @@ no_selection_paint: // need to mark it! //pa.setRasterOp(NotROP); //pa.setPen(TQt::black); -#ifdef COMPILE_USE_QT4 - pa.setPen(TQPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,TQt::DotLine)); -#else pa.setPen(TQPen(KVI_OPTION_COLOR(KviOption_colorIrcViewMarkLine),1,TQPen::DotLine)); -#endif int x = widgetWidth - 8; int y = KVI_IRCVIEW_VERTICAL_BORDER; pa.drawLine(x,y,x,y); @@ -3430,10 +3376,7 @@ no_selection_paint: pa.drawLine(widgetWidth,1,widgetWidth,widgetHeight); // COPY TO THE DISPLAY -#ifndef COMPILE_USE_QT4 bitBlt(this,rectLeft,rectTop,pDoubleBufferPixmap,rectLeft,rectTop,rectWidth,rectHeight,TQt::CopyROP); -#endif -// else we use the TQt4 native double buffering } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/kvirc/ui/kvi_ircview.h b/src/kvirc/ui/kvi_ircview.h index 9ec3fb1f..88717dfa 100644 --- a/src/kvirc/ui/kvi_ircview.h +++ b/src/kvirc/ui/kvi_ircview.h @@ -56,7 +56,6 @@ class KVIRC_API KviIrcView : public TQWidget TQ_OBJECT TQ_PROPERTY(int TransparencyCapable READ dummyRead) - // we cannot #ifdef due to a bug in moc TQ_PROPERTY(bool usePaintOnScreen READ getPaintOnScreen WRITE setPaintOnScreen) public: friend class KviIrcViewToolTip; @@ -66,14 +65,8 @@ public: ~KviIrcView(); public: int dummyRead() const { return 0; }; -#ifdef COMPILE_USE_QT4 - bool getPaintOnScreen() const { return testAttribute(TQt::WA_PaintOnScreen);}; - void setPaintOnScreen(bool bFlag){setAttribute(TQt::WA_PaintOnScreen,bFlag);} ; -#else - // hack to fix moc bug on win qt4 bool getPaintOnScreen() const { return 0;}; void setPaintOnScreen(bool bFlag){} ; -#endif private: // TQDate m_lastLogDay; int m_iFlushTimer; diff --git a/src/kvirc/ui/kvi_ircviewtools.cpp b/src/kvirc/ui/kvi_ircviewtools.cpp index d60ba16b..bc517c19 100644 --- a/src/kvirc/ui/kvi_ircviewtools.cpp +++ b/src/kvirc/ui/kvi_ircviewtools.cpp @@ -42,11 +42,7 @@ #include <tqlabel.h> #include <tqcheckbox.h> #include <tqpushbutton.h> -#ifdef COMPILE_USE_QT4 - #include <tq3header.h> -#else #include <tqheader.h> -#endif #include <tqlineedit.h> #include <tqcursor.h> #include "kvi_accel.h" @@ -277,12 +273,7 @@ void KviIrcViewToolWidget::filterSave() void KviIrcViewToolWidget::forceRepaint() { - #if defined(COMPILE_USE_QT4) && defined(COMPILE_ON_WINDOWS) - m_pIrcView->repaint(); - #else m_pIrcView->paintEvent(0); - #endif - } void KviIrcViewToolWidget::setFindResult(const TQString & text) diff --git a/src/kvirc/ui/kvi_listview.cpp b/src/kvirc/ui/kvi_listview.cpp index 168db46f..334086c5 100644 --- a/src/kvirc/ui/kvi_listview.cpp +++ b/src/kvirc/ui/kvi_listview.cpp @@ -48,11 +48,7 @@ KviListView::~KviListView() void KviListView::setBackgroundOverlayPixmap(TQPixmap * pix,int iAlignmentFlags) { setStaticBackground(TRUE); -#ifdef COMPILE_USE_QT4 - viewport()->setAutoFillBackground(false); -#else viewport()->setBackgroundMode(TQWidget::NoBackground); -#endif m_pBackgroundOverlayPixmap=new TQPixmap(*pix); m_iBackgroundOverlayAlignment= TQt::AlignRight | TQt::AlignBottom; repaintContents(); @@ -112,9 +108,6 @@ void KviListView::drawContentsOffset(TQPainter * p,int ox,int oy,int cx,int cy,i // TQt's auto double buffering is buggy and can't be disabled... too bad :/ // - // The TQt source for the listview painting is also totally unreadable - // (maybe that's why they have thrown this cool widget away in TQt4: unmantainable) - // // Anyway, I've noticed that when double buffering is choosen (and // TQt seems to have a really complex logic to choose when to enable it // and when not) then the painter passed to paintCell() of the diff --git a/src/kvirc/ui/kvi_maskeditor.cpp b/src/kvirc/ui/kvi_maskeditor.cpp index d1205162..bb804eae 100644 --- a/src/kvirc/ui/kvi_maskeditor.cpp +++ b/src/kvirc/ui/kvi_maskeditor.cpp @@ -49,11 +49,7 @@ KviMaskItem::KviMaskItem(KviTalListView* parent,KviMaskEntry* entry) KviMaskItem::~KviMaskItem() { } -#ifdef COMPILE_USE_QT4 -int KviMaskItem::compare ( KviTalListViewItem * i, int col, bool ascending ) const -#else int KviMaskItem::compare ( TQListViewItem * i, int col, bool ascending ) const -#endif { if(col==2) { @@ -140,11 +136,7 @@ KviMaskEditor::KviMaskEditor(TQWidget * par,KviWindowToolPageButton* button,KviP w = w->parent(); } -#ifdef COMPILE_USE_QT4 setFocusPolicy(TQ_ClickFocus); -#else - setFocusPolicy(TQ_ClickFocus); -#endif TQGridLayout *g = new TQGridLayout(this,4,2,2,2); @@ -190,11 +182,7 @@ KviMaskEditor::KviMaskEditor(TQWidget * par,KviWindowToolPageButton* button,KviP g->addMultiCellWidget(l,2,2,0,1); m_pMaskBox = new KviTalListView(this); -#ifdef COMPILE_USE_QT4 - m_pMaskBox->setFocusPolicy(TQ_ClickFocus); -#else m_pMaskBox->setFocusPolicy(TQ_ClickFocus); -#endif m_pMaskBox->setFocusProxy(this); m_pMaskBox->setFrameStyle(TQFrame::StyledPanel|TQFrame::Sunken); m_pMaskBox->addColumn(__tr2qs("Mask")); @@ -209,11 +197,7 @@ KviMaskEditor::KviMaskEditor(TQWidget * par,KviWindowToolPageButton* button,KviP m_pRemoveMask = new TQPushButton(__tr2qs("Re&move"),this); m_pRemoveMask->setEnabled(isEnabled); -#ifdef COMPILE_USE_QT4 m_pRemoveMask->setFocusPolicy(TQ_ClickFocus); -#else - m_pRemoveMask->setFocusPolicy(TQ_ClickFocus); -#endif m_pRemoveMask->setFocusProxy(this); g->addWidget(m_pRemoveMask,4,1); connect(m_pRemoveMask,TQT_SIGNAL(clicked()),this,TQT_SLOT(removeClicked())); @@ -221,11 +205,7 @@ KviMaskEditor::KviMaskEditor(TQWidget * par,KviWindowToolPageButton* button,KviP m_pAddButton = new TQPushButton(__tr2qs("Add"),this); m_pAddButton->setEnabled(isEnabled); -#ifdef COMPILE_USE_QT4 - m_pAddButton->setFocusPolicy(TQ_ClickFocus); -#else m_pAddButton->setFocusPolicy(TQ_ClickFocus); -#endif m_pAddButton->setFocusProxy(this); g->addWidget(m_pAddButton,4,0); connect(m_pAddButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(addClicked())); diff --git a/src/kvirc/ui/kvi_maskeditor.h b/src/kvirc/ui/kvi_maskeditor.h index f15627b0..12ae4094 100644 --- a/src/kvirc/ui/kvi_maskeditor.h +++ b/src/kvirc/ui/kvi_maskeditor.h @@ -51,11 +51,7 @@ public: ~KviMaskItem(); KviMaskEntry* mask() { return &m_Mask; }; -#ifdef COMPILE_USE_QT4 - virtual int compare ( KviTalListViewItem * i, int col, bool ascending ) const; -#else virtual int compare ( TQListViewItem * i, int col, bool ascending ) const; -#endif protected: KviMaskEntry m_Mask; diff --git a/src/kvirc/ui/kvi_mdicaption.cpp b/src/kvirc/ui/kvi_mdicaption.cpp index 7f57350a..f3a06f49 100644 --- a/src/kvirc/ui/kvi_mdicaption.cpp +++ b/src/kvirc/ui/kvi_mdicaption.cpp @@ -45,13 +45,7 @@ #include <tqstyle.h> #include <tqpainter.h> #include "kvi_tal_popupmenu.h" -#ifdef COMPILE_USE_QT4 - #include <tq3simplerichtext.h> - #define TQSimpleRichText Q3SimpleRichText - #include <tqstyleoption.h> -#else #include <tqsimplerichtext.h> -#endif #include <tqdrawutil.h> #include <tqevent.h> @@ -68,34 +62,17 @@ KviMdiCaptionButton::~KviMdiCaptionButton() } -#ifdef COMPILE_USE_QT4 -void KviMdiCaptionButton::paintEvent(TQPaintEvent *e) -{ - TQPainter painter(this); - drawButton(&painter); -} -#endif void KviMdiCaptionButton::drawButton(TQPainter *p) { -#ifdef COMPILE_USE_QT4 - TQBrush b(parentWidget()->palette().window()); -#else TQBrush b(parentWidget()->colorGroup().background()); -#endif if(isDown()) qDrawShadePanel(p,0,0,width(),height(),colorGroup(),true,1,&b); else p->fillRect(0,0,width(),height(),b); -#ifdef COMPILE_USE_QT4 - int x = (width() - 16) / 2; - int y = (width() - 16) / 2; - p->drawPixmap(x,y,16,16,icon().pixmap(16,16),0,0,16,16); -#else drawButtonLabel(p); -#endif } @@ -120,9 +97,6 @@ KviMdiCaption::KviMdiCaption(KviMdiChild * parent,const char * name) m_bMouseGrabbed = true; m_bActive = false; calcLineSpacing(); -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#endif } KviMdiCaption::~KviMdiCaption() @@ -172,11 +146,7 @@ void KviMdiCaption::mousePressEvent(TQMouseEvent *e) { m_bMouseGrabbed = true; m_lastMousePos = TQCursor::pos(); -#ifdef COMPILE_USE_QT4 - setCursor(TQt::SizeAllCursor); -#else setCursor(TQCursor::sizeAllCursor); -#endif ((KviMdiChild *)parent())->activate(true); } @@ -235,11 +205,7 @@ void KviMdiCaption::paintEvent(TQPaintEvent * e) void KviMdiCaption::mouseReleaseEvent(TQMouseEvent *) { m_bMouseGrabbed = false; -#ifdef COMPILE_USE_QT4 - setCursor(TQt::arrowCursor); -#else setCursor(TQCursor::arrowCursor); -#endif // releaseMouse(); } diff --git a/src/kvirc/ui/kvi_mdicaption.h b/src/kvirc/ui/kvi_mdicaption.h index 6fdfe89a..f1101937 100644 --- a/src/kvirc/ui/kvi_mdicaption.h +++ b/src/kvirc/ui/kvi_mdicaption.h @@ -43,9 +43,6 @@ public: ~KviMdiCaptionButton(); protected: virtual void drawButton(TQPainter * p); -#ifdef COMPILE_USE_QT4 - virtual void paintEvent(TQPaintEvent *e); -#endif }; diff --git a/src/kvirc/ui/kvi_mdichild.cpp b/src/kvirc/ui/kvi_mdichild.cpp index caa8f648..1ca11846 100644 --- a/src/kvirc/ui/kvi_mdichild.cpp +++ b/src/kvirc/ui/kvi_mdichild.cpp @@ -44,16 +44,11 @@ #include <tqstyle.h> #include <tqpainter.h> #include "kvi_tal_popupmenu.h" -#ifndef COMPILE_USE_QT4 - #include <tqobjectlist.h> -#endif +#include <tqobjectlist.h> #include <tqevent.h> #ifdef Q_OS_MACX #include "kvi_app.h" //Needed for g_pApp -#ifdef COMPILE_USE_QT4 - #include <TQDesktopWidget> -#endif #endif #ifdef COMPILE_PSEUDO_TRANSPARENCY @@ -92,9 +87,6 @@ KviMdiChild::KviMdiChild(KviMdiManager * par,const char * name) setMouseTracking(true); setMinimumSize(KVI_MDICHILD_MIN_WIDTH,KVI_MDICHILD_MIN_HEIGHT); -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(true); -#endif } @@ -116,19 +108,11 @@ TQRect KviMdiChild::restoredGeometry() } -#ifdef COMPILE_USE_QT4 -void KviMdiChild::setBackgroundRole(TQPalette::ColorRole) -{ - // hack - TQFrame::setBackgroundRole(TQPalette::Window); -} -#else void KviMdiChild::setBackgroundMode(TQWidget::BackgroundMode) { // hack TQFrame::setBackgroundMode(TQWidget::PaletteBackground); } -#endif void KviMdiChild::setIcon(const TQPixmap &pix) { diff --git a/src/kvirc/ui/kvi_mdichild.h b/src/kvirc/ui/kvi_mdichild.h index 8964456c..175a61be 100644 --- a/src/kvirc/ui/kvi_mdichild.h +++ b/src/kvirc/ui/kvi_mdichild.h @@ -94,11 +94,7 @@ public slots: signals: void systemPopupRequest(const TQPoint & pnt); protected: -#ifdef COMPILE_USE_QT4 - virtual void setBackgroundRole(TQPalette::ColorRole); -#else virtual void setBackgroundMode(TQWidget::BackgroundMode bgmd); -#endif virtual void resizeEvent(TQResizeEvent *e); virtual void mousePressEvent(TQMouseEvent *e); virtual void mouseMoveEvent(TQMouseEvent *e); diff --git a/src/kvirc/ui/kvi_mdimanager.cpp b/src/kvirc/ui/kvi_mdimanager.cpp index daff2db1..a2485c1a 100644 --- a/src/kvirc/ui/kvi_mdimanager.cpp +++ b/src/kvirc/ui/kvi_mdimanager.cpp @@ -45,9 +45,6 @@ #include <tqdrawutil.h> #include <tqevent.h> -#ifdef COMPILE_USE_QT4 - #include "kvi_tal_hbox.h" -#endif #ifdef COMPILE_PSEUDO_TRANSPARENCY #include <tqpixmap.h> @@ -74,9 +71,6 @@ KviMdiManager::KviMdiManager(TQWidget * parent,KviFrame * pFrm,const char * name m_pSdiCloseButton = 0; m_pSdiRestoreButton = 0; m_pSdiMinimizeButton = 0; -#ifdef COMPILE_USE_QT4 - m_pSdiControls = 0; -#endif m_pWindowPopup = new KviTalPopupMenu(this); connect(m_pWindowPopup,TQT_SIGNAL(activated(int)),this,TQT_SLOT(menuActivated(int))); @@ -84,21 +78,12 @@ KviMdiManager::KviMdiManager(TQWidget * parent,KviFrame * pFrm,const char * name m_pTileMethodPopup = new KviTalPopupMenu(this); connect(m_pTileMethodPopup,TQT_SIGNAL(activated(int)),this,TQT_SLOT(tileMethodMenuActivated(int))); -#ifdef COMPILE_USE_QT4 - viewport()->setAutoFillBackground(false); -#else viewport()->setBackgroundMode(TQWidget::NoBackground); -#endif setStaticBackground(true); resizeContents(width(),height()); -#ifdef COMPILE_USE_QT4 - setFocusPolicy(TQ_NoFocus); - viewport()->setFocusPolicy(TQ_NoFocus); -#else setFocusPolicy(TQ_NoFocus); viewport()->setFocusPolicy(TQ_NoFocus); -#endif connect(g_pApp,TQT_SIGNAL(reloadImages()),this,TQT_SLOT(reloadImages())); } @@ -514,14 +499,7 @@ void KviMdiManager::updateSDIMode() { m_pSdiIconButton = new KviMenuBarToolButton(b,*pix,"nonne"); connect(m_pSdiIconButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(activeChildSystemPopup())); -#ifdef COMPILE_USE_QT4 - // This is an obscure, undocumented and internal function in QT4 TQMenuBar - // I won't be surprised if this disappears.... - b->setCornerWidget(m_pSdiIconButton,TQt::TopLeftCorner); - m_pSdiIconButton->show(); -#else m_iSdiIconItemId = b->insertItem(m_pSdiIconButton,-1,0); -#endif connect(m_pSdiIconButton,TQT_SIGNAL(destroyed()),this,TQT_SLOT(sdiIconButtonDestroyed())); } else { m_pSdiIconButton->setPixmap(*pix); @@ -557,49 +535,25 @@ void KviMdiManager::enterSDIMode(KviMdiChild *lpC) TQWidget * pButtonParent; -#ifdef COMPILE_USE_QT4 - m_pSdiControls = new KviTalHBox(b); - m_pSdiControls->setMargin(0); - m_pSdiControls->setSpacing(2); - m_pSdiControls->setAutoFillBackground(false); - pButtonParent = m_pSdiControls; -#else pButtonParent = b; -#endif m_pSdiMinimizeButton = new KviMenuBarToolButton(pButtonParent,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINIMIZE)),"btnminimize"); connect(m_pSdiMinimizeButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(minimizeActiveChild())); -#ifndef COMPILE_USE_QT4 m_iSdiMinimizeItemId = b->insertItem(m_pSdiMinimizeButton,-1,b->count()); -#endif connect(m_pSdiMinimizeButton,TQT_SIGNAL(destroyed()),this,TQT_SLOT(sdiMinimizeButtonDestroyed())); m_pSdiRestoreButton = new KviMenuBarToolButton(pButtonParent,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RESTORE)),"btnrestore"); connect(m_pSdiRestoreButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(restoreActiveChild())); -#ifndef COMPILE_USE_QT4 m_iSdiRestoreItemId = b->insertItem(m_pSdiRestoreButton,-1,b->count()); -#endif connect(m_pSdiRestoreButton,TQT_SIGNAL(destroyed()),this,TQT_SLOT(sdiRestoreButtonDestroyed())); m_pSdiCloseButton = new KviMenuBarToolButton(pButtonParent,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CLOSE)),"btnclose"); connect(m_pSdiCloseButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(closeActiveChild())); -#ifndef COMPILE_USE_QT4 m_iSdiCloseItemId = b->insertItem(m_pSdiCloseButton,-1,b->count()); -#endif connect(m_pSdiCloseButton,TQT_SIGNAL(destroyed()),this,TQT_SLOT(sdiCloseButtonDestroyed())); -#ifdef COMPILE_USE_QT4 - // This is an obscure, undocumented and internal function in QT4 TQMenuBar - // I won't be surprised if this disappears.... - b->setCornerWidget(m_pSdiControls,TQt::TopRightCorner); - // The show below SHOULD force a re-layout of the menubar.. - // but it doesn't work when the KviFrame is still hidden (at startup) - // We handle this BUG in showEvent() - m_pSdiControls->show(); -#else m_pSdiRestoreButton->show(); m_pSdiMinimizeButton->show(); m_pSdiCloseButton->show(); -#endif emit enteredSdiMode(); setVScrollBarMode(KviTalScrollView::AlwaysOff); @@ -610,19 +564,6 @@ void KviMdiManager::enterSDIMode(KviMdiChild *lpC) } void KviMdiManager::relayoutMenuButtons() { -#ifdef COMPILE_USE_QT4 - // force a re-layout of the menubar in TQt4 (see the note in enterSDIMode()) - // by resetting the corner widget - if(m_pSdiControls) - { - m_pFrm->mainMenuBar()->setCornerWidget(0,TQt::TopRightCorner); - m_pFrm->mainMenuBar()->setCornerWidget(m_pSdiControls,TQt::TopRightCorner); - } - // also force an activation of the top MdiChild since it probably didn't get it yet - KviMdiChild * c = topChild(); - if(c) - c->activate(false); -#endif } @@ -654,24 +595,10 @@ void KviMdiManager::leaveSDIMode() { __range_valid(m_pSdiCloseButton); -#ifdef COMPILE_USE_QT4 - if(m_pSdiControls) - { - delete m_pSdiControls; - m_pSdiControls = 0; - } - if(m_pSdiIconButton) - { - m_pSdiIconButton->hide(); // this will force a TQMenuBar relayout - delete m_pSdiIconButton; - m_pSdiIconButton = 0; - } -#else if(m_iSdiIconItemId != 0)m_pFrm->mainMenuBar()->removeItem(m_iSdiIconItemId); if(m_iSdiCloseItemId != 0)m_pFrm->mainMenuBar()->removeItem(m_iSdiCloseItemId); if(m_iSdiRestoreItemId != 0)m_pFrm->mainMenuBar()->removeItem(m_iSdiRestoreItemId); if(m_iSdiMinimizeItemId != 0)m_pFrm->mainMenuBar()->removeItem(m_iSdiMinimizeItemId); -#endif setVScrollBarMode(KviTalScrollView::Auto); setHScrollBarMode(KviTalScrollView::Auto); diff --git a/src/kvirc/ui/kvi_mdimanager.h b/src/kvirc/ui/kvi_mdimanager.h index 6691403d..a70e91df 100644 --- a/src/kvirc/ui/kvi_mdimanager.h +++ b/src/kvirc/ui/kvi_mdimanager.h @@ -82,9 +82,6 @@ protected: KviMenuBarToolButton * m_pSdiCloseButton; KviMenuBarToolButton * m_pSdiIconButton; -#ifdef COMPILE_USE_QT4 - KviTalHBox * m_pSdiControls; -#endif int m_iSdiIconItemId; int m_iSdiRestoreItemId; int m_iSdiMinimizeItemId; diff --git a/src/kvirc/ui/kvi_menubar.cpp b/src/kvirc/ui/kvi_menubar.cpp index f3b75441..0bf2c955 100644 --- a/src/kvirc/ui/kvi_menubar.cpp +++ b/src/kvirc/ui/kvi_menubar.cpp @@ -95,12 +95,6 @@ KviMenuBar::~KviMenuBar() void KviMenuBar::showEvent(TQShowEvent *e) { -#ifdef COMPILE_USE_QT4 - tqDebug("menubar show"); - // force a re-layout of the menubar in TQt4 (see the note in enterSDIMode()) - // by resetting the corner widget - m_pFrm->mdiManager()->relayoutMenuButtons(); -#endif } void KviMenuBar::addDefaultItem(const TQString &text,KviTalPopupMenu * pop) diff --git a/src/kvirc/ui/kvi_modeeditor.cpp b/src/kvirc/ui/kvi_modeeditor.cpp index d77c0f02..746bd57b 100644 --- a/src/kvirc/ui/kvi_modeeditor.cpp +++ b/src/kvirc/ui/kvi_modeeditor.cpp @@ -68,18 +68,10 @@ KviModeEditor::KviModeEditor(TQWidget * par,KviWindowToolPageButton* button,cons TQGridLayout *pMasterLayout = new TQGridLayout(this,2,1,2,2); -#ifdef COMPILE_USE_QT4 setFocusPolicy(TQ_ClickFocus); -#else - setFocusPolicy(TQ_ClickFocus); -#endif KviTalScrollView *pScrollView = new KviTalScrollView(this); -#ifdef COMPILE_USE_QT4 - pScrollView->viewport()->setBackgroundRole(TQPalette::Background); -#else pScrollView->viewport()->setBackgroundMode(TQWidget::PaletteBackground); -#endif pMasterLayout->addWidget(pScrollView,0,0); diff --git a/src/kvirc/ui/kvi_modew.cpp b/src/kvirc/ui/kvi_modew.cpp index e2af01b4..9210530c 100644 --- a/src/kvirc/ui/kvi_modew.cpp +++ b/src/kvirc/ui/kvi_modew.cpp @@ -40,11 +40,7 @@ KviModeWidget::KviModeWidget(TQWidget * par,KviChannel* chan,const char * name) m_pChannel=chan; m_pLabel=0; m_pLineEdit=0; -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#else setBackgroundMode(TQWidget::NoBackground); -#endif reset(); } diff --git a/src/kvirc/ui/kvi_optionswidget.cpp b/src/kvirc/ui/kvi_optionswidget.cpp index 82c1a83a..e267e7b8 100644 --- a/src/kvirc/ui/kvi_optionswidget.cpp +++ b/src/kvirc/ui/kvi_optionswidget.cpp @@ -73,11 +73,7 @@ void KviOptionsWidget::mergeTip(TQWidget * w,const TQString &tip) static TQString begin = "<table width=\"100%\" align=\"center\"><tr><td bgcolor=\"#fefef0\">"; static TQString mid = "</td></tr><tr><td>"; static TQString end = "</td></tr></table>"; -#ifdef COMPILE_USE_QT4 - TQString s = w->toolTip(); -#else TQString s = KviTalToolTip::textFor(w); -#endif if(s.isEmpty())KviTalToolTip::add(w,tip); else { TQString tmp = begin; @@ -628,9 +624,6 @@ void KviOptionsWidget::addRowSpacer(int x1,int y1,int x2,int y2) TQLabel * KviOptionsWidget::addLabel(int x1,int y1,int x2,int y2,const TQString & text,bool bEnabled) { TQLabel * l = new TQLabel(text,this); -#ifdef COMPILE_USE_QT4 - l->setWordWrap(true); -#endif l->setEnabled(bEnabled); addWidgetToLayout(l,x1,y1,x2,y2); return l; @@ -639,9 +632,6 @@ TQLabel * KviOptionsWidget::addLabel(int x1,int y1,int x2,int y2,const TQString TQLabel * KviOptionsWidget::addLabel(TQWidget * pParent,const TQString & text,bool bEnabled) { TQLabel * l = new TQLabel(text,pParent); -#ifdef COMPILE_USE_QT4 - l->setWordWrap(true); -#endif l->setEnabled(bEnabled); return l; } @@ -662,11 +652,7 @@ TQFrame * KviOptionsWidget::addSeparator(int x1,int y1,int x2,int y2) return f; } -#ifdef COMPILE_USE_QT4 -KviTalGroupBox * KviOptionsWidget::addGroupBox(int x1,int y1,int x2,int y2,int nStrips,Qt::Orientation o,const TQString &txt,bool bEnabled) -#else KviTalGroupBox * KviOptionsWidget::addGroupBox(int x1,int y1,int x2,int y2,int nStrips,KviTalGroupBox::Orientation o,const TQString &txt,bool bEnabled) -#endif { KviTalGroupBox * g = new KviTalGroupBox(nStrips,o,txt,this); g->setEnabled(bEnabled); diff --git a/src/kvirc/ui/kvi_optionswidget.h b/src/kvirc/ui/kvi_optionswidget.h index ff5fde5e..ebb44d1b 100644 --- a/src/kvirc/ui/kvi_optionswidget.h +++ b/src/kvirc/ui/kvi_optionswidget.h @@ -135,11 +135,7 @@ public: TQLabel * addLabel(int x1,int y1,int x2,int y2,const TQString & text,bool bEnabled = true); TQLabel * addLabel(TQWidget * pParent,const TQString & text,bool bEnabled = true); TQLineEdit * addLineEdit(int x1,int y1,int x2,int y2,bool bEnabled = true); -#ifdef COMPILE_USE_QT4 - KviTalGroupBox * addGroupBox(int x1,int y1,int x2,int y2,int nStrips,Qt::Orientation o,const TQString &txt,bool bEnabled = true); -#else KviTalGroupBox * addGroupBox(int x1,int y1,int x2,int y2,int nStrips,KviTalGroupBox::Orientation o,const TQString &txt,bool bEnabled = true); -#endif TQFrame * addSeparator(int x1,int y1,int x2,int y2); void addRowSpacer(int x1,int y1,int x2,int y2); diff --git a/src/kvirc/ui/kvi_query.cpp b/src/kvirc/ui/kvi_query.cpp index 2c1e1b81..338a66c5 100644 --- a/src/kvirc/ui/kvi_query.cpp +++ b/src/kvirc/ui/kvi_query.cpp @@ -85,11 +85,7 @@ KviQuery::KviQuery(KviFrame * lpFrm,KviConsole * lpConsole,const TQString &nick) createTextEncodingButton(m_pButtonGrid); -#ifdef COMPILE_USE_QT4 m_pSplitter = new TQSplitter(Qt::Horizontal,this,"main_splitter"); -#else - m_pSplitter = new TQSplitter(Qt::Horizontal,this,"main_splitter"); -#endif m_pIrcView = new KviIrcView(m_pSplitter,lpFrm,this); connect(m_pIrcView,TQT_SIGNAL(rightClicked()),this,TQT_SLOT(textViewRightClicked())); //m_pEditorsContainer= new KviToolWindowsContainer(m_pSplitter); diff --git a/src/kvirc/ui/kvi_selectors.cpp b/src/kvirc/ui/kvi_selectors.cpp index 22335ca2..4a9697f2 100644 --- a/src/kvirc/ui/kvi_selectors.cpp +++ b/src/kvirc/ui/kvi_selectors.cpp @@ -625,11 +625,7 @@ KviMircTextColorSelector::KviMircTextColorSelector(TQWidget * par,const TQString { TQPixmap tmp(120,16); tmp.fill(KVI_OPTION_MIRCCOLOR(i)); -#ifdef COMPILE_USE_QT4 - int id = m_pForePopup->insertItem(tmp,TQString("x")); -#else int id = m_pForePopup->insertItem(tmp); -#endif m_pForePopup->setItemParameter(id,i); } m_pContextPopup->insertItem(__tr2qs("Foreground"),m_pForePopup); @@ -642,11 +638,7 @@ KviMircTextColorSelector::KviMircTextColorSelector(TQWidget * par,const TQString { TQPixmap tmp(120,16); tmp.fill(KVI_OPTION_MIRCCOLOR(i)); -#ifdef COMPILE_USE_QT4 - int id = m_pForePopup->insertItem(tmp,TQString("x")); -#else int id = m_pBackPopup->insertItem(tmp); -#endif m_pBackPopup->setItemParameter(id,i); } m_pContextPopup->insertItem(__tr2qs("Background"),m_pBackPopup); diff --git a/src/kvirc/ui/kvi_splash.cpp b/src/kvirc/ui/kvi_splash.cpp index d3783c09..7fac1579 100644 --- a/src/kvirc/ui/kvi_splash.cpp +++ b/src/kvirc/ui/kvi_splash.cpp @@ -31,9 +31,6 @@ #include "kvi_fileutils.h" #include <tqsplashscreen.h> -#ifdef COMPILE_USE_QT4 - #include <tqdesktopwidget.h> -#endif #include <tqpixmap.h> #include <tqpainter.h> @@ -107,14 +104,6 @@ KviSplashScreen::KviSplashScreen() connect(m_pTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(suicide())); delete pix; -#ifdef COMPILE_USE_QT4 - setWindowOpacity(0); - m_bIncreasing=true; - m_rTransparency=0; - m_pFadeTimer= new TQTimer(this); - connect(m_pFadeTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(fadeTimerShot())); - m_pFadeTimer->start(6); -#endif } // We don't need messages on the splash: they just add work to the translators and nobody can read them anyway :D @@ -145,20 +134,10 @@ void KviSplashScreen::hideEvent(TQHideEvent *e) void KviSplashScreen::setProgress(int progress) { -#ifdef COMPILE_USE_QT4 - TQPixmap slowTQt4Copy = pixmap(); - TQPainter painter(&slowTQt4Copy); - TQSize size = slowTQt4Copy.size(); - int w = (m_pOverlay->width() * progress) / 100; - painter.drawPixmap(0,size.height() - m_pOverlay->height(),w,m_pOverlay->height(),*m_pOverlay,0,0,w,m_pOverlay->height()); - painter.end(); - setPixmap(slowTQt4Copy); -#else TQPainter painter(pixmap()); TQSize size = pixmap()->size(); painter.drawPixmap(0,size.height() - m_pOverlay->height(),*m_pOverlay,0,0,(m_pOverlay->width() * progress) / 100,m_pOverlay->height()); painter.end(); -#endif //raise(); repaint(); g_pApp->processEvents(); //damn... @@ -168,16 +147,11 @@ void KviSplashScreen::setProgress(int progress) void KviSplashScreen::die() { -#ifdef COMPILE_USE_QT4 - m_bIncreasing = false; - m_pFadeTimer->start(6); -#else TQTime now = TQTime::currentTime(); int mSecs = m_creationTime.msecsTo(now); int mRemaining = KVI_SPLASH_SCREEN_MINIMUM_TIMEOUT_IN_MSECS - mSecs; if(mRemaining < 0)mRemaining = 0; m_pTimer->start(mRemaining,true); -#endif } @@ -193,29 +167,6 @@ void KviSplashScreen::suicide() void KviSplashScreen::fadeTimerShot() { -#ifdef COMPILE_USE_QT4 - if(m_bIncreasing) - { - m_rTransparency+=0.05; - setWindowOpacity(m_rTransparency); - if(m_rTransparency>=1) - { - m_pFadeTimer->stop(); - m_bIncreasing=false; - } - - - } else { - m_rTransparency-=0.02; - setWindowOpacity(m_rTransparency); - if(m_rTransparency<=0) - { - m_pFadeTimer->stop(); - m_bIncreasing=true; - suicide(); - } - } -#endif } diff --git a/src/kvirc/ui/kvi_splash.h b/src/kvirc/ui/kvi_splash.h index 5040aa59..b9990e5a 100644 --- a/src/kvirc/ui/kvi_splash.h +++ b/src/kvirc/ui/kvi_splash.h @@ -47,11 +47,6 @@ private: TQTimer * m_pTimer; TQTime m_creationTime; TQPixmap * m_pOverlay; -#ifdef COMPILE_USE_QT4 - bool m_bIncreasing; - qreal m_rTransparency; - TQTimer * m_pFadeTimer; -#endif protected: virtual void showEvent(TQShowEvent * e); virtual void hideEvent(TQHideEvent * e); diff --git a/src/kvirc/ui/kvi_statusbar.cpp b/src/kvirc/ui/kvi_statusbar.cpp index fde4914c..2ddb64a6 100644 --- a/src/kvirc/ui/kvi_statusbar.cpp +++ b/src/kvirc/ui/kvi_statusbar.cpp @@ -49,9 +49,6 @@ #include "kvi_tal_popupmenu.h" #include <tqpixmap.h> -#ifdef COMPILE_USE_QT4 - #include <tqevent.h> -#endif // This class COULD be derived also from KStatusBar but in fact // it adds no graphic functionality and it has only useless methods for us. @@ -105,11 +102,7 @@ KviStatusBar::KviStatusBar(KviFrame * pFrame) m_pMessageLabel = new TQLabel("<b>[x]</b> x",this,"msgstatuslabel"); m_pMessageLabel->setMargin(1); -#ifdef COMPILE_USE_QT4 - m_pMessageLabel->setAlignment(TQt::AlignVCenter | TQt::AlignLeft); -#else m_pMessageLabel->setAlignment(SingleLine | TQt::AlignVCenter | TQt::AlignLeft); -#endif m_pMessageLabel->setMinimumWidth(350); m_iLastMinimumHeight = 0; @@ -341,12 +334,9 @@ void KviStatusBar::contextPopupAboutToShow() TQString tmp; KviTQString::sprintf(tmp,"<center><b>%Q</b></center>",&app); -#ifndef COMPILE_USE_QT4 - // FIXME: This is not supported under TQt4.. :( TQLabel * l = new TQLabel(tmp,m_pContextPopup); l->setFrameStyle(TQFrame::Raised | TQFrame::StyledPanel); m_pContextPopup->insertItem(l); -#endif m_pClickedApplet->fillContextPopup(m_pContextPopup); @@ -486,11 +476,7 @@ void KviStatusBar::mousePressEvent(TQMouseEvent * e) m_pClickedApplet = appletAt(mapToGlobal(e->pos())); if(!m_pClickedApplet)return; m_pClickedApplet->select(); -#ifdef COMPILE_USE_QT4 - g_pApp->setOverrideCursor(TQt::SizeAllCursor); -#else g_pApp->setOverrideCursor(sizeAllCursor); -#endif } } diff --git a/src/kvirc/ui/kvi_statusbarapplet.cpp b/src/kvirc/ui/kvi_statusbarapplet.cpp index bc8fa023..87cf49fe 100644 --- a/src/kvirc/ui/kvi_statusbarapplet.cpp +++ b/src/kvirc/ui/kvi_statusbarapplet.cpp @@ -47,9 +47,6 @@ #include <tqcursor.h> #include "kvi_tal_popupmenu.h" #include <tqpixmap.h> -#ifdef COMPILE_USE_QT4 - #include <tqevent.h> -#endif // This class COULD be derived also from KStatusBar but in fact // it adds no graphic functionality and it has only useless methods for us. @@ -138,15 +135,9 @@ void KviStatusBarApplet::paintEvent(TQPaintEvent * e) if(m_bSelected) { TQPainter p(this); -#ifdef COMPILE_USE_QT4 - p.setCompositionMode(TQPainter::CompositionMode_SourceOut); - p.fillRect(rect(),TQt::black); - p.setCompositionMode(TQPainter::CompositionMode_SourceOver); -#else p.setRasterOp(TQt::NotROP); p.fillRect(rect(),TQt::black); p.setRasterOp(TQt::CopyROP); -#endif } } diff --git a/src/kvirc/ui/kvi_styled_controls.cpp b/src/kvirc/ui/kvi_styled_controls.cpp index d32d5dda..c8299c64 100644 --- a/src/kvirc/ui/kvi_styled_controls.cpp +++ b/src/kvirc/ui/kvi_styled_controls.cpp @@ -27,7 +27,6 @@ #include "kvi_styled_controls.h" -#ifndef COMPILE_USE_QT4 #include "kvi_iconmanager.h" #include "kvi_app.h" @@ -370,4 +369,3 @@ void KviStyledToolButton::resizeEvent ( TQResizeEvent * e) #include "kvi_styled_controls.moc" -#endif diff --git a/src/kvirc/ui/kvi_styled_controls.h b/src/kvirc/ui/kvi_styled_controls.h index 736d9d3d..c061874e 100644 --- a/src/kvirc/ui/kvi_styled_controls.h +++ b/src/kvirc/ui/kvi_styled_controls.h @@ -27,14 +27,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - // we use internal TQt4 styles for now - #include <tqcheckbox.h> - #include <tqtoolbutton.h> - - #define KviStyledCheckBox TQCheckBox - #define KviStyledToolButton TQToolButton -#else #include <tqcheckbox.h> #include <tqtoolbutton.h> @@ -111,6 +103,5 @@ protected: virtual void resizeEvent ( TQResizeEvent * ) ; }; -#endif #endif diff --git a/src/kvirc/ui/kvi_taskbar.cpp b/src/kvirc/ui/kvi_taskbar.cpp index 2346eaa8..9396cc9e 100644 --- a/src/kvirc/ui/kvi_taskbar.cpp +++ b/src/kvirc/ui/kvi_taskbar.cpp @@ -55,16 +55,9 @@ #include "kvi_tal_popupmenu.h" #include <tqcursor.h> -#ifdef COMPILE_USE_QT4 - #include <tq3header.h> -#else #include <tqheader.h> -#endif #include <tqevent.h> -#ifdef COMPILE_USE_QT4 - #include <TQPaintEvent> -#endif #ifdef COMPILE_PSEUDO_TRANSPARENCY @@ -80,17 +73,9 @@ extern TQPixmap * g_pActivityMeterPixmap; // KviTaskBarBase::KviTaskBarBase() -#ifdef COMPILE_USE_QT4 -: TQDockWidget(__tr2qs("Taskbar"),g_pFrame) -#else : KviToolBar(__tr2qs("Taskbar"),TQT_DOCK_BOTTOM,false,"taskbar") -#endif { // FIXME: this timer should be started only if KVI_OPTION_BOOL(KviOption_boolUseTaskBarActivityMeter) -#ifdef COMPILE_USE_QT4 - setObjectName(__tr2qs("taskbar")); - setFeatures(TQDockWidget::DockWidgetMovable); -#endif //COMPILE_USE_QT4 m_pActivityMeterTimer = new TQTimer(); connect(m_pActivityMeterTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(updateActivityMeter())); m_pActivityMeterTimer->start(5000); @@ -258,18 +243,6 @@ void KviTaskBarButton::setActive(bool bActive) update(); } -#ifdef COMPILE_USE_QT4 -void KviTaskBarButton::paintEvent(TQPaintEvent * e) -{ - TQPainter p(this); - TQStyleOption opt; - opt.initFrom(this); - if(isOn()) - opt.state = TQStyle::State_On | TQStyle::State_Active; - style()->drawPrimitive(TQStyle::PE_PanelButtonTool,&opt,&p,this); - drawButtonLabel(&p); -} -#endif void KviTaskBarButton::drawButtonLabel(TQPainter * painter) { @@ -278,15 +251,11 @@ void KviTaskBarButton::drawButtonLabel(TQPainter * painter) int iWidth = distRect.width(); TQPainter * pPainter; -#ifdef COMPILE_USE_QT4 - pPainter = painter; -#else //!COMPILE_USE_QT4 KviDoubleBuffer db(iWidth,iHeight); TQPixmap * pMemBuffer = db.pixmap(); TQPainter p(pMemBuffer); bitBlt(pMemBuffer,0,0,painter->device(),distRect.x(),distRect.y(),iWidth,iHeight); pPainter = &p; -#endif //!COMPILE_USE_QT4 if(KVI_OPTION_BOOL(KviOption_boolUseTaskBarIrcContextIndicator)) { iHeight -= KVI_TASKBARBUTTON_CONTEXTINDICATORHEIGHT; @@ -405,10 +374,8 @@ void KviTaskBarButton::drawButtonLabel(TQPainter * painter) cRect.setWidth(cRect.width() + 10); pPainter->drawText(cRect,TQt::AlignLeft | TQt::AlignTop,szText,-1); } -#ifndef COMPILE_USE_QT4 pPainter->setClipping(FALSE); painter->drawPixmap(0,0,*pMemBuffer,distRect.x(),distRect.y(),iWidth,iHeight); -#endif } @@ -479,27 +446,18 @@ KviClassicTaskBar::KviClassicTaskBar() m_pBase = new TQWidget(this); // m_pBase->setBackgroundMode(NoBackground); -#ifdef COMPILE_USE_QT4 - setWidget(m_pBase); - - m_pBase->setMinimumWidth(KVI_TASKBAR_MIN_WIDTH); - setMinimumWidth(KVI_TASKBAR_MIN_WIDTH); -#else //!COMPILE_USE_QT4 setStretchableWidget(m_pBase); setVerticalStretchable(true); setHorizontalStretchable(true); -#endif //!COMPILE_USE_QT4 //m_pBase->setMinimumWidth(KVI_TASKBAR_MIN_WIDTH); //setMinimumWidth(KVI_TASKBAR_MIN_WIDTH); m_pBase->setMinimumHeight(m_iButtonHeight+5); setMinimumHeight(m_iButtonHeight+5); -#ifndef COMPILE_USE_QT4 setResizeEnabled( true ); connect(this,TQT_SIGNAL(orientationChanged(Qt::Orientation)),this,TQT_SLOT(orientationChangedSlot(Qt::Orientation))); -#endif } KviClassicTaskBar::~KviClassicTaskBar() @@ -510,9 +468,7 @@ KviClassicTaskBar::~KviClassicTaskBar() void KviClassicTaskBar::orientationChangedSlot(Qt::Orientation o) { -#ifndef COMPILE_USE_QT4 if (orientation() == Qt::Horizontal) m_pBase->setMinimumHeight(m_iButtonHeight); -#endif doLayout(); } @@ -655,30 +611,8 @@ void KviClassicTaskBar::doLayout() totCount -= btnsInRow; } -#ifdef COMPILE_USE_QT4 - if(isFloating() || ((g_pFrame->dockWidgetArea(this) != TQt::BottomDockWidgetArea) && (g_pFrame->dockWidgetArea(this) != TQt::TopDockWidgetArea))) - { - TQDockWidget::DockWidgetFeatures f = features(); - if(f & TQDockWidget::DockWidgetVerticalTitleBar) - { - f &= ~TQDockWidget::DockWidgetVerticalTitleBar; - setFeatures(f); - } - } else { - TQDockWidget::DockWidgetFeatures f = features(); - if(!(f & TQDockWidget::DockWidgetVerticalTitleBar)) - { - f |= TQDockWidget::DockWidgetVerticalTitleBar; - setFeatures(f); - } - } -#endif -#ifdef COMPILE_USE_QT4 - if ((width() > height()) && -#else if ((orientation() == Qt::Horizontal) && -#endif (((unsigned int)rows) > m_pBase->height() / m_iButtonHeight )) { rows = m_pBase->height() / m_iButtonHeight; @@ -709,11 +643,7 @@ void KviClassicTaskBar::doLayout() } if( KVI_OPTION_BOOL(KviOption_boolClassicTaskBarSetMaximumButtonWidth) && (theWidth > KVI_OPTION_UINT(KviOption_uintClassicTaskBarMaximumButtonWidth)) && -#ifdef COMPILE_USE_QT4 - (width() > height()) -#else (orientation() == Qt::Horizontal) -#endif ) theWidth = KVI_OPTION_UINT(KviOption_uintClassicTaskBarMaximumButtonWidth); @@ -741,15 +671,6 @@ void KviClassicTaskBar::applyOptions() void KviClassicTaskBar::resizeEvent(TQResizeEvent *e) { /* -#ifdef COMPILE_USE_QT4 - if(orientation() == Qt::Horizontal) - { - int iRows = height()/m_iButtonHeight; - if(!iRows) iRows=1; - tqDebug("%i %i",height(),iRows); - resize(width(),iRows*m_iButtonHeight); - } -#endif */ KviTaskBarBase::resizeEvent(e); doLayout(); @@ -881,11 +802,7 @@ void KviTreeTaskBarItem::setActive(bool bActive) } } -#ifdef COMPILE_USE_QT4 -void KviTreeTaskBarItem::paintBranches(TQPainter *p,const TQColorGroup &,int w,int y,int h) -#else void KviTreeTaskBarItem::paintBranches(TQPainter *p,const TQColorGroup &,int w,int y,int h,GUIStyle s) -#endif { SET_ANTI_ALIASING(*p); ((KviTreeTaskBarListView *)listView())->paintEmptyArea(p,TQRect(0,y,w,totalHeight() - height())); @@ -1222,14 +1139,10 @@ KviTreeTaskBar::KviTreeTaskBar() m_pListView->setAllColumnsShowFocus(true); m_pListView->setMultiSelection(false); -#ifdef COMPILE_USE_QT4 - setWidget(m_pListView); -#else //!COMPILE_USE_QT4 setStretchableWidget(m_pListView); setVerticalStretchable(true); setHorizontalStretchable(true); -#endif //!COMPILE_USE_QT4 // FIXME: this code is useless ? @@ -1246,17 +1159,9 @@ KviTreeTaskBar::KviTreeTaskBar() //setMaximumWidth(KVI_OPTION_UINT(KviOption_uintTreeTaskBarMaximumWidth)); //m_pListView->setMinimumWidth(KVI_OPTION_UINT(KviOption_uintTreeTaskBarMinimumWidth)); //m_pListView->setMaximumWidth(KVI_OPTION_UINT(KviOption_uintTreeTaskBarMaximumWidth)); -#ifdef COMPILE_USE_QT4 m_pListView->setFocusPolicy(TQ_NoFocus); -#else - m_pListView->setFocusPolicy(TQ_NoFocus); -#endif m_pListView->setStaticBackground(true); -#ifdef COMPILE_USE_QT4 - m_pListView->viewport()->setAutoFillBackground(false); -#else m_pListView->viewport()->setBackgroundMode(TQWidget::NoBackground); -#endif if(!KVI_OPTION_BOOL(KviOption_boolShowTreeTaskbarHeader)) { m_pListView->header()->hide(); @@ -1264,15 +1169,10 @@ KviTreeTaskBar::KviTreeTaskBar() m_pListView->header()->setResizeEnabled(true); -#ifdef COMPILE_USE_QT4 - setMaximumWidth(600); -#endif m_pListView->viewport()->installEventFilter(this); -#ifndef COMPILE_USE_QT4 setResizeEnabled(true); -#endif m_pToolTip = new KviDynamicToolTip(m_pListView->viewport(),"tree_taskbar_tooltip"); connect(m_pToolTip,TQT_SIGNAL(tipRequest(KviDynamicToolTip *,const TQPoint &)),this,TQT_SLOT(tipRequest(KviDynamicToolTip *,const TQPoint &))); diff --git a/src/kvirc/ui/kvi_taskbar.h b/src/kvirc/ui/kvi_taskbar.h index 2707e8b4..65041ea4 100644 --- a/src/kvirc/ui/kvi_taskbar.h +++ b/src/kvirc/ui/kvi_taskbar.h @@ -74,39 +74,11 @@ public: // This is the basic interface that all the external classes should see // -// Please note that TQt3 moc skips the *_SKIP_BEGIN -> *_SKIP_END blocks -// while the TQt4 moc skips the Q_MOC_RUN ifdef block.. so... - -// TQt4 version - -// If you get failures (undefined references) in some non-autotools based -// build system that uses TQt4 then you must add the -DCOMPILE_USE_QT4 -// commandline parameter to moc (at leat) when parsing this file. - -// MOC_SKIP_BEGIN -#ifdef COMPILE_USE_QT4 - -#include <TQDockWidget> - -class KVIRC_API KviTaskBarBase : public TQDockWidget -{ - TQ_OBJECT - -#endif //COMPILE_USE_QT4 -// MOC_SKIP_END - -// TQt3 version -#ifndef Q_MOC_RUN -#ifndef COMPILE_USE_QT4 - #include "kvi_toolbar.h" class KVIRC_API KviTaskBarBase : public KviToolBar { TQ_OBJECT - -#endif -#endif public: KviTaskBarBase(); @@ -155,9 +127,6 @@ protected: virtual void mousePressEvent(TQMouseEvent *e); virtual void contextMenuEvent(TQContextMenuEvent *e); virtual void drawButtonLabel(TQPainter *p); -#ifdef COMPILE_USE_QT4 - virtual void paintEvent(TQPaintEvent * e); -#endif public: virtual bool active(){ return m_bActive; }; virtual void highlight(int iLevel = 1); @@ -227,11 +196,7 @@ protected: public: virtual TQString key(int column,bool) const; virtual void paintCell(TQPainter *p,const TQColorGroup &cg,int column,int width,int alignment); -#ifdef COMPILE_USE_QT4 - virtual void paintBranches(TQPainter *p,const TQColorGroup &cg,int w,int y,int h); -#else virtual void paintBranches(TQPainter *p,const TQColorGroup &cg,int w,int y,int h,GUIStyle s); -#endif virtual void captionChanged(); virtual void highlight(int iLevel = 1); virtual void unhighlight(); diff --git a/src/kvirc/ui/kvi_texticonwin.cpp b/src/kvirc/ui/kvi_texticonwin.cpp index 636e39d1..ca0ee909 100644 --- a/src/kvirc/ui/kvi_texticonwin.cpp +++ b/src/kvirc/ui/kvi_texticonwin.cpp @@ -36,16 +36,9 @@ #include <tqnamespace.h> #include <tqlineedit.h> #include <ctype.h> -#ifdef COMPILE_USE_QT4 - #include <tqevent.h> -#endif KviTextIconWindow::KviTextIconWindow() -#ifdef COMPILE_USE_QT4 -: KviTalIconView(0,TQt::Popup) -#else : KviTalIconView(0,TQt::WType_Popup) -#endif { m_iTimerId = -1; setGridX ( 40 ); diff --git a/src/kvirc/ui/kvi_themedlabel.cpp b/src/kvirc/ui/kvi_themedlabel.cpp index ef54460f..5cb6254c 100644 --- a/src/kvirc/ui/kvi_themedlabel.cpp +++ b/src/kvirc/ui/kvi_themedlabel.cpp @@ -82,39 +82,6 @@ void KviThemedLabel::applyOptions() update(); } -#ifdef COMPILE_USE_QT4 -void KviThemedLabel::paintEvent ( TQPaintEvent * event ) -{ - TQFrame::paintEvent(event); - TQPainter p(this); - SET_ANTI_ALIASING(p); -#ifdef COMPILE_PSEUDO_TRANSPARENCY - if(g_pShadedChildGlobalDesktopBackground) - { - TQPoint pnt = mapToGlobal(contentsRect().topLeft()); - p.drawTiledPixmap(contentsRect(),*g_pShadedChildGlobalDesktopBackground,pnt); - } else { -#endif - - if(KVI_OPTION_PIXMAP(KviOption_pixmapLabelBackground).pixmap()) - { - p.drawTiledPixmap(contentsRect(),*(KVI_OPTION_PIXMAP(KviOption_pixmapLabelBackground).pixmap())); - } else { - p.fillRect(contentsRect(),KVI_OPTION_COLOR(KviOption_colorLabelBackground)); - } - -#ifdef COMPILE_PSEUDO_TRANSPARENCY - } -#endif - - TQRect r = contentsRect(); - r.setLeft(r.left() + 2); // some margin - - p.setPen(KVI_OPTION_COLOR(KviOption_colorLabelForeground)); - - p.drawText(r,TQt::AlignLeft | TQt::AlignVCenter,m_szText); -} -#else void KviThemedLabel::drawContents(TQPainter *p) { #ifdef COMPILE_PSEUDO_TRANSPARENCY @@ -143,7 +110,6 @@ void KviThemedLabel::drawContents(TQPainter *p) p->drawText(r,TQt::AlignLeft | TQt::AlignVCenter,m_szText); } -#endif void KviThemedLabel::mouseDoubleClickEvent(TQMouseEvent *) { diff --git a/src/kvirc/ui/kvi_themedlabel.h b/src/kvirc/ui/kvi_themedlabel.h index 7d79d060..49384227 100644 --- a/src/kvirc/ui/kvi_themedlabel.h +++ b/src/kvirc/ui/kvi_themedlabel.h @@ -41,11 +41,7 @@ private: TQString m_szText; bool m_bAutoHeight; protected: -#ifdef COMPILE_USE_QT4 - virtual void paintEvent ( TQPaintEvent * event ); -#else virtual void drawContents(TQPainter *p); -#endif virtual void mouseDoubleClickEvent(TQMouseEvent *e); public: int dummyRead() const { return 0; }; diff --git a/src/kvirc/ui/kvi_toolbar.cpp b/src/kvirc/ui/kvi_toolbar.cpp index 40cbcdfb..914d91b0 100644 --- a/src/kvirc/ui/kvi_toolbar.cpp +++ b/src/kvirc/ui/kvi_toolbar.cpp @@ -32,9 +32,6 @@ #include <tqcursor.h> #include "kvi_tal_popupmenu.h" -#ifdef COMPILE_USE_QT4 - #include <tqevent.h> -#endif static KviTalPopupMenu * g_pToolBarContextPopup = 0; static KviTalPopupMenu * g_pToolBarWindowsPopup = 0; @@ -102,12 +99,7 @@ void KviToolBar::mousePressEvent(TQMouseEvent *e) void KviToolBar::moveTo(TQT_TOOLBARDOCK_TYPE dock) { // FIXME: this should be hidden in Tal -#ifdef COMPILE_USE_QT4 - g_pFrame->removeToolBar(this); - g_pFrame->addToolBar(dock,this); -#else //!COMPILE_USE_QT4 g_pFrame->moveDockWindow(this,dock); -#endif //!COMPILE_USE_QT4 } void KviToolBar::moveToTop() diff --git a/src/kvirc/ui/kvi_toolwindows_container.cpp b/src/kvirc/ui/kvi_toolwindows_container.cpp index b45f7be4..0a2ec1a7 100644 --- a/src/kvirc/ui/kvi_toolwindows_container.cpp +++ b/src/kvirc/ui/kvi_toolwindows_container.cpp @@ -80,17 +80,11 @@ void KviWindowToolWidget::unregisterSelf() KviWindowToolPageButton::KviWindowToolPageButton ( int pixon,int pixoff, const TQString & text, TQWidget * parent,bool bOn, const char * name ) :TOOL_PAGE_PARENT(parent) { -#ifdef COMPILE_USE_QT4 - setFlat(true); - setObjectName("kvi_window_tool_button"); - setIcon(TQIcon(*(g_pIconManager->getSmallIcon(pixon)))); -#else TQIconSet is1; is1.setPixmap(*(g_pIconManager->getSmallIcon(pixon)),TQIconSet::Small,TQIconSet::Normal,TQIconSet::On); is1.setPixmap(*(g_pIconManager->getSmallIcon(pixoff)),TQIconSet::Small,TQIconSet::Normal,TQIconSet::Off); setIconSet(is1); setUsesBigPixmap(false); -#endif setToggleButton(true); setOn(bOn); diff --git a/src/kvirc/ui/kvi_toolwindows_container.h b/src/kvirc/ui/kvi_toolwindows_container.h index e3aa7f44..65e81c0e 100644 --- a/src/kvirc/ui/kvi_toolwindows_container.h +++ b/src/kvirc/ui/kvi_toolwindows_container.h @@ -46,11 +46,7 @@ protected: }; -#ifdef COMPILE_USE_QT4 - #define TOOL_PAGE_PARENT TQPushButton -#else #define TOOL_PAGE_PARENT KviStyledToolButton -#endif class KVIRC_API KviWindowToolPageButton : public TOOL_PAGE_PARENT diff --git a/src/kvirc/ui/kvi_topicw.cpp b/src/kvirc/ui/kvi_topicw.cpp index b7b845ad..6d46221a 100644 --- a/src/kvirc/ui/kvi_topicw.cpp +++ b/src/kvirc/ui/kvi_topicw.cpp @@ -89,17 +89,9 @@ KviTopicWidget::KviTopicWidget(TQWidget * par,const char * name) m_pContextPopup = 0; m_iCursorPosition = 0; m_pInput = 0; -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#else setBackgroundMode(TQWidget::NoBackground); -#endif reset(); -#ifdef COMPILE_USE_QT4 - m_pCompletionBox=new KviTalListBox(this,TQt::Popup); -#else m_pCompletionBox=new KviTalListBox(this,TQt::WType_Popup); -#endif m_pCompletionBox->setFont( font() ); m_pCompletionBox->setPalette( palette() ); // m_pCompletionBox->setVScrollBarMode( KviTalListBox::AlwaysOff ); @@ -411,14 +403,6 @@ void KviTopicWidget::paintColoredText(TQPainter *p, TQString text,const TQColorG } } -#ifdef COMPILE_USE_QT4 -void KviTopicWidget::paintEvent(TQPaintEvent * e) -{ - TQPainter pa(this); - drawFrame(&pa); - drawContents(&pa); -} -#endif void KviTopicWidget::drawContents(TQPainter *p) { diff --git a/src/kvirc/ui/kvi_topicw.h b/src/kvirc/ui/kvi_topicw.h index 7214a602..1772e762 100644 --- a/src/kvirc/ui/kvi_topicw.h +++ b/src/kvirc/ui/kvi_topicw.h @@ -81,9 +81,6 @@ protected: virtual void mousePressEvent(TQMouseEvent *e); virtual void keyPressEvent(TQKeyEvent *e); virtual void resizeEvent(TQResizeEvent *e); -#ifdef COMPILE_USE_QT4 - virtual void paintEvent(TQPaintEvent * e); -#endif void updateToolTip(); void deactivate(); void iconButtonClicked(); diff --git a/src/kvirc/ui/kvi_userlistview.cpp b/src/kvirc/ui/kvi_userlistview.cpp index 001dc625..d18a2f0f 100644 --- a/src/kvirc/ui/kvi_userlistview.cpp +++ b/src/kvirc/ui/kvi_userlistview.cpp @@ -1309,16 +1309,8 @@ KviUserListViewArea::KviUserListViewArea(KviUserListView * par) : TQWidget(par) { m_pListView = par; -#ifdef COMPILE_USE_QT4 - setAutoFillBackground(false); -#else setBackgroundMode(TQWidget::NoBackground); -#endif -#ifdef COMPILE_USE_QT4 - m_pScrollBar = new TQScrollBar(Qt::Vertical,this,"scrollbar"); -#else m_pScrollBar = new TQScrollBar(Qt::Vertical,this,"scrollbar"); -#endif m_pScrollBar->setRange(0,0); m_pScrollBar->setValue(0); connect(m_pScrollBar,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(scrollBarMoved(int))); @@ -1421,9 +1413,6 @@ void KviUserListViewArea::paintEvent(TQPaintEvent *ev) SET_ANTI_ALIASING(p); p.setFont(KVI_OPTION_FONT(KviOption_fontUserListView)); -#ifdef COMPILE_USE_QT4 - TQFontMetrics fm(p.fontMetrics()); -#endif #ifdef COMPILE_PSEUDO_TRANSPARENCY if(g_pShadedChildGlobalDesktopBackground) @@ -1516,11 +1505,7 @@ void KviUserListViewArea::paintEvent(TQPaintEvent *ev) case KVI_USERLISTVIEW_GRIDTYPE_PLAINGRID: case KVI_USERLISTVIEW_GRIDTYPE_DOTGRID: p.setPen(TQPen(KVI_OPTION_COLOR(KviOption_colorUserListViewGrid),0, -#ifdef COMPILE_USE_QT4 - (KVI_OPTION_UINT(KviOption_uintUserListViewGridType) == KVI_USERLISTVIEW_GRIDTYPE_DOTGRID) ? TQt::DotLine : TQt::SolidLine)); -#else (KVI_OPTION_UINT(KviOption_uintUserListViewGridType) == KVI_USERLISTVIEW_GRIDTYPE_DOTGRID) ? TQPen::DotLine : TQPen::SolidLine)); -#endif p.drawLine(0,bottom - 1,wdth,bottom - 1); if(bShowState || bShowIcons) p.drawLine(iAvatarAndTextX,bottom - 1,iAvatarAndTextX,theY); @@ -1683,18 +1668,10 @@ void KviUserListViewArea::paintEvent(TQPaintEvent *ev) KVI_SMALLICON_VOICE : KVI_SMALLICON_USEROP)))) \ ) \ ); -#ifdef COMPILE_USE_QT4 - p.drawPixmap(theX,theY+(fm.lineSpacing()-16/*size of small icon*/)/2,*ico); -#else p.drawPixmap(theX,theY+(m_pListView->m_iFontHeight-16/*size of small icon*/)/2,*ico); -#endif } theX +=18; -#ifdef COMPILE_USE_QT4 - p.drawText(iAvatarAndTextX,theY,wdth - theX,fm.lineSpacing(),TQt::AlignLeft|TQt::AlignVCenter,e->m_szNick); -#else p.drawText(iAvatarAndTextX,theY,wdth - theX,m_pListView->m_iFontHeight,TQt::AlignLeft|TQt::AlignVCenter,e->m_szNick); -#endif } else { char flag = m_pListView->getUserFlag(e); @@ -1702,17 +1679,9 @@ void KviUserListViewArea::paintEvent(TQPaintEvent *ev) { TQString ttt = TQChar(flag); ttt += e->m_szNick; -#ifdef COMPILE_USE_QT4 - p.drawText(iAvatarAndTextX,theY,wdth - theX,fm.lineSpacing(),TQt::AlignLeft|TQt::AlignVCenter,ttt); -#else p.drawText(iAvatarAndTextX,theY,wdth - theX,m_pListView->m_iFontHeight,TQt::AlignLeft|TQt::AlignVCenter,ttt); -#endif } else { -#ifdef COMPILE_USE_QT4 - p.drawText(iAvatarAndTextX,theY,wdth - theX,fm.lineSpacing(),TQt::AlignLeft|TQt::AlignVCenter,e->m_szNick); -#else p.drawText(iAvatarAndTextX,theY,wdth - theX,m_pListView->m_iFontHeight,TQt::AlignLeft|TQt::AlignVCenter,e->m_szNick); -#endif } } if(bColorAllocated) delete pClrFore; @@ -1732,12 +1701,7 @@ void KviUserListViewArea::paintEvent(TQPaintEvent *ev) //p.drawLine(1,height()-1,wdth,height()-1); //p.drawLine(wdth - 1,1,wdth - 1,height()); -#ifdef COMPILE_USE_QT4 - TQPainter qt4SuxBecauseOfThisAdditionalPainter(this); - qt4SuxBecauseOfThisAdditionalPainter.drawPixmap(r.left(),r.top(),r.width(),r.height(),*pMemBuffer,r.left(),r.top(),r.width(),r.height()); -#else bitBlt(TQT_TQPAINTDEVICE(this),r.left(),r.top(),TQT_TQPAINTDEVICE(pMemBuffer),r.left(),r.top(),r.width(),r.height(),TQt::CopyROP,false); -#endif } void KviUserListViewArea::resizeEvent(TQResizeEvent *) @@ -1958,15 +1922,7 @@ void KviUserListViewArea::mouseReleaseEvent(TQMouseEvent *) void KviUserListViewArea::wheelEvent(TQWheelEvent *e) { -#ifdef COMPILE_USE_QT4 - static bool bHere = false; // TQt4(<= 4.2.2) has a nasty bug that makes the re-sent wheelEvent to cause infinite recursion - if(bHere)return; - bHere = true; -#endif g_pApp->sendEvent(m_pScrollBar,e); -#ifdef COMPILE_USE_QT4 - bHere = false; -#endif } #include "kvi_userlistview.moc" diff --git a/src/kvirc/ui/kvi_window.cpp b/src/kvirc/ui/kvi_window.cpp index 8384f8c9..8f64ab84 100644 --- a/src/kvirc/ui/kvi_window.cpp +++ b/src/kvirc/ui/kvi_window.cpp @@ -64,12 +64,7 @@ #include <tqevent.h> // it looks they can't decide :D -#ifdef COMPILE_USE_QT4 - #include <TQPushButton> - #include <tqdesktopwidget.h> -#else #include <tqobjectlist.h> -#endif #include <tqvariant.h> @@ -144,13 +139,8 @@ KviWindow::KviWindow(int type,KviFrame * lpFrm,const TQString &name,KviConsole * m_pTaskBarItem = 0; setMinimumSize(KVI_WINDOW_MIN_WIDTH,KVI_WINDOW_MIN_HEIGHT); -#ifdef COMPILE_USE_QT4 - //setAutoFillBackground(false); - setFocusPolicy(TQ_StrongFocus); -#else setBackgroundMode(NoBackground); setFocusPolicy(TQ_StrongFocus); -#endif connect(g_pApp,TQT_SIGNAL(reloadImages()),this,TQT_SLOT(reloadImages())); } @@ -288,21 +278,13 @@ bool KviWindow::focusNextPrevChild(bool next) TQWidget * w = focusWidget(); if(w) { -#ifdef COMPILE_USE_QT4 - if(w->focusPolicy() == TQ_StrongFocus)return false; -#else if(w->focusPolicy() == TQ_StrongFocus)return false; -#endif //TQVariant v = w->property("KviProperty_FocusOwner"); //if(v.isValid())return false; // Do NOT change the focus widget! if(w->parent()) { -#ifdef COMPILE_USE_QT4 - if(w->parent()->metaObject()->indexOfProperty("KviProperty_ChildFocusOwner") == -1) -#else if(w->parent()->metaObject()->findProperty("KviProperty_ChildFocusOwner") == -1) -#endif return false; // Do NOT change the focus widget! } } @@ -429,12 +411,6 @@ void KviWindow::destroyTaskBarItem() BUTTON_CLASS * KviWindow::createToolButton(TQWidget * par,const char * nam,int pixon,int pixoff,const TQString & tooltip,bool bOn) { -#ifdef COMPILE_USE_QT4 - BUTTON_CLASS * b = new BUTTON_CLASS(par); - b->setObjectName(nam); - b->setFlat(true); - b->setIcon(TQIcon(*(g_pIconManager->getSmallIcon(pixon)))); -#else BUTTON_CLASS * b = new BUTTON_CLASS(par,nam); b->setToggleButton(true); b->setUsesBigPixmap(false); @@ -442,7 +418,6 @@ BUTTON_CLASS * KviWindow::createToolButton(TQWidget * par,const char * nam,int p is1.setPixmap(*(g_pIconManager->getSmallIcon(pixon)),TQIconSet::Small,TQIconSet::Normal,TQIconSet::On); is1.setPixmap(*(g_pIconManager->getSmallIcon(pixoff)),TQIconSet::Small,TQIconSet::Normal,TQIconSet::Off); b->setIconSet(is1); -#endif KviTalToolTip::add @@ -619,11 +594,7 @@ void KviWindow::saveProperties(KviConfig *cfg) TQTextCodec * c = defaultTextCodec(); if(c && m_pTextCodec) { -#ifdef COMPILE_USE_QT4 - if(KviTQString::equalCI(szCodec,c->name().data()))szCodec = KviTQString::empty; // store "default" -#else if(KviTQString::equalCI(szCodec,c->name()))szCodec = KviTQString::empty; // store "default" -#endif } TQString szKey = "TextEncoding_"; szKey += m_szName; @@ -1005,18 +976,6 @@ void KviWindow::focusInEvent(TQFocusEvent *) if(m_pIrcView)m_pFocusHandler = m_pIrcView; else { -#ifdef COMPILE_USE_QT4 - TQPtrList<TQObject *> list = children(); - for(TQPtrList<TQObject *>::Iterator it = list.begin();it != list.end();++it) - { - TQObject * c = *it; - if(c->isWidgetType()) - { - m_pFocusHandler = (TQWidget *)c; - break; - } - } -#else TQObjectList list = childrenListObject(); if(!list.isEmpty()) { @@ -1029,7 +988,6 @@ void KviWindow::focusInEvent(TQFocusEvent *) } } } -#endif } if(m_pFocusHandler)m_pFocusHandler->setFocus(); else { @@ -1065,13 +1023,8 @@ bool KviWindow::eventFilter(TQObject *o,TQEvent *e) TQApplication::restoreOverrideCursor(); break; case TQEvent::MouseButtonPress: -#ifdef COMPILE_USE_QT4 - if( (((TQWidget *)o)->focusPolicy() == TQ_NoFocus) || - (((TQWidget *)o)->focusPolicy() == TQ_TabFocus)) -#else if( (((TQWidget *)o)->focusPolicy() == TQ_NoFocus) || (((TQWidget *)o)->focusPolicy() == TQ_TabFocus)) -#endif { // this will not focus our window // set the focus to the focus handler @@ -1113,27 +1066,12 @@ void KviWindow::childInserted(TQWidget * o) m_pFocusHandler = o; else { -#ifdef COMPILE_USE_QT4 if(!m_pFocusHandler && (o->focusPolicy() == TQ_StrongFocus)) -#else - if(!m_pFocusHandler && (o->focusPolicy() == TQ_StrongFocus)) -#endif { m_pFocusHandler = o; } } -#ifdef COMPILE_USE_QT4 - TQPtrList<TQObject *> list = o->children(); - for(TQPtrList<TQObject *>::Iterator it = list.begin();it != list.end();++it) - { - TQObject * c = *it; - if(c->isWidgetType()) - { - childInserted((TQWidget *)c); - } - } -#else TQObjectList list = o->childrenListObject(); if(!list.isEmpty()) { @@ -1143,7 +1081,6 @@ void KviWindow::childInserted(TQWidget * o) childInserted((TQWidget *)c); } } -#endif } void KviWindow::childDestroyed() @@ -1161,17 +1098,6 @@ void KviWindow::childRemoved(TQWidget * o) if(o == m_pLastFocusedChild) m_pLastFocusedChild = 0; -#ifdef COMPILE_USE_QT4 - TQPtrList<TQObject *> list = o->children(); - for(TQPtrList<TQObject *>::Iterator it = list.begin();it != list.end();++it) - { - TQObject * c = *it; - if(c->isWidgetType()) - { - childRemoved((TQWidget *)c); - } - } -#else TQObjectList list = o->childrenListObject(); if(!list.isEmpty()) { @@ -1181,7 +1107,6 @@ void KviWindow::childRemoved(TQWidget * o) childRemoved((TQWidget *)c); } } //else tqDebug("The removed object has no children"); -#endif } void KviWindow::childEvent(TQChildEvent *e) @@ -1216,22 +1141,6 @@ void KviWindow::updateBackgrounds(TQObject * obj) { if(!obj) obj = TQT_TQOBJECT(this); -#ifdef COMPILE_USE_QT4 - TQPtrList<TQObject *> list = obj->children(); - if (list.count()) - { - - for(TQPtrList<TQObject *>::Iterator it = list.begin();it != list.end();++it) - { - TQObject * child = *it; - if(child->metaObject()->indexOfProperty("TransparencyCapable") != -1){ - // if (child->isWidgetType()) - ((TQWidget *)child)->update(); - } - updateBackgrounds(child); - } - } -#else TQObjectList list = obj->childrenListObject(); if(!list.isEmpty()) { @@ -1245,7 +1154,6 @@ void KviWindow::updateBackgrounds(TQObject * obj) updateBackgrounds(child); } } -#endif } void KviWindow::moveEvent(TQMoveEvent *e) @@ -1476,11 +1384,7 @@ void KviWindow::unhighlight() void KviWindow::preprocessMessage(TQString & szMessage) { // slow -#ifdef COMPILE_USE_QT4 - TQStringList strings = szMessage.split(" "); -#else TQStringList strings = TQStringList::split(" ",szMessage, TRUE); -#endif for ( TQStringList::Iterator it = strings.begin(); it != strings.end(); ++it ) { TQString tmp(*it); if(tmp.contains('\r')) continue; diff --git a/src/kvirc/ui/kvi_window.h b/src/kvirc/ui/kvi_window.h index 29df8b69..940fcf54 100644 --- a/src/kvirc/ui/kvi_window.h +++ b/src/kvirc/ui/kvi_window.h @@ -124,12 +124,7 @@ class KviTalWidgetStack; #define KVI_ACTIVITY_VERYHOT 5 #define KVI_ACTIVITY_FIRE 6 -#ifdef COMPILE_USE_QT4 - class TQPushButton; - #define BUTTON_CLASS TQPushButton -#else #define BUTTON_CLASS TQToolButton -#endif class KVIRC_API KviWindow : public TQWidget diff --git a/src/modules/actioneditor/actioneditor.cpp b/src/modules/actioneditor/actioneditor.cpp index b35959d9..8fdd1bd0 100644 --- a/src/modules/actioneditor/actioneditor.cpp +++ b/src/modules/actioneditor/actioneditor.cpp @@ -54,11 +54,7 @@ #include <tqcheckbox.h> #include <tqtooltip.h> #include <tqpainter.h> -#ifdef COMPILE_USE_QT4 - #include <tq3header.h> -#else #include <tqheader.h> -#endif #include <tqtabwidget.h> #include <kvi_tal_groupbox.h> #include "kvi_valuelist.h" @@ -654,13 +650,7 @@ KviActionEditor::KviActionEditor(TQWidget * par) TQGridLayout * l = new TQGridLayout(this,1,1,2,2); -#ifdef COMPILE_USE_QT4 m_pSplitter = new TQSplitter(Qt::Horizontal,this); - m_pSplitter->setOpaqueResize(false); - -#else - m_pSplitter = new TQSplitter(Qt::Horizontal,this); -#endif l->addWidget(m_pSplitter,0,0); @@ -669,11 +659,7 @@ KviActionEditor::KviActionEditor(TQWidget * par) m_pListView = new KviActionEditorListView(box); //m_pListView->setMultiSelection(false); m_pListView->setShowSortIndicator(true); -#ifdef COMPILE_USE_QT4 - m_pListView->setFocusPolicy(TQ_StrongFocus); -#else m_pListView->setFocusPolicy(TQ_StrongFocus); -#endif connect(m_pListView,TQT_SIGNAL(currentChanged(KviTalListViewItem *)),this,TQT_SLOT(currentChanged(KviTalListViewItem *))); diff --git a/src/modules/actioneditor/actioneditor.h b/src/modules/actioneditor/actioneditor.h index d6808af3..6823a387 100644 --- a/src/modules/actioneditor/actioneditor.h +++ b/src/modules/actioneditor/actioneditor.h @@ -71,12 +71,7 @@ class TQToolButton; class TQSimpleRichText; class TQPushButton; -#ifdef COMPILE_USE_QT4 - #include <tq3simplerichtext.h> - #define TQSimpleRichText Q3SimpleRichText -#else #include <tqsimplerichtext.h> -#endif diff --git a/src/modules/addon/managementdialog.cpp b/src/modules/addon/managementdialog.cpp index beb9f4f5..f89d9bfe 100644 --- a/src/modules/addon/managementdialog.cpp +++ b/src/modules/addon/managementdialog.cpp @@ -45,12 +45,7 @@ #include <tqmessagebox.h> #include <tqframe.h> #include "kvi_tal_scrollview.h" -#ifdef COMPILE_USE_QT4 - #include <tq3header.h> - -#else #include <tqheader.h> -#endif #include "kvi_draganddrop.h" #include <tqpainter.h> #include <tqpixmap.h> @@ -84,13 +79,7 @@ KviScriptAddonListViewItem::KviScriptAddonListViewItem(KviTalListView * v,KviKvs t += a->description(); t += "</font></nobr>"; m_szKey = a->visibleName().upper(); -#ifdef COMPILE_USE_QT4 - m_pText = new TQTextDocument(); - m_pText->setHtml(t); - m_pText->setDefaultFont(v->font()); -#else m_pText = new TQSimpleRichText(t,v->font()); -#endif TQPixmap * p = a->icon(); m_pIcon = p ? new TQPixmap(*p) : new TQPixmap(LVI_ICON_SIZE,LVI_ICON_SIZE); @@ -115,33 +104,14 @@ void KviScriptAddonListViewItem::setup() if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH; iWidth -= LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER; - #ifdef COMPILE_USE_QT4 - int iHeight = m_pText->size().height() + (2 * LVI_BORDER); - #else m_pText->setWidth(iWidth); int iHeight = m_pText->height() + (2 * LVI_BORDER); - #endif if(iHeight < (LVI_ICON_SIZE + (2 * LVI_BORDER)))iHeight = LVI_ICON_SIZE + (2 * LVI_BORDER); setHeight(iHeight+2); } void KviScriptAddonListViewItem::paintCell(TQPainter * p,const TQColorGroup & cg,int column,int width,int align) { - #ifdef COMPILE_USE_QT4 - if (isSelected()) - { - TQColor col(m_pListView->palette().highlight()); - col.setAlpha(127); - p->setBrush(col); - p->drawRect(0, 0, m_pListView->visibleWidth(), height()); - } - p->drawPixmap(LVI_BORDER,LVI_BORDER,*m_pIcon); - int afterIcon = LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING; - int www = m_pListView->visibleWidth() - (afterIcon + LVI_BORDER); - p->translate(afterIcon,LVI_BORDER); - m_pText->setPageSize(TQSizeF(www,height() - (LVI_BORDER * 2))); - m_pText->drawContents(p); - #else p->drawPixmap(LVI_BORDER,LVI_BORDER,*m_pIcon); int afterIcon = LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING; int www = m_pListView->visibleWidth() - (afterIcon + LVI_BORDER); @@ -155,7 +125,6 @@ void KviScriptAddonListViewItem::paintCell(TQPainter * p,const TQColorGroup & cg } else { m_pText->draw(p,afterIcon,LVI_BORDER,TQRect(afterIcon,LVI_BORDER,www,height() - (LVI_BORDER * 2)),cg); } - #endif } diff --git a/src/modules/addon/managementdialog.h b/src/modules/addon/managementdialog.h index a25bfaa1..dc20931c 100644 --- a/src/modules/addon/managementdialog.h +++ b/src/modules/addon/managementdialog.h @@ -38,11 +38,7 @@ class TQPushButton; class TQPixmap; class KviKvsScriptAddon; -#ifdef COMPILE_USE_QT4 - #include <TQTextDocument> -#else #include <tqsimplerichtext.h> -#endif class KviScriptAddonListViewItem : public KviTalListViewItem { @@ -51,11 +47,7 @@ public: ~KviScriptAddonListViewItem(); protected: KviKvsScriptAddon * m_pAddon; -#ifdef COMPILE_USE_QT4 - TQTextDocument * m_pText; -#else TQSimpleRichText * m_pText; -#endif TQPixmap * m_pIcon; KviTalListView * m_pListView; TQString m_szKey; diff --git a/src/modules/aliaseditor/aliaseditor.cpp b/src/modules/aliaseditor/aliaseditor.cpp index 92b872a9..846f098f 100644 --- a/src/modules/aliaseditor/aliaseditor.cpp +++ b/src/modules/aliaseditor/aliaseditor.cpp @@ -210,12 +210,7 @@ KviAliasEditor::KviAliasEditor(TQWidget * par) TQGridLayout * l = new TQGridLayout(this,1,1,2,2); -#ifdef COMPILE_USE_QT4 m_pSplitter = new TQSplitter(Qt::Horizontal,this); - m_pSplitter->setOpaqueResize(false); -#else - m_pSplitter = new TQSplitter(Qt::Horizontal,this); -#endif l->addWidget(m_pSplitter,0,0); diff --git a/src/modules/channelsjoin/channelsjoinwindow.cpp b/src/modules/channelsjoin/channelsjoinwindow.cpp index fc3428bd..3dc26251 100644 --- a/src/modules/channelsjoin/channelsjoinwindow.cpp +++ b/src/modules/channelsjoin/channelsjoinwindow.cpp @@ -42,11 +42,7 @@ #include <tqlayout.h> #include <tqcheckbox.h> #include <tqpushbutton.h> -#ifdef COMPILE_USE_QT4 - #include <tq3header.h> -#else #include <tqheader.h> -#endif #include <tqevent.h> extern KviChannelsJoinWindow * g_pChannelsWindow; @@ -98,11 +94,7 @@ KviChannelsJoinWindow::KviChannelsJoinWindow(TQWidget * par, const char * name) m_pJoinButton->setDefault(true); connect(m_pJoinButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(joinClicked())); -#ifdef COMPILE_USE_QT4 - g->addMultiCellWidget(m_pJoinButton,2,2,0,1,TQt::AlignHCenter); -#else g->addMultiCellWidget(m_pJoinButton,2,2,0,1,AlignHCenter); -#endif m_pShowAtStartupCheck = new KviStyledCheckBox(__tr2qs("Show this window after connecting"),this); diff --git a/src/modules/dcc/broker.h b/src/modules/dcc/broker.h index f49adeb9..2cf3b512 100644 --- a/src/modules/dcc/broker.h +++ b/src/modules/dcc/broker.h @@ -26,11 +26,7 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - // #define COMPILE_DCC_CANVAS -#else #define COMPILE_DCC_CANVAS -#endif #include "kvi_string.h" #include "kvi_pointerlist.h" diff --git a/src/modules/dcc/dialogs.cpp b/src/modules/dcc/dialogs.cpp index 89435202..6f2426d7 100644 --- a/src/modules/dcc/dialogs.cpp +++ b/src/modules/dcc/dialogs.cpp @@ -55,9 +55,6 @@ KviDccAcceptBox::KviDccAcceptBox(KviDccBroker * br,KviDccDescriptor * dcc,const { TQVBoxLayout * vb = new TQVBoxLayout(this,4,4); TQLabel * l = new TQLabel(text,this); -#ifdef COMPILE_USE_QT4 - l->setWordWrap(true); -#endif vb->addWidget(l); TQHBoxLayout *hb = new TQHBoxLayout(4); vb->addLayout(hb,TQt::AlignCenter); @@ -118,9 +115,6 @@ KviDccRenameBox::KviDccRenameBox(KviDccBroker * br,KviDccDescriptor * dcc,const { TQVBoxLayout * vb = new TQVBoxLayout(this,4,4); TQLabel * l = new TQLabel(text,this); -#ifdef COMPILE_USE_QT4 - l->setWordWrap(true); -#endif vb->addWidget(l); TQHBoxLayout *hb = new TQHBoxLayout(4); diff --git a/src/modules/dialog/libkvidialog.cpp b/src/modules/dialog/libkvidialog.cpp index 09072570..d6ef068c 100644 --- a/src/modules/dialog/libkvidialog.cpp +++ b/src/modules/dialog/libkvidialog.cpp @@ -29,13 +29,7 @@ #include <tqlayout.h> #include "kvi_tal_hbox.h" #include <tqlineedit.h> -#ifdef COMPILE_USE_QT4 - #include <tq3multilineedit.h> - #define TQMultiLineEdit Q3MultiLineEdit - #include <tqdesktopwidget.h> -#else #include <tqmultilineedit.h> -#endif #include <tqevent.h> #include <tqlabel.h> #include <tqpushbutton.h> @@ -74,9 +68,7 @@ KviKvsCallbackMessageBox::KviKvsCallbackMessageBox( KviKvsCallbackObject("dialog.message",pWindow,szCode,pMagicParams,0) { g_pDialogModuleDialogList->append(this); -#ifndef COMPILE_USE_QT4 setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC))); -#endif TQPixmap * pix = g_pIconManager->getImage(szIcon); diff --git a/src/modules/dockwidget/Makefile.am b/src/modules/dockwidget/Makefile.am index 71a2f023..f0411021 100644 --- a/src/modules/dockwidget/Makefile.am +++ b/src/modules/dockwidget/Makefile.am @@ -9,13 +9,13 @@ pluglib_LTLIBRARIES = libkvidockwidget.la libkvidockwidget_la_LDFLAGS = -module -avoid-version $(SS_LDFLAGS) $(SS_LIBDIRS) -libkvidockwidget_la_SOURCES = libkvidockwidget_qt3.cpp libkvidockwidget_qt4.cpp +libkvidockwidget_la_SOURCES = libkvidockwidget_qt3.cpp #nodist_libkvidockwidget_la_SOURCES = moc_trayicon.cpp libkvidockwidget_la_LIBADD = $(SS_LIBLINK) ../../kvilib/build/libkvilib.la -noinst_HEADERS= libkvidockwidget.h libkvidockwidget_qt4.h libkvidockwidget_qt3.h +noinst_HEADERS= libkvidockwidget.h libkvidockwidget_qt3.h tmpdir = $(picsdir) @@ -30,4 +30,3 @@ moc_%.cpp: %.h $(SS_QT_MOC) $< -o $@ libkvidockwidget_qt3.cpp: libkvidockwidget_qt3.moc -libkvidockwidget_qt4.cpp: libkvidockwidget_qt4.moc diff --git a/src/modules/dockwidget/libkvidockwidget.h b/src/modules/dockwidget/libkvidockwidget.h index 89b99a47..f11c66d4 100644 --- a/src/modules/dockwidget/libkvidockwidget.h +++ b/src/modules/dockwidget/libkvidockwidget.h @@ -25,10 +25,6 @@ #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #include "libkvidockwidget_qt4.h" -#else - #include "libkvidockwidget_qt3.h" -#endif +#include "libkvidockwidget_qt3.h" #endif // _KVI_TAL_DOCK_H_ diff --git a/src/modules/dockwidget/libkvidockwidget_qt3.cpp b/src/modules/dockwidget/libkvidockwidget_qt3.cpp index 08bae43f..78a1a28b 100644 --- a/src/modules/dockwidget/libkvidockwidget_qt3.cpp +++ b/src/modules/dockwidget/libkvidockwidget_qt3.cpp @@ -21,7 +21,6 @@ // #include "kvi_settings.h" -#ifndef COMPILE_USE_QT4 #include "kvi_app.h" #include "kvi_module.h" @@ -123,17 +122,12 @@ KviDockWidget::KviDockWidget(KviFrame * frm,const char * name) createTaskbarIcon(); #else //!COMPILE_ON_WINDOWS setMinimumSize(22,22); - #ifndef COMPILE_USE_QT4 - setBackgroundMode(X11ParentRelative); - #endif + setBackgroundMode(X11ParentRelative); #ifdef COMPILE_TDE_SUPPORT KWin::setSystemTrayWindowFor(winId(),frm->winId()); #endif #endif //!COMPILE_ON_WINDOWS -#ifdef COMPILE_USE_QT4 - m_pSysTrayIcon = new TQSystemTrayIcon(m_pFrm); -#endif m_pTip = new KviDynamicToolTip(this,"dock_tooltip"); connect(m_pTip,TQT_SIGNAL(tipRequest(KviDynamicToolTip *,const TQPoint &)),this,TQT_SLOT(tipRequest(KviDynamicToolTip *,const TQPoint &))); @@ -145,12 +139,10 @@ KviDockWidget::KviDockWidget(KviFrame * frm,const char * name) m_pContextPopup->insertTitle(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC)),__tr2qs("KVIrc")); #else m_pContextPopup = new KviTalPopupMenu(this); -#ifndef COMPILE_USE_QT4 TQLabel * l = new TQLabel(__tr2qs("KVIrc"),m_pContextPopup); l->setFrameStyle(TQFrame::Raised | TQFrame::StyledPanel); m_pContextPopup->insertItem(l); #endif -#endif m_pContextPopup->setCaption(__tr2qs("Context")); m_iAwayMenuId = m_pContextPopup->insertItem ( __tr2qs("Away"), m_pAwayPopup); m_pContextPopup->changeItem(m_iAwayMenuId,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_AWAY)),__tr2qs("Away")); @@ -614,19 +606,6 @@ void KviDockWidget::grabActivityInfo() void KviDockWidget::paintEvent(TQPaintEvent * event) { -#ifdef COMPILE_USE_QT4 - TQPainter thisRestrictionOfTQt4IsNotNice(this); - if(m_bFlashed) - { - erase(); - thisRestrictionOfTQt4IsNotNice.drawPixmap(4,4,16,16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),0,0,16,16); - } else { - thisRestrictionOfTQt4IsNotNice.drawPixmap(0,0,12,12,m_iOther ? ((m_iOther == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,0,0,12,12); - thisRestrictionOfTQt4IsNotNice.drawPixmap(0,12,12,12,m_iConsoles ? ((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,0,12,12,12); - thisRestrictionOfTQt4IsNotNice.drawPixmap(12,0,12,12,m_iQueries ? ((m_iQueries == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,12,0,12,12); - thisRestrictionOfTQt4IsNotNice.drawPixmap(12,12,12,12,m_iChannels ? ((m_iChannels == 2) ? *g_pDock3 : *g_pDock2) : *g_pDock1,12,12,12,12); - } -#else if(m_bFlashed) { erase(); @@ -637,7 +616,6 @@ void KviDockWidget::paintEvent(TQPaintEvent * event) bitBlt(TQT_TQPAINTDEVICE(this),12,0,TQT_TQPAINTDEVICE(m_iQueries ? ((m_iQueries == 2) ? g_pDock3 : g_pDock2) : g_pDock1),12,0,12,12,TQt::CopyROP,false); bitBlt(TQT_TQPAINTDEVICE(this),12,12,TQT_TQPAINTDEVICE(m_iChannels ? ((m_iChannels == 2) ? g_pDock3 : g_pDock2) : g_pDock1),12,12,12,12,TQt::CopyROP,false); } -#endif } @@ -853,4 +831,3 @@ KVIRC_MODULE( #include "libkvidockwidget_qt3.moc" -#endif diff --git a/src/modules/dockwidget/libkvidockwidget_qt4.cpp b/src/modules/dockwidget/libkvidockwidget_qt4.cpp deleted file mode 100644 index a860d479..00000000 --- a/src/modules/dockwidget/libkvidockwidget_qt4.cpp +++ /dev/null @@ -1,691 +0,0 @@ -// -// File : libkvidockwidget.cpp -// Creation date : Tue Jan 02 20001 14:34:12 CEST by Szymon Stefanek -// -// This file is part of the KVirc irc client distribution -// Copyright (C) 2000-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// - -#include "kvi_settings.h" - -#ifdef COMPILE_USE_QT4 - -#ifdef COMPILE_ON_WINDOWS - #define ICON_SIZE 16 -#else - #define ICON_SIZE 22 -#endif - -#include "kvi_app.h" -#include "kvi_module.h" -#include "kvi_locale.h" -#include "kvi_memmove.h" -#include "kvi_taskbar.h" -#include "kvi_window.h" -#include "kvi_dynamictooltip.h" -#include "kvi_iconmanager.h" -#include "kvi_internalcmd.h" -#include "kvi_console.h" -#include "kvi_ircconnection.h" -#include "kvi_ircconnectionuserinfo.h" -#include "kvi_imagelib.h" -#include "kvi_options.h" -#include "kvi_ircview.h" - -#include "libkvidockwidget.h" -#include "kvi_doublebuffer.h" - -#include <tqlabel.h> - -#include "kvi_tal_popupmenu.h" - - -#include <tqpixmap.h> -#include <tqpainter.h> -#include <tqtimer.h> -#include <tqevent.h> -#include <tqregexp.h> - -#include <stdlib.h> -#include <time.h> - - -extern KVIRC_API KviPointerHashTable<const char *,KviWindow> * g_pGlobalWindowDict; -static KviPointerList<KviDockWidget> * g_pDockWidgetList = 0; - -static TQPixmap * g_pDock1 = 0; -static TQPixmap * g_pDock2 = 0; -static TQPixmap * g_pDock3 = 0; - -KviDockWidget::KviDockWidget(KviFrame * frm) -: TQSystemTrayIcon(frm), m_CurrentPixmap(ICON_SIZE,ICON_SIZE) -{ - m_pContextPopup = new KviTalPopupMenu(0); - setContextMenu(m_pContextPopup); - - m_iConsoles = 0; - m_iChannels = 0; - m_iQueries = 0; - m_iOther = 0; - - m_pFlashingTimer = new TQTimer(this,"flashing_timer"); - connect( m_pFlashingTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(flashingTimerShot()) ); - m_bFlashed=0; - g_pDockWidgetList->append(this); - m_pFrm = frm; - m_pFrm->setDockExtension(this); - - m_pTip = new KviDynamicToolTip(frm,"dock_tooltip"); - m_pAwayPopup = new KviTalPopupMenu(0); - - TQLabel * l = new TQLabel(__tr2qs("KVIrc"),m_pContextPopup); - l->setFrameStyle(TQFrame::Raised | TQFrame::StyledPanel); - m_pContextPopup->insertItem(l); - m_pContextPopup->setCaption(__tr2qs("Context")); - m_iAwayMenuId = m_pContextPopup->insertItem ( __tr2qs("Away"), m_pAwayPopup); - m_pContextPopup->changeItem(m_iAwayMenuId,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_AWAY)),__tr2qs("Away")); - - int id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_OPTIONS)),__tr2qs("&Configure KVIrc..."),m_pFrm,TQT_SLOT(executeInternalCommand(int))); - m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_OPTIONS_DIALOG); - id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_KVIRC)),__tr2qs("&About KVIrc"),m_pFrm,TQT_SLOT(executeInternalCommand(int))); - m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_ABOUT_ABOUTKVIRC); - m_pContextPopup->insertSeparator(); - m_iToggleFrame = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_RAW)),TQString(""),this,TQT_SLOT(toggleParentFrame())); - m_pContextPopup->insertSeparator(); - id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_DOCKWIDGET)),__tr2qs("Un&dock"),m_pFrm,TQT_SLOT(executeInternalCommand(int))); - m_pContextPopup->setItemParameter(id,KVI_INTERNALCOMMAND_DOCKWIDGET_HIDE); - id = m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_QUITAPP)),__tr2qs("&Quit"),g_pApp,TQT_SLOT(quit())); - m_pContextPopup->setAccel(__tr2qs("Ctrl+Q"),id); - connect(m_pContextPopup,TQT_SIGNAL(aboutToShow()),this,TQT_SLOT(fillContextPopup())); - - TQIcon icon(*g_pDock1); - setIcon(icon); - - connect(this,TQT_SIGNAL(activated ( TQSystemTrayIcon::ActivationReason )),this,TQT_SLOT(activatedSlot ( TQSystemTrayIcon::ActivationReason ))); -} - - -KviDockWidget::~KviDockWidget() -{ - m_pFrm->setDockExtension(0); - g_pDockWidgetList->removeRef(this); -} - -void KviDockWidget::die() -{ - delete this; -} - -void KviDockWidget::flashingTimerShot() -{ - m_bFlashed=!m_bFlashed; - refresh(); -} - -#define NIDLEMSGS 18 - -static const char * idlemsgs[NIDLEMSGS]= -{ - __tr("Nothing is happening...") , - __tr("Just idling...") , - __tr("Dum de dum de dum...") , - __tr("Hey man... do something!") , - __tr("Umpf!") , - __tr("Silence speaking") , - __tr("Are ya here?") , - __tr("The world has stopped?") , - __tr("Everything is all right") , - __tr("idle()") , - __tr("It's so cold here...") , - __tr("Do not disturb... watching TV") , - __tr("Just vegetating") , - __tr("Hey... are ya sure that your network is up?") , - __tr("Seems like the world has stopped spinning") , - __tr("This silence is freaking me out!") , - __tr("Mieeeeeowww!") , - __tr("idle idle idle idle!") -}; - -void KviDockWidget::tipRequest(KviDynamicToolTip *tip,const TQPoint &pnt) -{ - TQString tmp; - - KviTaskBarBase * t = m_pFrm->taskBar(); - - TQString line; - - for(KviTaskBarItem * b = t->firstItem();b;b = t->nextItem()) - { - - if(b->kviWindow()->view()) - { - if(b->kviWindow()->view()->haveUnreadedMessages()) - { - line = b->kviWindow()->lastMessageText(); - if(!line.isEmpty()) - { - line.replace(TQChar('&'),"&"); - line.replace(TQChar('<'),"<"); - line.replace(TQChar('>'),">"); - tmp += "<b>"; - tmp += b->kviWindow()->plainTextCaption(); - tmp += "</b><br>"; - tmp += line; - tmp += "<br><br>\n"; - } - } - } - } - - - srand(time(0)); - - // We use the bad way to generate random numbers :))))) - - if(tmp.isEmpty())tmp = __tr2qs_no_xgettext(idlemsgs[(int)(rand() % NIDLEMSGS)]); - - //m_pTip->tip(rect(),tmp); -} - -//int KviDockWidget::message(int,void *) -//{ -// tqDebug("Message"); -// update(); -// return 0; -//} - -//FIXME: TQt4 port -/*void KviDockWidget::mousePressEvent(TQMouseEvent *e) -{ - if(e->button() & Qt::LeftButton)toggleParentFrame(); - else if(e->button() & Qt::RightButton) - m_pContextPopup->popup(mapToGlobal(e->pos())); -}*/ - -void KviDockWidget::doAway(int id) -{ - if(id<0) - { - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - while(KviWindow * wnd = it.current()) - { - if(wnd->type()==KVI_WINDOW_TYPE_CONSOLE) - { - KviConsole* pConsole=(KviConsole*)wnd; - if(pConsole->isConnected()) - if(id==-2) - pConsole->connection()->sendFmtData("AWAY"); - else - pConsole->connection()->sendFmtData("AWAY :%s", - pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data() - ); - } - ++it; - } - } else { - KviConsole* pConsole=g_pApp->findConsole((unsigned int)id); - if(pConsole) - if(pConsole->isConnected()) - if(pConsole->connection()->userInfo()->isAway()) - pConsole->connection()->sendFmtData("AWAY"); - else - pConsole->connection()->sendFmtData("AWAY :%s", - pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data() - ); - } -} - -void KviDockWidget::fillContextPopup() -{ - m_pContextPopup->changeItem(m_iToggleFrame,m_pFrm->isVisible() ? __tr2qs("Hide Window") : __tr2qs("Show Window")); - if(g_pApp->topmostConnectedConsole()) - { - m_pContextPopup->setItemVisible(m_iAwayMenuId,true); - m_pAwayPopup->clear(); - - int iAllAway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on all"),this,TQT_SLOT(doAway(int))); - m_pAwayPopup->setItemParameter(iAllAway,-1); - - int iAllUnaway=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on all"),this,TQT_SLOT(doAway(int))); - m_pAwayPopup->setItemParameter(iAllUnaway,-2); - - int iSeparator=m_pAwayPopup->insertSeparator(); - - KviPointerHashTableIterator<const char *,KviWindow> it(*g_pGlobalWindowDict); - bool bAllAway=1; - bool bAllUnaway=1; - int iNetCount=0; - while(KviWindow * wnd = it.current()) - { - if(wnd->type()==KVI_WINDOW_TYPE_CONSOLE) - { - KviConsole* pConsole=(KviConsole*)wnd; - if(pConsole->isConnected()) - { - int id; - if(pConsole->connection()->userInfo()->isAway()) - { - id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Back on %1").arg(pConsole->currentNetworkName()),this,TQT_SLOT(doAway(int))); - bAllUnaway=0; - } else { - id=m_pAwayPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_CONSOLE)),__tr2qs("Away on %1").arg(pConsole->currentNetworkName()),this,TQT_SLOT(doAway(int))); - bAllAway=0; - } - m_pAwayPopup->setItemParameter(id,pConsole->ircContextId()); - iNetCount++; - } - } - ++it; - } - if(iNetCount==1) - { - m_pAwayPopup->setItemVisible(iAllAway,false); - m_pAwayPopup->setItemVisible(iAllUnaway,false); - m_pAwayPopup->setItemVisible(iSeparator,false); - } else { - m_pAwayPopup->setItemVisible(iAllAway,!bAllAway); - m_pAwayPopup->setItemVisible(iAllUnaway,!bAllUnaway); - } - } else { - m_pContextPopup->setItemVisible(m_iAwayMenuId,false); - } -} - -void KviDockWidget::toggleParentFrame() -{ - TQWidget *top_widget = m_pFrm->topLevelWidget(); - - if(m_pFrm->isVisible()) { - m_pFrm->hide(); - } else { - top_widget->show(); - top_widget->raise(); - top_widget->setActiveWindow(); - if(g_pActiveWindow) g_pActiveWindow->setFocus(); - if(m_pFrm->isMinimized()) - m_pFrm->showNormal(); - else - m_pFrm->show(); - } -} - -void KviDockWidget::refresh() -{ - grabActivityInfo(); - - if( (m_iChannels == 2) || (m_iQueries == 2) ) - { - if(!m_pFlashingTimer->isActive() && KVI_OPTION_BOOL(KviOption_boolEnableTrayIconFlashing) ) - m_pFlashingTimer->start(1000); - } else { - if(m_pFlashingTimer->isActive()) m_pFlashingTimer->stop(); - m_bFlashed=false; - } - - m_CurrentPixmap.fill(TQt::transparent); - TQPainter thisRestrictionOfTQt4IsNotNice(&m_CurrentPixmap); - //thisRestrictionOfTQt4IsNotNice.drawPixmap(0,0,22,22,*g_pDock1,0,0,22,22); - - if(m_bFlashed) - { - thisRestrictionOfTQt4IsNotNice.drawPixmap((ICON_SIZE-16)/2,(ICON_SIZE-16)/2,16,16,*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MESSAGE)),0,0,16,16); - } else { - thisRestrictionOfTQt4IsNotNice.drawPixmap(0,0,ICON_SIZE/2,ICON_SIZE/2, - m_iOther ? - ((m_iOther == 2) ? *g_pDock3 : *g_pDock2) - : *g_pDock1,0,0,ICON_SIZE/2,ICON_SIZE/2); - - thisRestrictionOfTQt4IsNotNice.drawPixmap(0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2, - m_iConsoles ? - ((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2) - : *g_pDock1,0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2); - - thisRestrictionOfTQt4IsNotNice.drawPixmap(ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2, - m_iQueries ? - ((m_iQueries == 2) - ? *g_pDock3 : *g_pDock2) - : *g_pDock1,ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2); - - thisRestrictionOfTQt4IsNotNice.drawPixmap(ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2, - m_iChannels ? - ((m_iChannels == 2) ? *g_pDock3 : *g_pDock2) - : *g_pDock1 - ,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2); - - } - updateIcon(); -} - -void KviDockWidget::activatedSlot( TQSystemTrayIcon::ActivationReason reason ) -{ - if(reason==TQSystemTrayIcon::Trigger) - { - toggleParentFrame(); - } -} - -void KviDockWidget::grabActivityInfo() -{ - KviTaskBarBase * t = m_pFrm->taskBar(); - - if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification)) - { - if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=5; - if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=5; - - if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=1; - if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=1; - - if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) - KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage); - } - - m_iConsoles = 0; - m_iChannels = 0; - m_iQueries = 0; - m_iOther = 0; - - for(KviTaskBarItem * b = t->firstItem();b;b = t->nextItem()) - { - if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification)) - { - int iLevel = b->highlightLevel(); - switch(b->kviWindow()->type()) - { - case KVI_WINDOW_TYPE_CONSOLE: - if(m_iConsoles < iLevel) m_iConsoles = iLevel; - break; - case KVI_WINDOW_TYPE_CHANNEL: - if(m_iChannels < iLevel) m_iChannels = iLevel; - break; - case KVI_WINDOW_TYPE_QUERY: - if(m_iQueries < iLevel) m_iQueries = iLevel; - break; - default: - if(m_iOther < iLevel) m_iOther = iLevel; - break; - } - } else { - int iLevel=0; - if(b->kviWindow()->view()) - { - if(b->kviWindow()->view()->haveUnreadedHighlightedMessages()) - { - iLevel=2; - } else if(b->kviWindow()->view()->haveUnreadedMessages()) - { - iLevel=1; - } - if(iLevel>0) - switch(b->kviWindow()->type()) - { - case KVI_WINDOW_TYPE_CONSOLE: - if(m_iConsoles < iLevel) m_iConsoles = iLevel; - break; - case KVI_WINDOW_TYPE_CHANNEL: - if(m_iChannels < iLevel) m_iChannels = iLevel; - break; - case KVI_WINDOW_TYPE_QUERY: - if(m_iQueries < iLevel) m_iQueries = iLevel; - break; - default: - if(m_iOther < iLevel) m_iOther = iLevel; - break; - } - } - } - } - - if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification)) - { - if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iConsoles=2; - else if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iConsoles=1; - else m_iConsoles=0; - - if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iChannels=2; - else if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iChannels=1; - else m_iChannels=0; - - if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iQueries=2; - else if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iQueries=1; - else m_iQueries=0; - - if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iOther=2; - else if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iOther=1; - else m_iOther=0; - } -} - -void KviDockWidget::updateIcon() -{ - setIcon(TQIcon(m_CurrentPixmap)); -} - - -static KviDockWidget * dockwidget_find(KviFrame *f) -{ - if(!g_pDockWidgetList)return 0; - for(KviDockWidget * w = g_pDockWidgetList->first();w;w = g_pDockWidgetList->next()) - { - if(w->frame() == f)return w; - } - return 0; -} - -/* - @doc: dockwidget.show - @type: - command - @title: - dockwidget.show - @short: - Shows the dock widget for the current frame window - @keyterms: - dock widget , system tray - @syntax: - dockwidget.show - @description: - Shows the dock widget for the current frame window.[br] - The dock widget is a small widget that docks in the TDE panel.[br] - It shows a small icon of the earth and eventually displays four squares - that cover this icon: the bottom left square appears when there is some new - text in any console window, the square becomes red if the text is highlighted.[br] - The bottom right square appears when there is some new text in any channel window, - and it becomes red when the text is highlighted.[br] The upper right square refers to - query windows and the upper left one to any other kind of window (dcc , links...).[br] - If you move the mouse over the dock widget a tooltip will show you the last lines - of the "new" text in all these windows.[br] - This is useful when you keep the main KVIrc window minimized and you're working on something else: - if the dock widget shows nothing but the earth icon , nothing is happening in the main KVIrc window. - If the dock widget shows one or more white (or red) squares , you can move the mouse over - and check what's happened exactly and eventually bring up the main KVIrc window by clicking on the widget.[br] - [big]tecnical details[/big] - The dock widget is currently working in KDE compilation mode only: - it relies on the KWin implementation of the Window Manager interaction protocol. - @seealso: - [cmd]dockwidget.hide[/cmd] -*/ - -static bool dockwidget_kvs_cmd_show(KviKvsModuleCommandCall * c) -{ - if(!(dockwidget_find(c->window()->frame()))) - { - KviDockWidget * w = new KviDockWidget(c->window()->frame()); - w->show(); - } - return true; -} - -/* - @doc: dockwidget.hide - @type: - command - @title: - dockwidget.hide - @short: - Hides the dock widget for the current frame window - @syntax: - dockwidget.hide - @description: - Hides the dock widget for the current frame window - @seealso: - [cmd]dockwidget.show[/cmd] -*/ - -static bool dockwidget_kvs_cmd_hide(KviKvsModuleCommandCall * c) -{ - KviDockWidget * w= dockwidget_find(c->window()->frame()); - if(w)delete w; - // show the parent frame.. otherwise there will be no way to get it back - if(!c->window()->frame()->isVisible()) - { - c->window()->frame()->show(); - } - return true; -} - -/* - @doc: dockwidget.hidewindow - @type: - command - @title: - dockwidget.hidewindow - @short: - Returns the state of the dock widget - @syntax: - dockwidget.hidewindow - @description: - Hides the window, assotiated with dockwidget - @seealso: - [cmd]dockwidget.show[/cmd], [cmd]dockwidget.hide[/cmd] -*/ - -static bool dockwidget_kvs_cmd_hidewindow(KviKvsModuleCommandCall * c) -{ - KviDockWidget * w= dockwidget_find(c->window()->frame()); - if(w) - { - c->window()->frame()->hide(); - } - return true; -} - -/* - @doc: dockwidget.isVisible - @type: - function - @title: - $dockwidget.isVisible - @short: - Returns the state of the dock widget - @syntax: - $reguser.isVisible() - @description: - Returns 1 if the dock widget is actually visible , 0 otherwise. - @seealso: - [cmd]dockwidget.show[/cmd] -*/ - -static bool dockwidget_kvs_fnc_isvisible(KviKvsModuleFunctionCall * c) -{ - c->returnValue()->setBoolean(dockwidget_find(c->window()->frame())); - return true; -} - - - -// ======================================= -// init routine -// ======================================= -static bool dockwidget_module_init(KviModule * m) -{ - TQString buffer; -#ifdef COMPILE_ON_WINDOWS - g_pApp->findImage(buffer,"kvi_dock_win32-0.png"); -#else - g_pApp->findImage(buffer,"kvi_dock_part-0.png"); -#endif - g_pDock1 = new TQPixmap(buffer); - -#ifdef COMPILE_ON_WINDOWS - g_pApp->findImage(buffer,"kvi_dock_win32-1.png"); -#else - g_pApp->findImage(buffer,"kvi_dock_part-1.png"); -#endif - g_pDock2 = new TQPixmap(buffer); - -#ifdef COMPILE_ON_WINDOWS - g_pApp->findImage(buffer,"kvi_dock_win32-2.png"); -#else - g_pApp->findImage(buffer,"kvi_dock_part-2.png"); -#endif - - g_pDock3 = new TQPixmap(buffer); - - - g_pDockWidgetList = new KviPointerList<KviDockWidget>; - g_pDockWidgetList->setAutoDelete(false); - - - KVSM_REGISTER_SIMPLE_COMMAND(m,"hide",dockwidget_kvs_cmd_hide); - KVSM_REGISTER_SIMPLE_COMMAND(m,"hidewindow",dockwidget_kvs_cmd_hidewindow); - KVSM_REGISTER_SIMPLE_COMMAND(m,"show",dockwidget_kvs_cmd_show); - KVSM_REGISTER_FUNCTION(m,"isVisible",dockwidget_kvs_fnc_isvisible); - - return true; -} - -static bool dockwidget_module_cleanup(KviModule *m) -{ - while(g_pDockWidgetList->first())delete g_pDockWidgetList->first(); - delete g_pDockWidgetList; - g_pDockWidgetList = 0; - - delete g_pDock1; - g_pDock1 = 0; - - delete g_pDock2; - g_pDock2 = 0; - - delete g_pDock3; - g_pDock3 = 0; - - return true; -} - -static bool dockwidget_module_can_unload(KviModule *) -{ - return g_pDockWidgetList->isEmpty(); -} - -// ======================================= -// plugin definition structure -// ======================================= -KVIRC_MODULE( - "KVIrc dock widget implementation", - "2.0.0", - "Szymon Stefanek <pragma at kvirc dot net> and Alexey Uzhva <alexey at kvirc dot ru>" , - "exports the /dockwidget.* interface\n", - dockwidget_module_init , - dockwidget_module_can_unload, - 0, - dockwidget_module_cleanup -) - -#include "libkvidockwidget_qt4.moc" - -#endif diff --git a/src/modules/dockwidget/libkvidockwidget_qt4.h b/src/modules/dockwidget/libkvidockwidget_qt4.h deleted file mode 100644 index e00a4555..00000000 --- a/src/modules/dockwidget/libkvidockwidget_qt4.h +++ /dev/null @@ -1,82 +0,0 @@ -#ifndef _KVI_DOCKWIDGET_QT4_H_ -#define _KVI_DOCKWIDGET_QT4_H_ -// -// This file is part of the KVirc irc client distribution -// Creation date : Tue 02 Jan 2001 14:28:25 by Szymon Stefanek -// Copyright (C) 2000-2001 Szymon Stefanek (pragma at kvirc dot net) -// -// This program is FREE software. You can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your opinion) any later version. -// -// This program is distributed in the HOPE that it will be USEFUL, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -// See the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, write to the Free Software Foundation, -// Inc. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -// - -#include "kvi_settings.h" -//#ifdef COMPILE_USE_QT4 - -#include "kvi_frame.h" - -class KviTalPopupMenu; -#include <TQSystemTrayIcon> - -class TQPixmap; -class TQTimer; - -//class KviFrame; -class KviDynamicToolTip; - -class KviDockWidget : public TQSystemTrayIcon, public KviDockExtension -{ - TQ_OBJECT - -public: - KviDockWidget(KviFrame * win); - ~KviDockWidget(); -protected: - KviFrame * m_pFrm; - KviDynamicToolTip * m_pTip; - KviTalPopupMenu * m_pContextPopup; - KviTalPopupMenu * m_pAwayPopup; - - int m_iToggleFrame; - int m_iAwayMenuId; - - bool m_bFlashed; - - TQPixmap m_CurrentPixmap; - TQTimer* m_pFlashingTimer; - int m_iConsoles; - int m_iChannels; - int m_iQueries; - int m_iOther; -public: - KviFrame * frame(){ return m_pFrm; }; -public: - virtual void refresh(); - virtual void die(); - void updateIcon(); -protected: - void grabActivityInfo(); - -protected slots: - void fillContextPopup(); - void toggleParentFrame(); - void tipRequest(KviDynamicToolTip *tip,const TQPoint &pnt); - void doAway(int); - void flashingTimerShot(); - - void activatedSlot( TQSystemTrayIcon::ActivationReason reason ); -}; - -//#endif - -#endif //_KVI_DOCKWIDGET_QT4_H_ diff --git a/src/modules/editor/scripteditor.cpp b/src/modules/editor/scripteditor.cpp index f6875265..3dc017c6 100644 --- a/src/modules/editor/scripteditor.cpp +++ b/src/modules/editor/scripteditor.cpp @@ -32,11 +32,7 @@ #include "kvi_tal_scrollview.h" #include <tqmessagebox.h> #include <tqtimer.h> -#ifdef COMPILE_USE_QT4 - //#define TQSyntaxHighlighter Q3SyntaxHighlighter -#else #include <tqobjectlist.h> -#endif #include <tqcursor.h> #include <tqfont.h> #include <tqrect.h> @@ -79,11 +75,7 @@ KviCompletionBox::KviCompletionBox(TQWidget * parent) { setPaletteForegroundColor(TQColor(0,0,0)); setPaletteBackgroundColor(TQColor(255,255,255)); -#ifdef COMPILE_USE_QT4 - setHScrollBarMode(KviTalListBox::AlwaysOff); -#else setHScrollBarMode(TQScrollView::AlwaysOff); -#endif TQFont listfont=font(); listfont.setPointSize(8); setFont(listfont); @@ -241,17 +233,9 @@ KviScriptEditorWidget::~KviScriptEditorWidget() } -#ifdef COMPILE_USE_QT4 -Q3PopupMenu * KviScriptEditorWidget::createPopupMenu( const TQPoint& pos ) -#else TQPopupMenu * KviScriptEditorWidget::createPopupMenu( const TQPoint& pos ) -#endif { -#ifdef COMPILE_USE_QT4 - Q3PopupMenu *pop=KviTalTextEdit::createPopupMenu(pos); -#else TQPopupMenu *pop=KviTalTextEdit::createPopupMenu(pos); -#endif pop->insertItem(__tr2qs("Context sensitive help"),this,TQT_SLOT(slotHelp()),TQt::CTRL+TQt::Key_H); pop->insertItem(__tr2qs("&Replace"),this,TQT_SLOT(slotReplace()),TQt::CTRL+TQt::Key_R); return pop; @@ -288,11 +272,7 @@ void KviScriptEditorWidget::updateOptions() p.setColor(TQColorGroup::Text,g_clrNormalText); setPalette(p); -#ifdef COMPILE_USE_QT4 - setTextFormat(TQt::PlainText); -#else setTextFormat(KviTalTextEdit::PlainText); -#endif // this will rehighlight everything setText(text()); // an "hack" to ensure Update all in the editor @@ -847,9 +827,7 @@ KviScriptEditorImplementation::KviScriptEditorImplementation(TQWidget * par) TQGridLayout * g = new TQGridLayout(this,2,3,0,0); m_pFindLineedit = new TQLineEdit(" ",this); -#ifndef COMPILE_USE_QT4 m_pFindLineedit->setFrameStyle(TQFrame::Sunken | TQFrame::Panel); -#endif m_pFindLineedit->setText(""); m_pFindLineedit->setPaletteForegroundColor(g_clrFind); @@ -857,11 +835,7 @@ KviScriptEditorImplementation::KviScriptEditorImplementation(TQWidget * par) g->addMultiCellWidget(m_pEditor,0,0,0,3); g->setRowStretch(0,1); -#ifdef COMPILE_USE_QT4 - TQToolButton * b = new TQToolButton(TQt::DownArrow,this,"dsa2"); -#else TQToolButton * b = new TQToolButton(DownArrow,this); -#endif b->setMinimumWidth(24); g->addWidget(b,1,0); @@ -1006,11 +980,7 @@ void KviScriptEditorImplementation::saveToFile() void KviScriptEditorImplementation::setText(const KviTQCString &txt) { m_pEditor->setText(txt.data()); -#ifdef COMPILE_USE_QT4 - m_pEditor->setTextFormat(TQt::PlainText); -#else m_pEditor->setTextFormat(KviTalTextEdit::PlainText); -#endif m_pEditor->moveCursor(KviTalTextEdit::MoveEnd,false); m_pEditor->setModified(false); updateRowColLabel(); @@ -1027,11 +997,7 @@ TQLineEdit * KviScriptEditorImplementation::getFindlineedit() void KviScriptEditorImplementation::setText(const TQString &txt) { m_pEditor->setText(txt); -#ifdef COMPILE_USE_QT4 - m_pEditor->setTextFormat(TQt::PlainText); -#else m_pEditor->setTextFormat(KviTalTextEdit::PlainText); -#endif m_pEditor->moveCursor(KviTalTextEdit::MoveEnd,false); m_pEditor->setModified(false); updateRowColLabel(); @@ -1127,36 +1093,28 @@ KviScriptEditorReplaceDialog::KviScriptEditorReplaceDialog( TQWidget* parent, co TQGridLayout *layout = new TQGridLayout( this, 1, 1, 11, 6, "replace layout"); m_pFindlineedit = new TQLineEdit( this, "findlineedit" ); -#ifndef COMPILE_USE_QT4 m_pFindlineedit->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, m_pFindlineedit->sizePolicy().hasHeightForWidth() ) ); m_pFindlineedit->setFrameShape( TQLineEdit::LineEditPanel ); m_pFindlineedit->setFrameShadow( TQLineEdit::Sunken ); -#endif layout->addMultiCellWidget( m_pFindlineedit, 2, 2, 1, 2 ); m_pReplacelineedit = new TQLineEdit( this, "replacelineedit" ); -#ifndef COMPILE_USE_QT4 m_pReplacelineedit->setFrameShape( TQLineEdit::LineEditPanel ); m_pReplacelineedit->setFrameShadow( TQLineEdit::Sunken ); -#endif layout->addMultiCellWidget( m_pReplacelineedit, 3, 3, 1, 2 ); m_pFindlineedit->setFocus(); TQLabel *findlabel = new TQLabel( this, "findlabel" ); findlabel->setText(tr("Word to Find")); -#ifndef COMPILE_USE_QT4 findlabel->setAutoResize(true); -#endif layout->addWidget( findlabel, 2, 0 ); TQLabel *replacelabel = new TQLabel( this, "replacelabel" ); replacelabel->setText(tr("Replace with")); -#ifndef COMPILE_USE_QT4 replacelabel->setAutoResize(true); -#endif layout->addWidget( replacelabel, 3, 0 ); TQPushButton *cancelbutton = new TQPushButton( this, "cancelButton" ); @@ -1182,10 +1140,8 @@ KviScriptEditorReplaceDialog::KviScriptEditorReplaceDialog( TQWidget* parent, co layout->addWidget( replace, 3, 3 ); replace->setEnabled(false); -#ifndef COMPILE_USE_QT4 clearWState( WState_Polished ); setTabOrder(m_pFindlineedit,m_pReplacelineedit); -#endif // signals and slots connections connect( replacebutton, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotReplace() ) ); connect( findNext, TQT_SIGNAL( clicked() ),this,TQT_SLOT( slotNextFind())); diff --git a/src/modules/editor/scripteditor.h b/src/modules/editor/scripteditor.h index e7718e07..7949870f 100644 --- a/src/modules/editor/scripteditor.h +++ b/src/modules/editor/scripteditor.h @@ -83,22 +83,13 @@ signals: protected: virtual void keyPressEvent(TQKeyEvent * e); void contentsMousePressEvent(TQMouseEvent *); -#ifdef COMPILE_USE_QT4 - Q3PopupMenu *createPopupMenu( const TQPoint& pos ); -#else TQPopupMenu *createPopupMenu( const TQPoint& pos ); -#endif TQWidget *m_pParent; TQString m_szHelp; }; -#ifdef COMPILE_USE_QT4 - #include <tq3syntaxhighlighter.h> - #define TQSyntaxHighlighter Q3SyntaxHighlighter -#else #include <tqobjectlist.h> -#endif class KviScriptSyntaxHighlighter : public TQSyntaxHighlighter { public: diff --git a/src/modules/file/libkvifile.cpp b/src/modules/file/libkvifile.cpp index 009340f9..a032dc6a 100644 --- a/src/modules/file/libkvifile.cpp +++ b/src/modules/file/libkvifile.cpp @@ -629,11 +629,7 @@ static bool file_kvs_fnc_ls(KviKvsModuleFunctionCall * c) return true; } -#ifdef COMPILE_USE_QT4 - TQFlags<TQDir::Filter> iFlags = 0; -#else int iFlags = 0; -#endif if(szFlags.isEmpty())iFlags = TQDir::Dirs | TQDir::Files | TQDir::NoSymLinks | TQDir::Readable | TQDir::Writable | TQDir::Executable | TQDir::Hidden | TQDir::System; else { if(szFlags.find('d',false) != -1)iFlags |= TQDir::Dirs; @@ -645,11 +641,7 @@ static bool file_kvs_fnc_ls(KviKvsModuleFunctionCall * c) if(szFlags.find('h',false) != -1)iFlags |= TQDir::Hidden; if(szFlags.find('s',false) != -1)iFlags |= TQDir::System; } -#ifdef COMPILE_USE_QT4 - TQFlags<TQDir::SortFlag> iSort = 0; -#else int iSort = 0; -#endif if(szFlags.isEmpty())iSort = TQDir::Unsorted; else { if(szFlags.find('n',false) != -1)iSort |= TQDir::Name; diff --git a/src/modules/filetransferwindow/filetransferwindow.cpp b/src/modules/filetransferwindow/filetransferwindow.cpp index 23d1ffae..a1b8d505 100644 --- a/src/modules/filetransferwindow/filetransferwindow.cpp +++ b/src/modules/filetransferwindow/filetransferwindow.cpp @@ -39,11 +39,7 @@ #include <tqsplitter.h> #include <tqtooltip.h> #include "kvi_tal_hbox.h" -#ifdef COMPILE_USE_QT4 - #include <tq3header.h> -#else #include <tqheader.h> -#endif #include <tqpainter.h> #include <tqmessagebox.h> #include <tqclipboard.h> @@ -579,14 +575,10 @@ void KviFileTransferWindow::copyLocalFileToClipboard() if(!t)return; TQString tmp = t->localFileName(); if(tmp.isEmpty())return; -#ifdef COMPILE_USE_QT4 - TQApplication::clipboard()->setText(tmp); -#else TQApplication::clipboard()->setSelectionMode(false); TQApplication::clipboard()->setText(tmp); TQApplication::clipboard()->setSelectionMode(true); TQApplication::clipboard()->setText(tmp); -#endif } void KviFileTransferWindow::openLocalFileFolder() diff --git a/src/modules/help/helpwidget.cpp b/src/modules/help/helpwidget.cpp index 96a7edb9..67c0793d 100644 --- a/src/modules/help/helpwidget.cpp +++ b/src/modules/help/helpwidget.cpp @@ -52,9 +52,7 @@ KviHelpWidget::KviHelpWidget(TQWidget * par,KviFrame * lpFrm,bool bIsStandalone) //#warning "Re enable this when using TQt 3.0 : TQProcess " m_pTextBrowser = new TQTextBrowser(this,"text_browser"); m_pTextBrowser->setFrameStyle(TQFrame::StyledPanel|TQFrame::Sunken); -#ifndef COMPILE_USE_QT4 m_pTextBrowser->setFocusPolicy(TQ_NoFocus); -#endif m_pToolBar = new KviTalHBox(this); m_pBtnIndex = new KviStyledToolButton(m_pToolBar); @@ -99,11 +97,7 @@ KviHelpWidget::~KviHelpWidget() void KviHelpWidget::showIndex() { -#ifdef COMPILE_USE_QT4 - m_pTextBrowser->setSource(TQUrl("index.html")); -#else m_pTextBrowser->setSource("index.html"); -#endif } void KviHelpWidget::resizeEvent(TQResizeEvent *e) diff --git a/src/modules/help/helpwindow.cpp b/src/modules/help/helpwindow.cpp index 1be7f5e8..fbeb1abf 100644 --- a/src/modules/help/helpwindow.cpp +++ b/src/modules/help/helpwindow.cpp @@ -61,11 +61,7 @@ KviHelpWindow::KviHelpWindow(KviFrame * lpFrm,const char * name) if ( TQFileInfo( szDoclist ).exists() && TQFileInfo( szDict ).exists() ) { g_pDocIndex->readDict(); } else { -#ifdef COMPILE_USE_QT4 - TQProgressDialog* pProgressDialog = new TQProgressDialog( __tr2qs("Indexing help files"), __tr2qs("Cancel"), 0,100 ); -#else TQProgressDialog* pProgressDialog = new TQProgressDialog( __tr2qs("Indexing help files"), __tr2qs("Cancel"), 100 ); -#endif connect(g_pDocIndex,TQT_SIGNAL(indexingProgress(int)), pProgressDialog, TQT_SLOT(setProgress(int)) ); g_pDocIndex->makeIndex(); g_pDocIndex->writeDict(); @@ -148,11 +144,7 @@ void KviHelpWindow::loadProperties(KviConfig *cfg) void KviHelpWindow::refreshIndex() { m_pIndexListBox->clear(); -#ifdef COMPILE_USE_QT4 - TQProgressDialog* pProgressDialog = new TQProgressDialog( __tr2qs("Indexing help files"), __tr2qs("Cancel"), 0,100 ); -#else TQProgressDialog* pProgressDialog = new TQProgressDialog( __tr2qs("Indexing help files"), __tr2qs("Cancel"), 100 ); -#endif connect(g_pDocIndex,TQT_SIGNAL(indexingProgress(int)), pProgressDialog, TQT_SLOT(setProgress(int)) ); g_pDocIndex->makeIndex(); g_pDocIndex->writeDict(); @@ -183,11 +175,7 @@ void KviHelpWindow::startSearch() (*it) = (*it).replace( "\"", "" ); } if ( str.contains( '\"' ) ) { -#ifdef COMPILE_USE_QT4 - if ( (str.count( '\"' ))%2 == 0 ) { -#else if ( (str.contains( '\"' ))%2 == 0 ) { -#endif int beg = 0; int end = 0; TQString s; @@ -213,11 +201,7 @@ void KviHelpWindow::startSearch() return; } } -#ifdef COMPILE_USE_QT4 - setCursor( TQt::WaitCursor ); -#else setCursor( waitCursor ); -#endif m_foundDocs.clear(); m_foundDocs = g_pDocIndex->query( m_terms, termSeq, seqWords ); @@ -246,11 +230,7 @@ void KviHelpWindow::startSearch() if ( !s.isEmpty() ) m_terms << s; -#ifdef COMPILE_USE_QT4 - setCursor( TQt::ArrowCursor ); -#else setCursor( arrowCursor ); -#endif } TQTextBrowser * KviHelpWindow::textBrowser() diff --git a/src/modules/help/index.cpp b/src/modules/help/index.cpp index f63ca0a2..19d7a77c 100644 --- a/src/modules/help/index.cpp +++ b/src/modules/help/index.cpp @@ -411,9 +411,7 @@ TQStringList Index::query( const TQStringList &terms, const TQStringList &termSe TQStringList results; -#ifndef COMPILE_USE_QT4 qHeapSort( minDocs ); -#endif if ( termSeq.isEmpty() ) { for ( C = minDocs.begin(); C != minDocs.end(); ++C ) @@ -486,11 +484,7 @@ TQStringList Index::getWildcardTerms( const TQString &term ) TQStringList terms = split( term ); -#ifdef COMPILE_USE_QT4 - TQStringList::Iterator iter; -#else KviValueList<TQString>::iterator iter; -#endif KviPointerHashTableIterator<TQString,Entry> it( dict ); diff --git a/src/modules/help/libkvihelp.cpp b/src/modules/help/libkvihelp.cpp index e6d4e821..9ad1a07a 100644 --- a/src/modules/help/libkvihelp.cpp +++ b/src/modules/help/libkvihelp.cpp @@ -33,9 +33,6 @@ #include "kvi_frame.h" -#ifdef COMPILE_USE_QT4 - #include <tq3mimefactory.h> -#endif #include <tqsplitter.h> @@ -146,11 +143,7 @@ static bool help_kvs_cmd_open(KviKvsModuleCommandCall * c) KVSM_PARAMETER("document",KVS_PT_STRING,KVS_PF_OPTIONAL,doc) KVSM_PARAMETERS_END(c) if(doc.isEmpty())doc = "index.html"; -#ifdef COMPILE_USE_QT4 - Q3MimeSourceFactory * f = Q3MimeSourceFactory::defaultFactory(); -#else TQMimeSourceFactory * f = TQMimeSourceFactory::defaultFactory(); -#endif if(f) { if(!f->data(doc)) diff --git a/src/modules/list/listwindow.cpp b/src/modules/list/listwindow.cpp index ec6663a1..e9d3e74d 100644 --- a/src/modules/list/listwindow.cpp +++ b/src/modules/list/listwindow.cpp @@ -86,11 +86,7 @@ KviChannelListViewItem::~KviChannelListViewItem() { delete m_pData; } -#ifdef COMPILE_USE_QT4 -int KviChannelListViewItem::width ( const TQFontMetrics & fm, const KviTalListView * lv, int column ) const -#else int KviChannelListViewItem::width ( const TQFontMetrics & fm, const TQListView * lv, int column ) const -#endif { tqDebug("width request"); TQString szText; @@ -123,14 +119,9 @@ void KviChannelListViewItem::paintCell(TQPainter * p,const TQColorGroup &cg,int int marg = lv->itemMargin(); int r = marg; -#ifdef COMPILE_USE_QT4 - - p->fillRect( 0, 0, width, height(), cg.brush(lv->viewport()->backgroundRole()) ); -#else const TQColorGroup::ColorRole crole = TQPalette::backgroundRoleFromMode(lv->viewport()->backgroundMode()); p->fillRect( 0, 0, width, height(), cg.brush( crole ) ); -#endif if ( isSelected() && (column == 0 || lv->allColumnsShowFocus()) ) { diff --git a/src/modules/list/listwindow.h b/src/modules/list/listwindow.h index 6d0abea9..3b93b15c 100644 --- a/src/modules/list/listwindow.h +++ b/src/modules/list/listwindow.h @@ -63,11 +63,7 @@ protected: KviChannelListViewItemData * m_pData; public: const TQString & channel(){ return m_pData->m_szChan; }; -#ifdef COMPILE_USE_QT4 - int width ( const TQFontMetrics & fm, const KviTalListView * lv, int column ) const; -#else int width ( const TQFontMetrics & fm, const TQListView * lv, int column ) const; -#endif protected: virtual void paintCell(TQPainter * p,const TQColorGroup &cg,int col,int wdth,int align); virtual TQString key(int col,bool) const; diff --git a/src/modules/logview/logviewmdiwindow.cpp b/src/modules/logview/logviewmdiwindow.cpp index 2e045d84..1faa6146 100644 --- a/src/modules/logview/logviewmdiwindow.cpp +++ b/src/modules/logview/logviewmdiwindow.cpp @@ -32,11 +32,7 @@ #include "kvi_qcstring.h" #include "kvi_app.h" #include "kvi_fileutils.h" -#ifdef COMPILE_USE_QT4 - #include <tq3progressdialog.h> -#else #include <tqprogressdialog.h> -#endif #include "kvi_valuelist.h" #include "kvi_accel.h" #include <tqpixmap.h> @@ -68,11 +64,7 @@ KviLogViewMDIWindow::KviLogViewMDIWindow(KviModuleExtensionDescriptor * d,KviFra { g_pLogViewWindow = this; // m_pLogViewWidget = new KviLogViewWidget(this); - #ifdef COMPILE_USE_QT4 - m_pSplitter = new TQSplitter(Qt::Horizontal,this,"main_splitter"); -#else m_pSplitter = new TQSplitter(Qt::Horizontal,this,"main_splitter"); -#endif m_pTabWidget = new TQTabWidget(m_pSplitter); m_pIndexTab = new KviTalVBox(m_pTabWidget); @@ -153,11 +145,7 @@ KviLogViewMDIWindow::KviLogViewMDIWindow(KviModuleExtensionDescriptor * d,KviFra layout->addWidget(w,11,1); m_pIrcView = new KviIrcView(m_pSplitter,g_pFrame,this); -#ifdef COMPILE_USE_QT4 - m_pIrcView->setFocusPolicy(TQ_ClickFocus); -#else m_pIrcView->setFocusPolicy(TQ_ClickFocus); -#endif KviValueList<int> li; li.append(110); li.append(width()-110); @@ -250,15 +238,9 @@ void KviLogViewMDIWindow::setupItemList() TQDate toDate = m_pToDateEdit->date(); TQString textBuffer; -#ifdef COMPILE_USE_QT4 - Q3ProgressDialog progress( __tr2qs_ctx("Filtering files...","logview"), - __tr2qs_ctx("Abort filtering","logview"), m_logList.count(), - this, "progress", TRUE ); -#else TQProgressDialog progress( __tr2qs_ctx("Filtering files...","logview"), __tr2qs_ctx("Abort filtering","logview"), m_logList.count(), this, "progress", TRUE ); -#endif int i=0; diff --git a/src/modules/my/idle_x11.cpp b/src/modules/my/idle_x11.cpp index 77caef53..a846a8c3 100644 --- a/src/modules/my/idle_x11.cpp +++ b/src/modules/my/idle_x11.cpp @@ -37,9 +37,6 @@ int IdlePlatform::secondsIdle() { return 0; } #include<X11/Xutil.h> #include<X11/extensions/scrnsaver.h> -#ifdef COMPILE_USE_QT4 - #include <tqdesktopwidget.h> -#endif static XErrorHandler old_handler = 0; extern "C" int xerrhandler(Display* dpy, XErrorEvent* err) @@ -90,19 +87,12 @@ bool IdlePlatform::init() return false; } -#ifdef COMPILE_USE_QT4 - #include <tqx11info_x11.h> -#endif int IdlePlatform::secondsIdle() { if(!d->ss_info) return 0; -#ifdef COMPILE_USE_QT4 - if(!XScreenSaverQueryInfo(TQT_TQPAINTDEVICE(TQApplication::desktop()->screen())->x11Display(), QX11Info::appRootWindow(), d->ss_info)) -#else if(!XScreenSaverQueryInfo(TQT_TQPAINTDEVICE(TQApplication::desktop()->screen())->x11Display(), tqt_xrootwin(), d->ss_info)) -#endif return 0; return d->ss_info->idle / 1000; } diff --git a/src/modules/notifier/notifiermessage.cpp b/src/modules/notifier/notifiermessage.cpp index bec675df..d15091fb 100644 --- a/src/modules/notifier/notifiermessage.cpp +++ b/src/modules/notifier/notifiermessage.cpp @@ -51,12 +51,7 @@ #include <tqdesktopwidget.h> #include <tqtooltip.h> -#ifdef COMPILE_USE_QT4 - #define TQPopupMenu Q3PopupMenu - #include <tq3popupmenu.h> -#else #include <tqpopupmenu.h> -#endif extern kvi_time_t g_tNotifierDisabledUntil; diff --git a/src/modules/notifier/notifiermessage.h b/src/modules/notifier/notifiermessage.h index 19af4966..d85eed5d 100644 --- a/src/modules/notifier/notifiermessage.h +++ b/src/modules/notifier/notifiermessage.h @@ -41,14 +41,7 @@ #include "kvi_pointerlist.h" #include "kvi_time.h" -#ifdef COMPILE_USE_QT4 - #define TQSimpleRichText Q3SimpleRichText - #define TQPopupMenu Q3PopupMenu - #include <tq3popupmenu.h> - #include <tq3simplerichtext.h> -#else #include <tqsimplerichtext.h> -#endif class KviWindow; class KviNotifierWindow; diff --git a/src/modules/notifier/notifierwindow.cpp b/src/modules/notifier/notifierwindow.cpp index 290daaef..25afa711 100644 --- a/src/modules/notifier/notifierwindow.cpp +++ b/src/modules/notifier/notifierwindow.cpp @@ -23,16 +23,8 @@ //================================================================================== #include "kvi_settings.h" -#ifdef COMPILE_USE_QT4 - #define TQPopupMenu Q3PopupMenu - #define TQSimpleRichText Q3SimpleRichText - - #include <tq3popupmenu.h> - #include <tq3simplerichtext.h> -#else #include <tqpopupmenu.h> #include <tqsimplerichtext.h> -#endif #include <tqpainter.h> @@ -127,11 +119,7 @@ KviNotifierWindow::KviNotifierWindow() if(m_iInputHeight < 10)m_iInputHeight = 10; setBackgroundMode(TQt::NoBackground); -#ifdef COMPILE_USE_QT4 setFocusPolicy(TQ_NoFocus); -#else - setFocusPolicy(TQ_NoFocus); -#endif setMouseTracking(true); //setCursor(m_cursor); @@ -325,14 +313,12 @@ void KviNotifierWindow::doShow(bool bDoAnimate) m_bNextDown = false; m_bWriteDown = false; m_bBlinkOn = false; - #if (!defined COMPILE_USE_QT4) || !(defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX))) m_imgDesktop = TQPixmap(TQPixmap::grabWindow( TQApplication::desktop()->winId(), m_wndRect.x(), m_wndRect.y(), m_wndRect.width(), m_wndRect.height())).convertToImage(); - #endif // TQPixmap tmp = TQPixmap::grabWindow( TQApplication::desktop()->winId(),m_wndRect.x(), m_wndRect.y(), m_wndRect.width(), m_wndRect.height()); // tmp.save("/root/pix.png","PNG"); m_pixForeground.resize(m_pixBackground.size()); @@ -344,15 +330,8 @@ void KviNotifierWindow::doShow(bool bDoAnimate) m_dOpacity = OPACITY_STEP; m_eState = Showing; m_bCrashShowWorkAround=true; - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - setWindowOpacity(m_dOpacity); - #endif show(); - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - m_pShowHideTimer->start(40); - #else m_pShowHideTimer->start(100); - #endif computeRect(); m_bCrashShowWorkAround=false; //show(); @@ -382,7 +361,7 @@ void KviNotifierWindow::heartbeat() { bool bIncreasing; - double targetOpacity = 0; //qt4 + double targetOpacity = 0; switch(m_eState) { case Hidden: @@ -401,18 +380,9 @@ void KviNotifierWindow::heartbeat() m_eState = Hiding; } else { m_dOpacity += OPACITY_STEP; -#ifdef COMPILE_USE_QT4 - targetOpacity = isActiveWindow() ? KVI_OPTION_UINT(KviOption_uintNotifierActiveTransparency) : KVI_OPTION_UINT(KviOption_uintNotifierInactiveTransparency); - - targetOpacity/=100; - if(m_dOpacity >= targetOpacity) - { - m_dOpacity = targetOpacity; -#else if(m_dOpacity >= 1.0) { m_dOpacity = 1.0; -#endif m_eState = Visible; stopShowHideTimer(); startBlinking(); @@ -421,54 +391,12 @@ void KviNotifierWindow::heartbeat() if(!isVisible())show(); //!!! if(m_pLineEdit->isVisible())m_pLineEdit->hide(); - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - setWindowOpacity(m_dOpacity); - #endif update(); } break; -#ifdef COMPILE_USE_QT4 - case FocusingOn: - targetOpacity = KVI_OPTION_UINT(KviOption_uintNotifierActiveTransparency); - targetOpacity/=100; - bIncreasing = targetOpacity>m_dOpacity; - m_dOpacity += bIncreasing? - OPACITY_STEP : -(OPACITY_STEP); - if( (bIncreasing && (m_dOpacity >= targetOpacity) ) || - (!bIncreasing && (m_dOpacity <= targetOpacity) ) - ) - { - m_dOpacity = targetOpacity; - m_eState = Visible; - stopShowHideTimer(); - } - - setWindowOpacity(m_dOpacity); - break; - case FocusingOff: - targetOpacity = KVI_OPTION_UINT(KviOption_uintNotifierInactiveTransparency); - targetOpacity/=100; - bIncreasing = targetOpacity>m_dOpacity; - m_dOpacity += bIncreasing ? OPACITY_STEP : -(OPACITY_STEP); - //tqDebug("%f %f %i %i",m_dOpacity,targetOpacity,bIncreasing,(m_dOpacity >= targetOpacity)); - if( (bIncreasing && (m_dOpacity >= targetOpacity) ) || - (!bIncreasing && (m_dOpacity <= targetOpacity) ) - ) - { - m_dOpacity = targetOpacity; - m_eState = Visible; - stopShowHideTimer(); - } - - setWindowOpacity(m_dOpacity); - break; -#endif case Hiding: m_dOpacity -= OPACITY_STEP; - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - setWindowOpacity(m_dOpacity); - #endif if(m_pLineEdit->isVisible())m_pLineEdit->hide(); if(m_dOpacity <= 0.0)hideNow(); else update(); @@ -530,16 +458,8 @@ void KviNotifierWindow::doHide(bool bDoAnimate) connect(m_pShowHideTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(heartbeat())); m_dOpacity = 1.0 - OPACITY_STEP; m_eState = Hiding; - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - setWindowOpacity(m_dOpacity); - update(); - m_pShowHideTimer->start(40); - #else update(); m_pShowHideTimer->start(100); - #endif - - } break; } @@ -676,21 +596,12 @@ void KviNotifierWindow::paintEvent(TQPaintEvent * e) { TQPainter px(this); - #if defined(COMPILE_USE_QT4) && (defined(COMPILE_ON_WINDOWS) || defined(Q_OS_MACX)) - px.drawPixmap(0,0,m_pixForeground); - #else TQImage temp_image = m_pixForeground.convertToImage(); blend_images(m_imgBuffer,m_imgDesktop,temp_image,m_dOpacity); px.drawImage(0,0,m_imgBuffer); - #endif px.end(); } else { -#ifdef COMPILE_USE_QT4 - TQPainter px(this); - px.drawPixmap(0,0,m_pixForeground); -#else bitBlt(this,TQPoint(0,0),&m_pixForeground); -#endif } } @@ -1201,14 +1112,6 @@ inline void KviNotifierWindow::setCursor(int cur) { void KviNotifierWindow::enterEvent(TQEvent * e) { -#ifdef COMPILE_USE_QT4 - if(!m_pShowHideTimer) { - m_pShowHideTimer = new TQTimer(); - connect(m_pShowHideTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(heartbeat())); - } - m_eState = FocusingOn; - m_pShowHideTimer->start(40); -#endif } void KviNotifierWindow::leaveEvent(TQEvent * e) @@ -1218,14 +1121,6 @@ void KviNotifierWindow::leaveEvent(TQEvent * e) m_pWndTabs->resetIcons(); if (!m_bResizing) setCursor(-1); -#ifdef COMPILE_USE_QT4 - if(!m_pShowHideTimer) { - m_pShowHideTimer = new TQTimer(); - connect(m_pShowHideTimer,TQT_SIGNAL(timeout()),this,TQT_SLOT(heartbeat())); - } - m_eState = FocusingOff; - m_pShowHideTimer->start(40); -#endif } void KviNotifierWindow::contextPopup(const TQPoint &pos) 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) diff --git a/src/modules/options/container.cpp b/src/modules/options/container.cpp index a11dfaa5..badaf18b 100644 --- a/src/modules/options/container.cpp +++ b/src/modules/options/container.cpp @@ -32,9 +32,6 @@ #include "kvi_tal_tooltip.h" #include <tqevent.h> -#ifdef COMPILE_USE_QT4 - #include <tqdesktopwidget.h> -#endif extern KviOptionsInstanceManager * g_pOptionsInstanceManager; diff --git a/src/modules/options/dialog.cpp b/src/modules/options/dialog.cpp index 5f28da7d..92cba9d1 100644 --- a/src/modules/options/dialog.cpp +++ b/src/modules/options/dialog.cpp @@ -41,12 +41,8 @@ #include <tqpushbutton.h> #include "kvi_tal_tooltip.h" -#ifdef COMPILE_USE_QT4 - #include <tq3header.h> -#else - #include <tqheader.h> - #include <tqobjectlist.h> -#endif +#include <tqheader.h> +#include <tqobjectlist.h> #include "kvi_tal_popupmenu.h" #include <tqtoolbutton.h> #include <tqcheckbox.h> @@ -66,9 +62,6 @@ KviGeneralOptionsFrontWidget::KviGeneralOptionsFrontWidget(TQWidget *parent,cons { createLayout(1,1); TQLabel * l = new TQLabel(szText,this); -#ifdef COMPILE_USE_QT4 - l->setWordWrap(true); -#endif l->setAlignment(TQt::AlignTop); layout()->addWidget(l,0,0); } @@ -323,43 +316,26 @@ bool KviOptionsDialog::recursiveSearch(KviOptionsListViewItem * pItem,const TQSt TQTabWidget * pTabWidgetToMark = 0; TQObject * o; -#ifdef COMPILE_USE_QT4 - TQObjectList ol = pItem->m_pOptionsWidget->queryList(); - if(ol.count() > 0) - { - for(TQObjectList::Iterator it = ol.begin();it != ol.end();++it) - { - o = *it; -#else TQObjectList * ol = pItem->m_pOptionsWidget->queryList(); if(ol) { TQObjectListIt it(*ol); while((o = it.current())/* && (!bFoundSomethingHere)*/) { -#endif TQString szText; if(o->inherits("TQLabel"))szText = ((TQLabel *)o)->text(); else if(o->inherits("TQCheckBox"))szText = ((TQCheckBox *)o)->text(); else if(o->inherits("KviTalGroupBox"))szText = ((KviTalGroupBox *)o)->title(); #ifdef COMPILE_INFO_TIPS if(o->inherits("TQWidget")) -#ifdef COMPILE_USE_QT4 - szText.append(((TQWidget *)o)->toolTip()); -#else szText.append(TQToolTip::textFor((TQWidget*)o)); #endif -#endif if(!szText.isEmpty()) { bool bOk = true; for(int j=0;j<lKeywords.count();j++) { -#ifdef COMPILE_USE_QT4 - if(szText.find(lKeywords.at(j),0,false) == -1) -#else if(szText.find(*(lKeywords.at(j)),0,false) == -1) -#endif { bOk = false; break; @@ -414,13 +390,9 @@ bool KviOptionsDialog::recursiveSearch(KviOptionsListViewItem * pItem,const TQSt } } -#ifndef COMPILE_USE_QT4 ++it; -#endif } -#ifndef COMPILE_USE_QT4 delete ol; -#endif } if(pTabWidgetToMark) diff --git a/src/modules/options/optw_messages.cpp b/src/modules/options/optw_messages.cpp index d76826fe..946339f6 100644 --- a/src/modules/options/optw_messages.cpp +++ b/src/modules/options/optw_messages.cpp @@ -297,17 +297,9 @@ void KviMessageListViewItem::paintCell(TQPainter * p,const TQColorGroup &,int,in p->drawText(24,listView()->itemMargin(),w - 24,height() - (listView()->itemMargin() * 2),TQt::AlignLeft | TQt::AlignVCenter,txt); if(isSelected()) { -#ifdef COMPILE_USE_QT4 - TQPen pen(KVI_OPTION_COLOR(KviOption_colorIrcViewBackground)); - pen.setStyle(TQt::DashLine); - p->setPen( pen); - p->drawRect(0,0,w,height()); - p->drawRect(1,1,w - 2,height() - 2); -#else p->drawWinFocusRect(0,0,w,height(),KVI_OPTION_COLOR(KviOption_colorIrcViewBackground)); p->drawWinFocusRect(1,1,w - 2,height() - 2,KVI_OPTION_COLOR(KviOption_colorIrcViewBackground)); -#endif } } @@ -340,18 +332,9 @@ void KviMessageColorListBoxItem::paint(TQPainter * p) } if(isSelected()) { -#ifdef COMPILE_USE_QT4 - TQPen pen(clr); - pen.setStyle(TQt::DashLine); - p->setPen( pen); - p->drawRect(0,0,width(lb),height(lb)); - p->drawRect(1,1,width(lb) - 2,height(lb) - 2); - p->drawRect(2,2,width(lb) - 4,height(lb) - 4); -#else p->drawWinFocusRect(0,0,width(lb),height(lb),clr); p->drawWinFocusRect(1,1,width(lb) - 2,height(lb) - 2,clr); p->drawWinFocusRect(2,2,width(lb) - 4,height(lb) - 4,clr); -#endif } } /* @@ -399,11 +382,7 @@ KviMessageColorsOptionsWidget::KviMessageColorsOptionsWidget(TQWidget * parent) m_pListView->setSelectionMode(KviTalListView::Single); m_pListView->setFont(KVI_OPTION_FONT(KviOption_fontIrcView)); m_pListView->setStaticBackground(true); -#ifdef COMPILE_USE_QT4 - m_pListView->viewport()->setBackgroundMode(TQt::NoBackground); -#else m_pListView->viewport()->setBackgroundMode(TQWidget::NoBackground); -#endif addWidgetToLayout(m_pListView,0,0,2,0); diff --git a/src/modules/options/optw_texticons.h b/src/modules/options/optw_texticons.h index 4a6dae6c..7c754149 100644 --- a/src/modules/options/optw_texticons.h +++ b/src/modules/options/optw_texticons.h @@ -36,15 +36,9 @@ #include "kvi_tal_popupmenu.h" #include "kvi_tal_hbox.h" -#ifdef COMPILE_USE_QT4 -#include <tq3table.h> -#define KviTalTable Q3Table -#define KviTalTableItem Q3TableItem -#else #include <tqtable.h> #define KviTalTable TQTable #define KviTalTableItem TQTableItem -#endif class KviTextIconTableItem; diff --git a/src/modules/popupeditor/popupeditor.cpp b/src/modules/popupeditor/popupeditor.cpp index ab4d801a..cd2d8ba6 100644 --- a/src/modules/popupeditor/popupeditor.cpp +++ b/src/modules/popupeditor/popupeditor.cpp @@ -202,12 +202,7 @@ KviSinglePopupEditor::KviSinglePopupEditor(TQWidget * par) m_pMenuButton = new TQPushButton(__tr2qs("Test"),this); g->addWidget(m_pMenuButton,0,2); connect(m_pMenuButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(testPopup())); -#ifdef COMPILE_USE_QT4 - TQSplitter * spl = new TQSplitter(Qt::Vertical,this,"popupeditor"); - spl->setOpaqueResize(false); -#else TQSplitter * spl = new TQSplitter(Qt::Vertical,this); -#endif m_pListView = new KviTalListView(spl); m_pListView->addColumn(__tr2qs("Item")); @@ -1028,12 +1023,7 @@ KviPopupEditor::KviPopupEditor(TQWidget * par) : TQWidget(par) { TQGridLayout * l = new TQGridLayout(this,1,1,0,2); -#ifdef COMPILE_USE_QT4 - TQSplitter * spl = new TQSplitter(Qt::Horizontal,this,"popupeditor"); - spl->setOpaqueResize(false); -#else TQSplitter * spl = new TQSplitter(Qt::Horizontal,this); -#endif l->addWidget(spl,0,0); KviTalVBox * box = new KviTalVBox(spl); diff --git a/src/modules/raweditor/raweditor.cpp b/src/modules/raweditor/raweditor.cpp index 98d0a042..e0e49011 100644 --- a/src/modules/raweditor/raweditor.cpp +++ b/src/modules/raweditor/raweditor.cpp @@ -74,12 +74,7 @@ KviRawEditor::KviRawEditor(TQWidget * par) : TQWidget(par,"raw_event_editor") { TQGridLayout * l = new TQGridLayout(this,1,1,2,2); -#ifdef COMPILE_USE_QT4 - TQSplitter * spl = new TQSplitter(Qt::Horizontal,this,"raweditorv"); - spl->setOpaqueResize(false); -#else TQSplitter * spl = new TQSplitter(Qt::Horizontal,this); -#endif l->addWidget(spl,0,0); KviTalVBox * boxi = new KviTalVBox(spl); diff --git a/src/modules/reguser/dialog.cpp b/src/modules/reguser/dialog.cpp index 199f87af..b6741470 100644 --- a/src/modules/reguser/dialog.cpp +++ b/src/modules/reguser/dialog.cpp @@ -42,15 +42,7 @@ #include <tqlayout.h> #include <tqlabel.h> -#ifdef COMPILE_USE_QT4 -#include <tq3header.h> -#include <tqevent.h> -#include <TQImageWriter> -#include <TQImageReader> - -#else #include <tqheader.h> -#endif #include "kvi_pointerhashtable.h" #include <tqimage.h> #include <tqstring.h> @@ -740,18 +732,11 @@ void KviRegisteredUsersDialog::exportClicked() if(!av->pixmap()->isNull()) { if(!f.save(1))goto write_error; -#ifdef COMPILE_USE_QT4 - TQImageWriter io; - io.setDevice(&f); - io.setFormat("PNG"); - if(!io.write(av->pixmap()->convertToImage()))goto write_error; -#else TQImageIO io; io.setImage(av->pixmap()->convertToImage()); io.setIODevice(TQT_TQIODEVICE(&f)); io.setFormat("PNG"); if(!io.write())goto write_error; -#endif } else { if(!f.save(0))goto write_error; } @@ -845,14 +830,6 @@ void KviRegisteredUsersDialog::importClicked() { // there is an avatar TQImage img; -#ifdef COMPILE_USE_QT4 - TQImageReader io; - io.setDevice(&f); - io.setFormat("PNG"); - img=io.read(); -// if(io.read())goto read_error; - -#else TQImageIO io; io.setImage(img); io.setIODevice(TQT_TQIODEVICE(&f)); @@ -861,7 +838,6 @@ void KviRegisteredUsersDialog::importClicked() if(!io.read())goto read_error; img = io.image(); -#endif if(img.isNull())tqDebug("Ops.. readed a null image ?"); KviStr fName = u->name(); @@ -898,6 +874,3 @@ succesfull_import: f.close(); fillList(); } -#if defined(COMPILE_USE_QT4) && defined(COMPILE_ON_WINDOWS) -#include "dialog.moc" -#endif diff --git a/src/modules/reguser/dialog.h b/src/modules/reguser/dialog.h index 4dbb4c6b..88a86913 100644 --- a/src/modules/reguser/dialog.h +++ b/src/modules/reguser/dialog.h @@ -34,16 +34,10 @@ #include "kvi_tal_listbox.h" #include "kvi_pointerhashtable.h" #include "kvi_tal_popupmenu.h" -#ifdef COMPILE_USE_QT4 - #include <tq3intdict.h> - #include <tq3simplerichtext.h> - #define TQSimpleRichText Q3SimpleRichText -#else #include <tqsimplerichtext.h> #include <tqintdict.h> -#endif class KviRegisteredUsersDialogItemBase : public KviTalListViewItem { @@ -116,11 +110,7 @@ public: TQPushButton * m_pImportButton; TQPushButton * m_pExportButton; TQPushButton * m_pAddGroupButton; -#ifdef COMPILE_USE_QT4 - Q3IntDict<KviRegisteredUserGroup> m_TmpDict; -#else TQIntDict<KviRegisteredUserGroup> m_TmpDict; -#endif protected slots: void itemPressed(KviTalListViewItem *it,const TQPoint &pnt,int c); diff --git a/src/modules/reguser/edituser.cpp b/src/modules/reguser/edituser.cpp index 956b277e..6a82fa7e 100644 --- a/src/modules/reguser/edituser.cpp +++ b/src/modules/reguser/edituser.cpp @@ -44,13 +44,7 @@ #include <tqlayout.h> #include <tqlabel.h> #include <tqgroupbox.h> -#ifdef COMPILE_USE_QT4 -#include <tqevent.h> -#include <tq3header.h> -#include <tq3vbox.h> -#else #include <tqheader.h> -#endif #include "kvi_pointerhashtable.h" #include <tqimage.h> #include <tqstring.h> @@ -88,11 +82,7 @@ KviReguserPropertiesDialog::KviReguserPropertiesDialog(TQWidget * p,KviPointerHa TQGridLayout * g = new TQGridLayout(this,3,3,4,4); -#ifdef COMPILE_USE_QT4 - m_pTable = new Q3Table(this); -#else m_pTable = new TQTable(this); -#endif g->addMultiCellWidget(m_pTable,0,1,0,1); m_pTable->setNumCols(2); @@ -448,11 +438,7 @@ KviRegisteredUserEntryDialog::KviRegisteredUserEntryDialog(TQWidget *p,KviRegist addTab(p2,__tr2qs("Properties")); // Ignore TAB -#ifdef COMPILE_USE_QT4 - Q3VBox * vb = new Q3VBox(this); -#else TQVBox * vb = new TQVBox(this); -#endif vb->setMargin(10); m_pIgnoreEnabled = new KviStyledCheckBox(__tr2qs("Enable ignore for this user"),vb); diff --git a/src/modules/reguser/edituser.h b/src/modules/reguser/edituser.h index 97396397..835f5f2d 100644 --- a/src/modules/reguser/edituser.h +++ b/src/modules/reguser/edituser.h @@ -35,17 +35,10 @@ #include "kvi_tal_listbox.h" #include "kvi_pointerhashtable.h" #include <kvi_tal_tabdialog.h> -#ifdef COMPILE_USE_QT4 -#include <tq3table.h> -#define Kvi_Tal_Table Q3Table -#define Kvi_Tal_TableItem Q3TableItem - -#else #include <tqtable.h> #define Kvi_Tal_Table TQTable #define Kvi_Tal_TableItem TQTableItem -#endif #include "kvi_tal_popupmenu.h" #ifndef _EDITUSER_CPP_ @@ -62,11 +55,7 @@ public: KviReguserPropertiesDialog(TQWidget *p,KviPointerHashTable<TQString,TQString> * dict); ~KviReguserPropertiesDialog(); protected: -#ifdef COMPILE_USE_QT4 - Q3Table *m_pTable; -#else TQTable * m_pTable; -#endif KviPointerHashTable<TQString,TQString> * m_pPropertyDict; TQPushButton * m_pDelButton; TQPushButton * m_pAddButton; diff --git a/src/modules/reguser/wizard.cpp b/src/modules/reguser/wizard.cpp index 32034358..e0e49a4b 100644 --- a/src/modules/reguser/wizard.cpp +++ b/src/modules/reguser/wizard.cpp @@ -31,9 +31,6 @@ #include "kvi_pixmap.h" #include "kvi_regusersdb.h" #include "kvi_iconmanager.h" -#ifdef COMPILE_USE_QT4 -#include <TQDesktopWidget> -#endif #include <tqcheckbox.h> #include <tqlabel.h> diff --git a/src/modules/setup/setupwizard.cpp b/src/modules/setup/setupwizard.cpp index e17f5798..ee0230a7 100644 --- a/src/modules/setup/setupwizard.cpp +++ b/src/modules/setup/setupwizard.cpp @@ -55,9 +55,6 @@ bool g_bFoundMirc; #include <unistd.h> // for symlink() #endif -#ifdef COMPILE_USE_QT4 - #include <TQDesktopWidget> -#endif // libkvisetup.cpp extern TQString g_szChoosenIncomingDirectory; @@ -125,9 +122,6 @@ KviSetupPage::KviSetupPage(KviSetupWizard * w) l->setBackgroundColor(TQColor(48,48,48)); m_pTextLabel = new TQLabel(m_pVBox); -#ifdef COMPILE_USE_QT4 - m_pTextLabel->setWordWrap(true); -#endif m_pTextLabel->setAlignment(TQt::AlignJustify | TQt::AlignTop); m_pVBox->setStretchFactor(m_pTextLabel,1); } diff --git a/src/modules/setup/setupwizard.h b/src/modules/setup/setupwizard.h index d0f948bb..d4ab1229 100644 --- a/src/modules/setup/setupwizard.h +++ b/src/modules/setup/setupwizard.h @@ -32,13 +32,8 @@ #include <tqlabel.h> #include <tqpixmap.h> #include <tqlineedit.h> -#ifdef COMPILE_USE_QT4 -#include <tq3buttongroup.h> -#define KviTalVButtonGroup Q3VButtonGroup -#else #include <tqvbuttongroup.h> #define KviTalVButtonGroup TQVButtonGroup -#endif #include <tqradiobutton.h> #include <tqcombobox.h> #include <tqcheckbox.h> diff --git a/src/modules/sharedfileswindow/sharedfileswindow.cpp b/src/modules/sharedfileswindow/sharedfileswindow.cpp index 82500fb4..7f6bda29 100644 --- a/src/modules/sharedfileswindow/sharedfileswindow.cpp +++ b/src/modules/sharedfileswindow/sharedfileswindow.cpp @@ -206,11 +206,7 @@ KviSharedFilesWindow::KviSharedFilesWindow(KviModuleExtensionDescriptor * d,KviF : KviWindow(KVI_WINDOW_TYPE_TOOL,lpFrm,"shared files window",0) , KviModuleExtension(d) { g_pSharedFilesWindow = this; -#ifdef COMPILE_USE_QT4 m_pSplitter = new TQSplitter(Qt::Horizontal,this,"splitter"); -#else - m_pSplitter = new TQSplitter(Qt::Horizontal,this,"splitter"); -#endif KviTalVBox * vbox = new KviTalVBox(m_pSplitter); diff --git a/src/modules/socketspy/socketspywindow.cpp b/src/modules/socketspy/socketspywindow.cpp index a5ee44e4..54394e7d 100644 --- a/src/modules/socketspy/socketspywindow.cpp +++ b/src/modules/socketspy/socketspywindow.cpp @@ -37,11 +37,7 @@ KviSocketSpyWindow::KviSocketSpyWindow(KviFrame * lpFrm,KviConsole * lpConsole) : KviWindow(KVI_WINDOW_TYPE_SOCKETSPY,lpFrm,"socket_spy",lpConsole) , KviIrcDataStreamMonitor(lpConsole->context()) { g_pSocketSpyWindowList->append(this); - #ifdef COMPILE_USE_QT4 m_pSplitter = new TQSplitter(Qt::Horizontal,this,"splitter"); - #else - m_pSplitter = new TQSplitter(Qt::Horizontal,this,"splitter"); -#endif m_pIrcView = new KviIrcView(m_pSplitter,lpFrm,this); // Ensure proper focusing //setFocusHandler(m_pIrcView,this); diff --git a/src/modules/spaste/controller.cpp b/src/modules/spaste/controller.cpp index a98c8b24..bebb9692 100644 --- a/src/modules/spaste/controller.cpp +++ b/src/modules/spaste/controller.cpp @@ -86,7 +86,6 @@ bool SPasteController::pasteClipboardInit(void) void SPasteController::pasteFile(void) { -#ifndef COMPILE_USE_QT4 TQString line; if(m_pFile->readLine(line,999) != -1) { @@ -101,7 +100,6 @@ void SPasteController::pasteFile(void) m_pFile->close(); delete this; } -#endif } void SPasteController::pasteClipboard(void) diff --git a/src/modules/system/libkvisystem.cpp b/src/modules/system/libkvisystem.cpp index 2ecb47a8..e965ba92 100644 --- a/src/modules/system/libkvisystem.cpp +++ b/src/modules/system/libkvisystem.cpp @@ -565,7 +565,6 @@ static bool system_kvs_fnc_dcop(KviKvsModuleFunctionCall *c) c->returnValue()->setInteger(iii); } else if(szRetType == "QCStringList") { -#ifndef COMPILE_USE_QT4 QCStringList csl; ret >> csl; KviKvsArray * arry = new KviKvsArray(); @@ -576,7 +575,6 @@ static bool system_kvs_fnc_dcop(KviKvsModuleFunctionCall *c) idx++; } c->returnValue()->setArray(arry); -#endif } else if(szRetType == "TQStringList") { TQStringList csl; diff --git a/src/modules/theme/managementdialog.cpp b/src/modules/theme/managementdialog.cpp index 839f0f74..48b60869 100644 --- a/src/modules/theme/managementdialog.cpp +++ b/src/modules/theme/managementdialog.cpp @@ -55,9 +55,6 @@ #include <tqimage.h> #include <kvi_tal_textedit.h> //#include <tqmultilineedit.h> -#ifdef COMPILE_USE_QT4 -#include <TQCloseEvent> -#endif #include <tqbuffer.h> #include "kvi_options.h" diff --git a/src/modules/theme/managementdialog.h b/src/modules/theme/managementdialog.h index 9d8967b0..cdb15705 100644 --- a/src/modules/theme/managementdialog.h +++ b/src/modules/theme/managementdialog.h @@ -29,13 +29,8 @@ #include "kvi_theme.h" #include <tqdialog.h> -#ifdef COMPILE_USE_QT4 -#include <tq3simplerichtext.h> -#define KviTalSimpleRichText Q3SimpleRichText -#else #include <tqsimplerichtext.h> #define KviTalSimpleRichText TQSimpleRichText -#endif #include "kvi_tal_listbox.h" #include <tqcombobox.h> #include "kvi_tal_popupmenu.h" diff --git a/src/modules/theme/packthemedialog.cpp b/src/modules/theme/packthemedialog.cpp index 269fbfe9..7ae09b77 100644 --- a/src/modules/theme/packthemedialog.cpp +++ b/src/modules/theme/packthemedialog.cpp @@ -36,12 +36,7 @@ #include <tqtooltip.h> #include <tqimage.h> #include <kvi_tal_textedit.h> -#ifdef COMPILE_USE_QT4 -#include <tq3multilineedit.h> -#include <TQDateTime> -#else #include <tqmultilineedit.h> -#endif #include <tqbuffer.h> #include <tqlabel.h> #include <tqregexp.h> @@ -333,11 +328,7 @@ void KviPackThemeDialog::imageSelectionChanged(const TQString &szImagePath) { TQPixmap out; if(pix.width() > 300 || pix.height() > 225) -#ifdef COMPILE_USE_QT4 - out.convertFromImage(pix.scaled(300,225,TQt::KeepAspectRatio,TQt::SmoothTransformation)); -#else out.convertFromImage(pix.smoothScale(300,225,TQ_ScaleMin)); -#endif else out.convertFromImage(pix); m_pImageLabel->setPixmap(out); @@ -374,11 +365,7 @@ bool KviPackThemeDialog::packTheme() if(!pix.isNull()) { if(pix.width() > 300 || pix.height() > 225) - #ifdef COMPILE_USE_QT4 - out.convertFromImage(pix.scaled(300,225,TQt::KeepAspectRatio)); - #else out.convertFromImage(pix.smoothScale(300,225,TQ_ScaleMin)); -#endif else out.convertFromImage(pix); } else { @@ -407,11 +394,7 @@ bool KviPackThemeDialog::packTheme() if(!out.isNull()) { TQByteArray * pba = new TQByteArray(); -#ifdef COMPILE_USE_QT4 - TQBuffer buffer(pba,0); -#else TQBuffer buffer(*pba); -#endif buffer.open(IO_WriteOnly); out.save(&buffer,"PNG"); buffer.close(); @@ -445,11 +428,7 @@ bool KviPackThemeDialog::packTheme() { KviTQString::sprintf(szTmp,"Theme%dScreenshot",iIdx); TQByteArray * pba = new TQByteArray(); -#ifdef COMPILE_USE_QT4 - TQBuffer bufferz(pba,0); -#else TQBuffer bufferz(*pba); -#endif bufferz.open(IO_WriteOnly); pixScreenshot.save(&bufferz,"PNG"); bufferz.close(); diff --git a/src/modules/theme/savethemedialog.cpp b/src/modules/theme/savethemedialog.cpp index b6a93a0d..8e015309 100644 --- a/src/modules/theme/savethemedialog.cpp +++ b/src/modules/theme/savethemedialog.cpp @@ -36,12 +36,7 @@ #include <tqtooltip.h> #include <tqimage.h> #include <kvi_tal_textedit.h> -#ifdef COMPILE_USE_QT4 -#include <tq3multilineedit.h> -#include <TQDateTime> -#else #include <tqmultilineedit.h> -#endif #include <tqbuffer.h> #include <tqlabel.h> @@ -192,11 +187,7 @@ void KviSaveThemeDialog::imageSelectionChanged(const TQString &szImagePath) { TQPixmap out; if(pix.width() > 300 || pix.height() > 225) - #ifdef COMPILE_USE_QT4 - out.convertFromImage(pix.scaled(300,225,TQt::KeepAspectRatio)); - #else out.convertFromImage(pix.smoothScale(300,225,TQ_ScaleMin)); -#endif else out.convertFromImage(pix); m_pImageLabel->setPixmap(out); diff --git a/src/modules/theme/themefunctions.cpp b/src/modules/theme/themefunctions.cpp index 280d0192..654f30bf 100644 --- a/src/modules/theme/themefunctions.cpp +++ b/src/modules/theme/themefunctions.cpp @@ -34,12 +34,7 @@ #include "kvi_sourcesdate.h" #include "kvi_theme.h" #include "kvi_frame.h" -#ifdef COMPILE_USE_QT4 -#define KviTalMimeSourceFactory Q3MimeSourceFactory -#include <tq3mimefactory.h> -#else #define KviTalMimeSourceFactory TQMimeSourceFactory -#endif #include <tqmime.h> namespace KviThemeFunctions diff --git a/src/modules/tip/libkvitip.cpp b/src/modules/tip/libkvitip.cpp index a1cf6316..7ad6bf55 100644 --- a/src/modules/tip/libkvitip.cpp +++ b/src/modules/tip/libkvitip.cpp @@ -33,15 +33,8 @@ #include <tqpushbutton.h> -#ifdef COMPILE_USE_QT4 -#include <tq3simplerichtext.h> -#include <TQDesktopWidget> -#include <TQCloseEvent> -#define KviTalSimpleRichText Q3SimpleRichText -#else #include <tqsimplerichtext.h> #define KviTalSimpleRichText TQSimpleRichText -#endif #include <tqfont.h> #include <tqtextcodec.h> @@ -64,11 +57,7 @@ KviTipFrame::KviTipFrame(TQWidget * par) KviStr buffer; g_pApp->findImage(buffer,"kvi_tip.png"); m_pTipPixmap = new TQPixmap(TQString(buffer.ptr())); -#ifdef COMPILE_USE_QT4 - setBackgroundMode(TQt::NoBackground); -#else setBackgroundMode(TQWidget::NoBackground); -#endif setFrameStyle(TQFrame::Sunken | TQFrame::WinPanel); } diff --git a/src/modules/url/libkviurl.cpp b/src/modules/url/libkviurl.cpp index 0b67792c..3556fd3b 100644 --- a/src/modules/url/libkviurl.cpp +++ b/src/modules/url/libkviurl.cpp @@ -38,10 +38,6 @@ #include <tqcursor.h> #include <tqdatetime.h> -#ifdef COMPILE_USE_QT4 - #include <tq3textstream.h> - #include <TQTextStream> -#endif static TQPixmap * g_pUrlIconPixmap = 0; static KviUrlAction * g_pUrlAction = 0; @@ -148,11 +144,7 @@ UrlDialog::UrlDialog(KviPointerList<KviUrl> *g_pList) connect(m_pUrlList,TQT_SIGNAL(rightButtonPressed(KviTalListViewItem *, const TQPoint &, int)),TQT_SLOT(popup(KviTalListViewItem *, const TQPoint &, int))); // setFocusHandlerNoChildren(m_pUrlList); -#ifdef COMPILE_USE_QT4 m_pUrlList->setFocusPolicy(TQ_StrongFocus); -#else - m_pUrlList->setFocusPolicy(TQ_StrongFocus); -#endif m_pUrlList->setFocus(); } @@ -530,11 +522,7 @@ void loadUrlList() TQFile file; file.setName(TQString::fromUtf8(urllist.ptr())); if (!file.open(IO_ReadOnly))return; -#ifdef COMPILE_USE_QT4 - Q3TextStream stream(&file); -#else TQTextStream stream(&file); -#endif g_pList->clear(); @@ -594,11 +582,7 @@ void loadBanList() TQFile file; file.setName(TQString::fromUtf8(banlist.ptr())); if (!file.open(IO_ReadOnly))return; -#ifdef COMPILE_USE_QT4 - Q3TextStream stream(&file); -#else TQTextStream stream(&file); -#endif g_pBanList->clear(); int i=0; diff --git a/src/modules/url/libkviurl.h b/src/modules/url/libkviurl.h index 531a4671..9d99de1e 100644 --- a/src/modules/url/libkviurl.h +++ b/src/modules/url/libkviurl.h @@ -27,11 +27,7 @@ #include <tqstring.h> #include <tqpushbutton.h> #include <tqfile.h> -#ifdef COMPILE_USE_QT4 - #include <tq3textstream.h> -#else #include <tqtextstream.h> -#endif #include <tqcheckbox.h> #include "kvi_tal_listbox.h" #include <tqmenubar.h> |