summaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/actioneditor/actioneditor.cpp14
-rw-r--r--src/modules/actioneditor/actioneditor.h5
-rw-r--r--src/modules/addon/managementdialog.cpp31
-rw-r--r--src/modules/addon/managementdialog.h8
-rw-r--r--src/modules/aliaseditor/aliaseditor.cpp5
-rw-r--r--src/modules/channelsjoin/channelsjoinwindow.cpp8
-rw-r--r--src/modules/dcc/broker.h4
-rw-r--r--src/modules/dcc/dialogs.cpp6
-rw-r--r--src/modules/dialog/libkvidialog.cpp8
-rw-r--r--src/modules/dockwidget/Makefile.am5
-rw-r--r--src/modules/dockwidget/libkvidockwidget.h6
-rw-r--r--src/modules/dockwidget/libkvidockwidget_qt3.cpp25
-rw-r--r--src/modules/dockwidget/libkvidockwidget_qt4.cpp691
-rw-r--r--src/modules/dockwidget/libkvidockwidget_qt4.h82
-rw-r--r--src/modules/editor/scripteditor.cpp44
-rw-r--r--src/modules/editor/scripteditor.h9
-rw-r--r--src/modules/file/libkvifile.cpp8
-rw-r--r--src/modules/filetransferwindow/filetransferwindow.cpp8
-rw-r--r--src/modules/help/helpwidget.cpp6
-rw-r--r--src/modules/help/helpwindow.cpp20
-rw-r--r--src/modules/help/index.cpp6
-rw-r--r--src/modules/help/libkvihelp.cpp7
-rw-r--r--src/modules/list/listwindow.cpp9
-rw-r--r--src/modules/list/listwindow.h4
-rw-r--r--src/modules/logview/logviewmdiwindow.cpp18
-rw-r--r--src/modules/my/idle_x11.cpp10
-rw-r--r--src/modules/notifier/notifiermessage.cpp5
-rw-r--r--src/modules/notifier/notifiermessage.h7
-rw-r--r--src/modules/notifier/notifierwindow.cpp107
-rw-r--r--src/modules/objects/class_button.cpp8
-rw-r--r--src/modules/objects/class_buttongroup.cpp6
-rw-r--r--src/modules/objects/class_dockwindow.cpp56
-rw-r--r--src/modules/objects/class_file.cpp38
-rw-r--r--src/modules/objects/class_groupbox.cpp6
-rw-r--r--src/modules/objects/class_label.cpp19
-rw-r--r--src/modules/objects/class_layout.cpp11
-rw-r--r--src/modules/objects/class_listview.cpp5
-rw-r--r--src/modules/objects/class_mainwindow.cpp4
-rw-r--r--src/modules/objects/class_multilineedit.cpp17
-rw-r--r--src/modules/objects/class_painter.cpp80
-rw-r--r--src/modules/objects/class_painter.h6
-rw-r--r--src/modules/objects/class_pixmap.cpp10
-rw-r--r--src/modules/objects/class_pixmap.h4
-rw-r--r--src/modules/objects/class_process.cpp8
-rw-r--r--src/modules/objects/class_process.h8
-rw-r--r--src/modules/objects/class_progressbar.cpp11
-rw-r--r--src/modules/objects/class_spinbox.cpp4
-rw-r--r--src/modules/objects/class_tabwidget.cpp12
-rw-r--r--src/modules/objects/class_toolbar.cpp3
-rw-r--r--src/modules/objects/class_toolbutton.cpp9
-rw-r--r--src/modules/objects/class_urllabel.cpp5
-rw-r--r--src/modules/objects/class_widget.cpp98
-rw-r--r--src/modules/objects/class_widget.h3
-rw-r--r--src/modules/objects/class_window.cpp4
-rw-r--r--src/modules/objects/class_workspace.cpp4
-rw-r--r--src/modules/objects/class_wrapper.cpp43
-rw-r--r--src/modules/objects/libkviobjects.cpp92
-rw-r--r--src/modules/options/container.cpp3
-rw-r--r--src/modules/options/dialog.cpp32
-rw-r--r--src/modules/options/optw_messages.cpp21
-rw-r--r--src/modules/options/optw_texticons.h6
-rw-r--r--src/modules/popupeditor/popupeditor.cpp10
-rw-r--r--src/modules/raweditor/raweditor.cpp5
-rw-r--r--src/modules/reguser/dialog.cpp27
-rw-r--r--src/modules/reguser/dialog.h10
-rw-r--r--src/modules/reguser/edituser.cpp14
-rw-r--r--src/modules/reguser/edituser.h11
-rw-r--r--src/modules/reguser/wizard.cpp3
-rw-r--r--src/modules/setup/setupwizard.cpp6
-rw-r--r--src/modules/setup/setupwizard.h5
-rw-r--r--src/modules/sharedfileswindow/sharedfileswindow.cpp4
-rw-r--r--src/modules/socketspy/socketspywindow.cpp4
-rw-r--r--src/modules/spaste/controller.cpp2
-rw-r--r--src/modules/system/libkvisystem.cpp2
-rw-r--r--src/modules/theme/managementdialog.cpp3
-rw-r--r--src/modules/theme/managementdialog.h5
-rw-r--r--src/modules/theme/packthemedialog.cpp21
-rw-r--r--src/modules/theme/savethemedialog.cpp9
-rw-r--r--src/modules/theme/themefunctions.cpp5
-rw-r--r--src/modules/tip/libkvitip.cpp11
-rw-r--r--src/modules/url/libkviurl.cpp16
-rw-r--r--src/modules/url/libkviurl.h4
82 files changed, 11 insertions, 1968 deletions
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('&'),"&amp;");
- line.replace(TQChar('<'),"&lt;");
- line.replace(TQChar('>'),"&gt;");
- 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,&params);
- 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>