summaryrefslogtreecommitdiffstats
path: root/lib/kopalette
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kopalette
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kopalette')
-rw-r--r--lib/kopalette/kopalette.cc42
-rw-r--r--lib/kopalette/kopalette.h43
-rw-r--r--lib/kopalette/kopalettemanager.cc192
-rw-r--r--lib/kopalette/kopalettemanager.h71
-rw-r--r--lib/kopalette/kotabpalette.cc42
-rw-r--r--lib/kopalette/kotabpalette.h23
-rw-r--r--lib/kopalette/kotoolboxpalette.cc36
-rw-r--r--lib/kopalette/kotoolboxpalette.h25
8 files changed, 239 insertions, 235 deletions
diff --git a/lib/kopalette/kopalette.cc b/lib/kopalette/kopalette.cc
index 67fcf474..1c6fb960 100644
--- a/lib/kopalette/kopalette.cc
+++ b/lib/kopalette/kopalette.cc
@@ -15,18 +15,18 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qwidget.h>
-#include <qdockwindow.h>
-#include <qvariant.h>
-#include <qlabel.h>
-#include <qtoolbutton.h>
-#include <qtabwidget.h>
-#include <qlayout.h>
-#include <qtooltip.h>
-#include <qwhatsthis.h>
-#include <qimage.h>
-#include <qpixmap.h>
-#include <qlayout.h>
+#include <tqwidget.h>
+#include <tqdockwindow.h>
+#include <tqvariant.h>
+#include <tqlabel.h>
+#include <tqtoolbutton.h>
+#include <tqtabwidget.h>
+#include <tqlayout.h>
+#include <tqtooltip.h>
+#include <tqwhatsthis.h>
+#include <tqimage.h>
+#include <tqpixmap.h>
+#include <tqlayout.h>
#include <kdebug.h>
#include <kglobal.h>
@@ -39,23 +39,23 @@
#include "kopalette.h"
-KoPalette::KoPalette(QWidget * parent, const char * name)
- : QDockWindow(parent, name)
+KoPalette::KoPalette(TQWidget * tqparent, const char * name)
+ : TQDockWindow(tqparent, name)
{
#if KDE_VERSION >= KDE_MAKE_VERSION(3,3,90)
KAcceleratorManager::setNoAccel(this);
#endif
- setCloseMode( QDockWindow::Never);
+ setCloseMode( TQDockWindow::Never);
setResizeEnabled(true);
setOpaqueMoving(true);
- setFocusPolicy(QWidget::NoFocus);
+ setFocusPolicy(TQ_NoFocus);
setVerticallyStretchable(false);
setHorizontallyStretchable(false);
setNewLine(true);
- layout() -> setSpacing(0);
- layout() -> setMargin(0);
+ tqlayout() -> setSpacing(0);
+ tqlayout() -> setMargin(0);
resetFont();
}
@@ -67,7 +67,7 @@ void KoPalette::resetFont()
Q_ASSERT(cfg);
cfg->setGroup("");
m_font = KGlobalSettings::generalFont();
- float ps = QMIN(9, KGlobalSettings::generalFont().pointSize() * 0.8);
+ float ps = TQMIN(9, KGlobalSettings::generalFont().pointSize() * 0.8);
ps = cfg->readNumEntry("palettefontsize", (int)ps);
if (ps < 6) ps = 6;
m_font.setPointSize((int)ps);
@@ -79,10 +79,10 @@ KoPalette::~KoPalette()
{
}
-void KoPalette::setMainWidget(QWidget * widget)
+void KoPalette::setMainWidget(TQWidget * widget)
{
setWidget(widget);
- resize( QSize(285, 233).expandedTo(minimumSizeHint()) );
+ resize( TQSize(285, 233).expandedTo(tqminimumSizeHint()) );
clearWState( WState_Polished );
widget->setFont(m_font);
m_page = widget;
diff --git a/lib/kopalette/kopalette.h b/lib/kopalette/kopalette.h
index 8c7a1f98..6f5654ee 100644
--- a/lib/kopalette/kopalette.h
+++ b/lib/kopalette/kopalette.h
@@ -18,14 +18,14 @@
#ifndef _KO_PALETTE_
#define _KO_PALETTE_
-#include <qdockwindow.h>
-#include <qwidget.h>
-#include <qlabel.h>
-#include <qtoolbutton.h>
-#include <qpixmap.h>
-#include <qstring.h>
-#include <qfont.h>
-#include <qlayout.h>
+#include <tqdockwindow.h>
+#include <tqwidget.h>
+#include <tqlabel.h>
+#include <tqtoolbutton.h>
+#include <tqpixmap.h>
+#include <tqstring.h>
+#include <tqfont.h>
+#include <tqlayout.h>
#include <koffice_export.h>
#include "kopalettemanager.h"
@@ -34,15 +34,16 @@
* to its organzing principle.
*
* There is currently no titlebar with a shade button; I hope to be
- * able to use QDockWidget's toggle view action for that.
+ * able to use TQDockWidget's toggle view action for that.
*/
-class KOPALETTE_EXPORT KoPalette : public QDockWindow {
+class KOPALETTE_EXPORT KoPalette : public TQDockWindow {
Q_OBJECT
+ TQ_OBJECT
public:
- KoPalette(QWidget * parent, const char * name);
+ KoPalette(TQWidget * tqparent, const char * name);
virtual ~KoPalette();
public:
@@ -52,23 +53,23 @@ public:
void setStyle(enumKoPaletteStyle style) { m_style = style; };
enumKoPaletteStyle style() { return m_style; };
- virtual void plug(QWidget * widget, const QString & name, int position) = 0;
- virtual void unplug(const QWidget * widget) = 0;
- virtual void showPage(QWidget *w) = 0;
- virtual void togglePageHidden(QWidget *w) = 0;
- virtual void hidePage(QWidget * w) = 0;
+ virtual void plug(TQWidget * widget, const TQString & name, int position) = 0;
+ virtual void unplug(const TQWidget * widget) = 0;
+ virtual void showPage(TQWidget *w) = 0;
+ virtual void togglePageHidden(TQWidget *w) = 0;
+ virtual void hidePage(TQWidget * w) = 0;
virtual void makeVisible(bool v) = 0;
- virtual bool isHidden(QWidget * w) = 0;
- virtual int indexOf(QWidget *w) = 0;
+ virtual bool isHidden(TQWidget * w) = 0;
+ virtual int indexOf(TQWidget *w) = 0;
protected:
- virtual void setMainWidget(QWidget * widget);
- QFont m_font;
+ virtual void setMainWidget(TQWidget * widget);
+ TQFont m_font;
enumKoPaletteStyle m_style;
private:
- QWidget * m_page;
+ TQWidget * m_page;
};
diff --git a/lib/kopalette/kopalettemanager.cc b/lib/kopalette/kopalettemanager.cc
index e028a7ae..839a6187 100644
--- a/lib/kopalette/kopalettemanager.cc
+++ b/lib/kopalette/kopalettemanager.cc
@@ -15,13 +15,13 @@
the Free Software Foundation, Inc.,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qapplication.h>
-#include <qdockarea.h>
-#include <qdockwindow.h>
-#include <qdict.h>
-#include <qwidget.h>
-#include <qobject.h>
-#include <qevent.h>
+#include <tqapplication.h>
+#include <tqdockarea.h>
+#include <tqdockwindow.h>
+#include <tqdict.h>
+#include <tqwidget.h>
+#include <tqobject.h>
+#include <tqevent.h>
#include <kparts/event.h>
#include <kapplication.h>
@@ -43,26 +43,26 @@
KoPaletteManager::KoPaletteManager(KoView * view, KActionCollection *ac, const char * name)
- : QObject(view, name)
+ : TQObject(view, name)
{
m_view = view;
m_view->installEventFilter(this);
m_actionCollection = ac;
- m_actions = new QDict<KToggleAction>();
- m_widgets = new QDict<QWidget>();
- m_palettes = new QDict<KoPalette>();
+ m_actions = new TQDict<KToggleAction>();
+ m_widgets = new TQDict<TQWidget>();
+ m_palettes = new TQDict<KoPalette>();
m_palettes->setAutoDelete(true);
- m_defaultMapping = new QMap<QString, QString>();
- m_currentMapping = new QMap<QString, QString>();
+ m_defaultMapping = new TQMap<TQString, TQString>();
+ m_currentMapping = new TQMap<TQString, TQString>();
m_fixedWidth = 0;
m_setFixedWidth = false;
- m_widgetNames = new QStringList();
+ m_widgetNames = new TQStringList();
- m_mapper = new QSignalMapper(this);
- connect(m_mapper, SIGNAL(mapped(int)), this, SLOT(slotTogglePalette(int)));
+ m_mapper = new TQSignalMapper(this);
+ connect(m_mapper, TQT_SIGNAL(mapped(int)), this, TQT_SLOT(slotTogglePalette(int)));
m_viewActionMenu = new KActionMenu(i18n("Palettes"), m_actionCollection, "view_palette_action_menu");
KConfig * cfg = KGlobal::config();
@@ -74,7 +74,7 @@ KoPaletteManager::KoPaletteManager(KoView * view, KActionCollection *ac, const c
if ( palettesShown) {
m_toggleShowHidePalettes = new KToggleAction(i18n("Hide All Palette Windows"),
"CTRL+SHIFT+H", this,
- SLOT(slotToggleAllPalettes()),
+ TQT_SLOT(slotToggleAllPalettes()),
m_actionCollection, "toggleAllPaletteWindows");
m_toggleShowHidePalettes->setCheckedState(i18n("Show Palette Windows Again"));
@@ -82,7 +82,7 @@ KoPaletteManager::KoPaletteManager(KoView * view, KActionCollection *ac, const c
else {
m_toggleShowHidePalettes = new KToggleAction(i18n("Show Palette Windows Again"),
"CTRL+SHIFT+H", this,
- SLOT(slotToggleAllPalettes()),
+ TQT_SLOT(slotToggleAllPalettes()),
m_actionCollection, "toggleAllPaletteWindows");
m_toggleShowHidePalettes->setCheckedState(i18n("Hide All Palette Windows"));
@@ -90,15 +90,15 @@ KoPaletteManager::KoPaletteManager(KoView * view, KActionCollection *ac, const c
m_viewActionMenu->insert(m_toggleShowHidePalettes);
// Recreate the palettes in the saved order
- QStringList paletteList = QStringList::split(",", cfg->readEntry("palettes"));
- QStringList::iterator it;
+ TQStringList paletteList = TQStringList::split(",", cfg->readEntry("palettes"));
+ TQStringList::iterator it;
for (it = paletteList.begin(); it != paletteList.end(); ++it) {
if (cfg->hasGroup("palette-" + (*it))) {
cfg->setGroup("palette-" + (*it));
enumKoPaletteStyle style = (enumKoPaletteStyle)cfg->readNumEntry("style", 0);
- QString caption = cfg->readEntry("caption", "");
+ TQString caption = cfg->readEntry("caption", "");
createPalette((*it), caption, style);
}
@@ -107,7 +107,7 @@ KoPaletteManager::KoPaletteManager(KoView * view, KActionCollection *ac, const c
/*
KAction * a = new KAction(i18n("Restore Palettes"),
0, this,
- SLOT(slotReset()),
+ TQT_SLOT(slotReset()),
this, "restorePalettes");
m_viewActionMenu->insert(a);
*/
@@ -129,9 +129,9 @@ KoPaletteManager::~KoPaletteManager()
delete m_currentMapping;
}
-void KoPaletteManager::addWidget(QWidget * widget,
- const QString & name,
- const QString & paletteName,
+void KoPaletteManager::addWidget(TQWidget * widget,
+ const TQString & name,
+ const TQString & paletteName,
int position,
enumKoPaletteStyle style,
bool shown)
@@ -139,9 +139,9 @@ void KoPaletteManager::addWidget(QWidget * widget,
if (!widget) return;
- QString pname = paletteName;
+ TQString pname = paletteName;
- QWidget * w = m_widgets->find(name);
+ TQWidget * w = m_widgets->tqfind(name);
if (w != 0 )
{
removeWidget(name);
@@ -157,16 +157,16 @@ void KoPaletteManager::addWidget(QWidget * widget,
visible = cfg->readBoolEntry("visible");
}
- KoPalette * palette = m_palettes->find(pname);
+ KoPalette * palette = m_palettes->tqfind(pname);
if (palette == 0) {
palette = createPalette(pname, widget->caption(), style);
- m_defaultPaletteOrder.append(pname+ "," + QString::number(style));
+ m_defaultPaletteOrder.append(pname+ "," + TQString::number(style));
}
KToggleAction * a;
- a = new KToggleAction(i18n("Show %1").arg(widget->caption()), 0, m_mapper, SLOT(map()), m_actionCollection);
- a->setCheckedState(i18n("Hide %1").arg(widget->caption()));
+ a = new KToggleAction(i18n("Show %1").tqarg(widget->caption()), 0, m_mapper, TQT_SLOT(map()), m_actionCollection);
+ a->setCheckedState(i18n("Hide %1").tqarg(widget->caption()));
m_mapper->setMapping(a, m_widgetNames->count()); // This is the position at which we'll insert the action
m_actions->insert( name, a );
@@ -181,11 +181,11 @@ void KoPaletteManager::addWidget(QWidget * widget,
m_defaultWidgetOrder.append(name);
// Find out the hidden state
- if(m_widgetNames->contains(name))
+ if(m_widgetNames->tqcontains(name))
{
// The widget has already been added (and removed) during this session
- if(m_hiddenWidgets.contains(name))
+ if(m_hiddenWidgets.tqcontains(name))
palette->hidePage( widget );
else
{
@@ -229,10 +229,10 @@ void KoPaletteManager::slotReset()
m_widgetNames->clear();
// Recreate the palettewindows in the saved order
- QStringList::iterator it;
+ TQStringList::iterator it;
for (it = m_defaultPaletteOrder.begin(); it != m_defaultPaletteOrder.end(); ++it) {
- QString s = *it;
- QString pname = s.section( ",", 0, 0 );;
+ TQString s = *it;
+ TQString pname = s.section( ",", 0, 0 );;
enumKoPaletteStyle style = (enumKoPaletteStyle)s.section(",", 1,1).toInt();
createPalette(pname, "", style);
}
@@ -240,14 +240,14 @@ void KoPaletteManager::slotReset()
// Place all existing (that we didn't throw away!) tabs in the right palette and in the right order
for (it = m_defaultWidgetOrder.begin(); it != m_defaultWidgetOrder.end(); ++it) {
- QString widgetName = *it;
- QWidget * w = m_widgets->find(widgetName);
+ TQString widgetName = *it;
+ TQWidget * w = m_widgets->tqfind(widgetName);
if (!w) {
continue;
}
- QString paletteName = *m_defaultMapping->find(widgetName);
- KoPalette * p = m_palettes->find(paletteName);
+ TQString paletteName = *m_defaultMapping->tqfind(widgetName);
+ KoPalette * p = m_palettes->tqfind(paletteName);
if (p == 0) {
// Funny -- we should have a consistent set of palettes without holes!
@@ -262,57 +262,57 @@ void KoPaletteManager::slotReset()
void KoPaletteManager::slotResetFont()
{
- QDictIterator<KoPalette> it(*m_palettes);
+ TQDictIterator<KoPalette> it(*m_palettes);
for (; it.current(); ++it) {
it.current()->resetFont();
}
}
-QWidget * KoPaletteManager::widget(const QString & name)
+TQWidget * KoPaletteManager::widget(const TQString & name)
{
- return m_widgets->find(name);
+ return m_widgets->tqfind(name);
}
-void KoPaletteManager::showWidget(const QString & name)
+void KoPaletteManager::showWidget(const TQString & name)
{
- QWidget * w = m_widgets->find(name);
+ TQWidget * w = m_widgets->tqfind(name);
if (!w) return;
- QString pname = *m_currentMapping->find(name);
+ TQString pname = *m_currentMapping->tqfind(name);
if (pname.isNull()) return;
- KoPalette * p = m_palettes->find(pname);
+ KoPalette * p = m_palettes->tqfind(pname);
p->showPage(w);
- KToggleAction * a = m_actions->find(name);
+ KToggleAction * a = m_actions->tqfind(name);
a->setChecked(true);
}
-void KoPaletteManager::hideWidget(const QString & name)
+void KoPaletteManager::hideWidget(const TQString & name)
{
- QWidget * w = m_widgets->find(name);
+ TQWidget * w = m_widgets->tqfind(name);
if (!w) return;
- QString pname = *m_currentMapping->find(name);
+ TQString pname = *m_currentMapping->tqfind(name);
if (pname.isNull()) return;
- KoPalette * p = m_palettes->find(pname);
+ KoPalette * p = m_palettes->tqfind(pname);
p->hidePage(w);
- KToggleAction * a = m_actions->find(name);
+ KToggleAction * a = m_actions->tqfind(name);
a->setChecked(false);
}
-void KoPaletteManager::removeWidget(const QString & name)
+void KoPaletteManager::removeWidget(const TQString & name)
{
- QString palette = *(m_currentMapping->find(name));
+ TQString palette = *(m_currentMapping->tqfind(name));
if (palette.isNull()) return;
- QWidget * w = m_widgets->find(name);
+ TQWidget * w = m_widgets->tqfind(name);
if (!w) return;
- KoPalette * p = m_palettes->find(palette);
+ KoPalette * p = m_palettes->tqfind(palette);
if (!p) return;
p->showPage(w);
@@ -325,13 +325,13 @@ void KoPaletteManager::removeWidget(const QString & name)
m_actionCollection->remove(a);
}
-KoPalette * KoPaletteManager::createPalette(const QString & name, const QString & caption, enumKoPaletteStyle style)
+KoPalette * KoPaletteManager::createPalette(const TQString & name, const TQString & caption, enumKoPaletteStyle style)
{
Q_ASSERT(m_view);
KoPalette * palette = 0;
- palette = m_palettes->find(name);
+ palette = m_palettes->tqfind(name);
if (palette) return palette;
@@ -359,10 +359,10 @@ KoPalette * KoPaletteManager::createPalette(const QString & name, const QString
return palette;
}
-void KoPaletteManager::placePalette(const QString & name, Qt::Dock location)
+void KoPaletteManager::placePalette(const TQString & name, TQt::Dock location)
{
Q_ASSERT(!name.isNull());
- KoPalette * palette = m_palettes->find(name);
+ KoPalette * palette = m_palettes->tqfind(name);
if (!palette) return;
@@ -371,8 +371,8 @@ void KoPaletteManager::placePalette(const QString & name, Qt::Dock location)
if (cfg->hasGroup("palette-" + name)) {
cfg->setGroup("palette-" + name);
- QString dockarea = cfg->readEntry("dockarea", "right");
- QString caption = cfg->readEntry("caption", "");
+ TQString dockarea = cfg->readEntry("dockarea", "right");
+ TQString caption = cfg->readEntry("caption", "");
int height = cfg->readNumEntry("height", 120);
int place = cfg->readNumEntry("place", 0);
int width = cfg->readNumEntry("width", 200);
@@ -382,10 +382,10 @@ void KoPaletteManager::placePalette(const QString & name, Qt::Dock location)
palette->setGeometry(x, y, width, height);
palette->setOffset(offset);
if (dockarea == "left" && place == 0) {
- location = Qt::DockLeft;
+ location = TQt::DockLeft;
}
else if (dockarea == "right" && place == 0) {
- location = Qt::DockRight;
+ location = TQt::DockRight;
}
else {
location = DockTornOff;
@@ -400,7 +400,7 @@ void KoPaletteManager::placePalette(const QString & name, Qt::Dock location)
m_view->mainWindow()->bottomDock()->setAcceptDockWindow(palette, false);
// Left and right may accept docks. The height of the screen is important
- int h = qApp->desktop()->height();
+ int h = tqApp->desktop()->height();
switch (m_dockability) {
case (DOCK_ENABLED):
m_view->mainWindow()->leftDock()->setAcceptDockWindow(palette, true);
@@ -410,7 +410,7 @@ void KoPaletteManager::placePalette(const QString & name, Qt::Dock location)
case (DOCK_DISABLED):
m_view->mainWindow()->leftDock()->setAcceptDockWindow(palette, false);
m_view->mainWindow()->rightDock()->setAcceptDockWindow(palette, false);
- m_view->mainWindow()->addDockWindow(palette, Qt::DockTornOff);
+ m_view->mainWindow()->addDockWindow(palette, TQt::DockTornOff);
break;
case (DOCK_SMART):
if (h > 768) {
@@ -421,14 +421,14 @@ void KoPaletteManager::placePalette(const QString & name, Qt::Dock location)
else {
m_view->mainWindow()->leftDock()->setAcceptDockWindow(palette, false);
m_view->mainWindow()->rightDock()->setAcceptDockWindow(palette, false);
- m_view->mainWindow()->addDockWindow(palette, Qt::DockTornOff);
+ m_view->mainWindow()->addDockWindow(palette, TQt::DockTornOff);
}
break;
};
m_view->mainWindow()->lineUpDockWindows();
}
-void KoPaletteManager::addPalette(KoPalette * palette, const QString & name, Qt::Dock location)
+void KoPaletteManager::addPalette(KoPalette * palette, const TQString & name, TQt::Dock location)
{
Q_ASSERT(palette);
Q_ASSERT(!name.isNull());
@@ -440,10 +440,10 @@ void KoPaletteManager::addPalette(KoPalette * palette, const QString & name, Qt:
void KoPaletteManager::slotTogglePalette(int paletteIndex)
{
// Toggle the right palette
- QString name = *m_widgetNames->at(paletteIndex);
- QWidget * w = m_widgets->find(name);
- QString pname = *m_currentMapping->find(name);
- KoPalette * p = m_palettes->find(pname);
+ TQString name = *m_widgetNames->at(paletteIndex);
+ TQWidget * w = m_widgets->tqfind(name);
+ TQString pname = *m_currentMapping->tqfind(name);
+ KoPalette * p = m_palettes->tqfind(pname);
p->togglePageHidden( w );
m_hiddenWidgets.clear();
@@ -456,13 +456,13 @@ void KoPaletteManager::slotToggleAllPalettes()
// Restore previous visibility state
while(!m_hiddenWidgets.isEmpty())
{
- QString name = m_hiddenWidgets.pop();
- QWidget *w = m_widgets->find(name);
- KToggleAction * a = m_actions->find(name);
+ TQString name = m_hiddenWidgets.pop();
+ TQWidget *w = m_widgets->tqfind(name);
+ KToggleAction * a = m_actions->tqfind(name);
a->setChecked(true);
- QString pname = *m_currentMapping->find(name);
- KoPalette * p = m_palettes->find(pname);
+ TQString pname = *m_currentMapping->tqfind(name);
+ KoPalette * p = m_palettes->tqfind(pname);
p->showPage(w);
}
}
@@ -470,17 +470,17 @@ void KoPaletteManager::slotToggleAllPalettes()
{
// Save hidden state and hide all palettes
m_hiddenWidgets.clear();
- QDictIterator<QWidget> it(*m_widgets);
+ TQDictIterator<TQWidget> it(*m_widgets);
for (; it.current(); ++it)
{
- KToggleAction * a = m_actions->find(it.currentKey());
+ KToggleAction * a = m_actions->tqfind(it.currentKey());
if(a->isChecked())
{
a->setChecked(false);
m_hiddenWidgets.push(it.currentKey());
- QString pname = *m_currentMapping->find(it.currentKey());
- KoPalette * p = m_palettes->find(pname);
+ TQString pname = *m_currentMapping->tqfind(it.currentKey());
+ KoPalette * p = m_palettes->tqfind(pname);
p->hidePage(it.current());
}
}
@@ -489,17 +489,17 @@ void KoPaletteManager::slotToggleAllPalettes()
void KoPaletteManager::showAllPalettes(bool shown)
{
- QDictIterator<KoPalette> it(*m_palettes);
+ TQDictIterator<KoPalette> it(*m_palettes);
for (; it.current(); ++it) {
it.current()->makeVisible(shown);
}
}
-bool KoPaletteManager::eventFilter( QObject *o, QEvent *e )
+bool KoPaletteManager::eventFilter( TQObject *o, TQEvent *e )
{
- if (o != m_view) return false;
+ if (TQT_BASE_OBJECT(o) != TQT_BASE_OBJECT(m_view)) return false;
- if(e && e->type() == (QEvent::User + 42)) {
+ if(e && e->type() == (TQEvent::User + 42)) {
KParts::PartActivateEvent * pae = dynamic_cast<KParts::PartActivateEvent *>(e);
if(pae && pae->widget() && pae->widget() == m_view) {
if (pae->activated()) {
@@ -533,12 +533,12 @@ void KoPaletteManager::save()
Q_ASSERT(cfg);
cfg->setGroup("");
- QString widgets;
+ TQString widgets;
// Save the list of palettes
- QDictIterator<KoPalette> itP(*m_palettes);
+ TQDictIterator<KoPalette> itP(*m_palettes);
- QStringList paletteList;
+ TQStringList paletteList;
for (; itP.current(); ++itP) {
@@ -567,10 +567,10 @@ void KoPaletteManager::save()
paletteList.append(itP.currentKey());
}
else {
- QStringList::iterator it;
+ TQStringList::iterator it;
bool inserted = false;
for (it = paletteList.begin(); it != paletteList.end(); ++it) {
- KoPalette * p2 = m_palettes->find((*it));
+ KoPalette * p2 = m_palettes->tqfind((*it));
if (p2->y() > p->y()) {
paletteList.insert(it, itP.currentKey());
inserted = true;
@@ -589,18 +589,18 @@ void KoPaletteManager::save()
bool palettesShown = m_hiddenWidgets.isEmpty();
cfg->writeEntry("palettesshown", palettesShown);
- QDictIterator<QWidget> itW(*m_widgets);
+ TQDictIterator<TQWidget> itW(*m_widgets);
for (; itW.current(); ++itW) {
cfg->setGroup("palettetab-" + itW.currentKey());
- QString pname = *m_currentMapping->find(itW.currentKey());
- KoPalette * p = m_palettes->find(pname);
- QWidget * w = itW.current();
+ TQString pname = *m_currentMapping->tqfind(itW.currentKey());
+ KoPalette * p = m_palettes->tqfind(pname);
+ TQWidget * w = itW.current();
cfg->writeEntry("docker", pname);
if(palettesShown)
cfg->writeEntry("visible", !p->isHidden(w));
else
- if(m_hiddenWidgets.contains(itW.currentKey()))
+ if(m_hiddenWidgets.tqcontains(itW.currentKey()))
cfg->writeEntry("visible", true);
else
cfg->writeEntry("visible", false);
diff --git a/lib/kopalette/kopalettemanager.h b/lib/kopalette/kopalettemanager.h
index 977dbf55..be9e7126 100644
--- a/lib/kopalette/kopalettemanager.h
+++ b/lib/kopalette/kopalettemanager.h
@@ -18,15 +18,15 @@
#ifndef _KO_PALETTE_MANAGER_
#define _KO_PALETTE_MANAGER_
-#include <qobject.h>
-#include <qdockwindow.h>
-#include <qstring.h>
-#include <qmap.h>
-#include <qdict.h>
-#include <qvaluestack.h>
-#include <qwidget.h>
-#include <qsignalmapper.h>
-#include <qstringlist.h>
+#include <tqobject.h>
+#include <tqdockwindow.h>
+#include <tqstring.h>
+#include <tqmap.h>
+#include <tqdict.h>
+#include <tqvaluestack.h>
+#include <tqwidget.h>
+#include <tqsignalmapper.h>
+#include <tqstringlist.h>
#include <koffice_export.h>
@@ -45,8 +45,8 @@ enum enumKoDockability {
};
enum enumKoPaletteStyle {
- PALETTE_DOCKER, // QDockWindow based docker with tabs
- PALETTE_TOOLBOX // QDockWindow based docker with a QToolBox
+ PALETTE_DOCKER, // TQDockWindow based docker with tabs
+ PALETTE_TOOLBOX // TQDockWindow based docker with a TQToolBox
};
@@ -71,7 +71,7 @@ namespace {
* <Action name="view_palette_action_menu"/>
*
* There are two styles: one that uses tabs and one that uses the vertical
- * QToolBox style to separate and show individual widgets. By implementing
+ * TQToolBox style to separate and show individual widgets. By implementing
* the kopalette interface and extending the above enum, you can add
* more types.
*
@@ -82,9 +82,10 @@ namespace {
* - Restoration of the application default state
* - Make it impossible to close a floating palette window with alt-f4
*/
-class KOPALETTE_EXPORT KoPaletteManager : public QObject {
+class KOPALETTE_EXPORT KoPaletteManager : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
@@ -112,24 +113,24 @@ public:
* @param position the position of the widget in the palettes
* @param style docker, toolbox or slider
*/
- virtual void addWidget(QWidget * widget, const QString & name, const QString & paletteName, int position = -1,
+ virtual void addWidget(TQWidget * widget, const TQString & name, const TQString & paletteName, int position = -1,
enumKoPaletteStyle style = PALETTE_DOCKER, bool shown = true);
/**
* Get a certain widget by name
*/
- virtual QWidget * widget(const QString & name);
+ virtual TQWidget * widget(const TQString & name);
/**
* Show a the specified palette wherever it currently is.
*/
- virtual void showWidget(const QString & name);
+ virtual void showWidget(const TQString & name);
/**
* hide the specified widget
*/
- virtual void hideWidget(const QString & name);
+ virtual void hideWidget(const TQString & name);
/**
* Remove the widget with the specified name from whichever
@@ -137,27 +138,27 @@ public:
* the palette, the palette is destroyed. If the name does
* not occur, nothing is done.
*/
- virtual void removeWidget(const QString & name);
+ virtual void removeWidget(const TQString & name);
/**
* Create an empty palette in the given style. with the given name and caption. If
* the palette already exists, nothing is done.
*/
- virtual KoPalette * createPalette(const QString & name, const QString & caption, enumKoPaletteStyle style = PALETTE_DOCKER);
+ virtual KoPalette * createPalette(const TQString & name, const TQString & caption, enumKoPaletteStyle style = PALETTE_DOCKER);
/**
* Move the specified palette to the specified location. If there is already
* a location for the palette in the saved settings, then move it there
* instead of the specified location.
*/
- virtual void placePalette(const QString & name, Dock location = DockRight);
+ virtual void placePalette(const TQString & name, Dock location = DockRight);
/**
* Add a palette; this can be used to add palettes other than those in the two
* default styles.
*/
- virtual void addPalette(KoPalette * palette, const QString & name, Dock location = DockRight);
+ virtual void addPalette(KoPalette * palette, const TQString & name, Dock location = DockRight);
/**
* Sets all palettes to the specified fixed width
@@ -171,7 +172,7 @@ public slots:
void showAllPalettes(bool shown);
/**
- * Restores the palette configuration to the default layout, i.e, the layout
+ * Restores the palette configuration to the default tqlayout, i.e, the tqlayout
* preferred by each docker.
*/
virtual void slotReset();
@@ -184,7 +185,7 @@ public slots:
protected:
- bool eventFilter( QObject *o, QEvent *e );
+ bool eventFilter( TQObject *o, TQEvent *e );
private:
@@ -203,18 +204,18 @@ private:
KToggleAction * m_toggleShowHidePalettes;
enumKoDockability m_dockability;
- QStringList * m_widgetNames;
-
- QDict<QWidget> * m_widgets;
- QDict<KoPalette> * m_palettes;
- QValueStack<QString> m_hiddenWidgets; // names of widgets actively hidden by hide all
- QDict<KToggleAction> * m_actions;
- QSignalMapper * m_mapper;
-
- QMap<QString, QString> * m_defaultMapping; // widget to docker
- QStringList m_defaultPaletteOrder; // Order of palette creation
- QStringList m_defaultWidgetOrder; // Order of widget addition
- QMap<QString, QString> * m_currentMapping; // widget to docker
+ TQStringList * m_widgetNames;
+
+ TQDict<TQWidget> * m_widgets;
+ TQDict<KoPalette> * m_palettes;
+ TQValueStack<TQString> m_hiddenWidgets; // names of widgets actively hidden by hide all
+ TQDict<KToggleAction> * m_actions;
+ TQSignalMapper * m_mapper;
+
+ TQMap<TQString, TQString> * m_defaultMapping; // widget to docker
+ TQStringList m_defaultPaletteOrder; // Order of palette creation
+ TQStringList m_defaultWidgetOrder; // Order of widget addition
+ TQMap<TQString, TQString> * m_currentMapping; // widget to docker
bool m_setFixedWidth;
int m_fixedWidth;
diff --git a/lib/kopalette/kotabpalette.cc b/lib/kopalette/kotabpalette.cc
index 3da34e58..972a8144 100644
--- a/lib/kopalette/kotabpalette.cc
+++ b/lib/kopalette/kotabpalette.cc
@@ -16,7 +16,7 @@
*/
-#include <qdockwindow.h>
+#include <tqdockwindow.h>
#include <ktabwidget.h>
#include <kdebug.h>
@@ -27,12 +27,12 @@
#include <kotabpalette.h>
#include "kopalettemanager.h"
-KoTabPalette::KoTabPalette(QWidget * parent, const char * name)
- : KoPalette(parent, name)
+KoTabPalette::KoTabPalette(TQWidget * tqparent, const char * name)
+ : KoPalette(tqparent, name)
{
m_page = new KTabWidget(this);
- m_page->setTabShape(QTabWidget::Triangular);
- m_page->setFocusPolicy(QWidget::TabFocus);
+ m_page->setTabShape(TQTabWidget::Triangular);
+ m_page->setFocusPolicy(TQ_TabFocus);
//m_page->setFont(m_font);
m_page->setMargin(1);
//m_page->setTabReorderingEnabled(true);
@@ -44,11 +44,11 @@ KoTabPalette::~KoTabPalette()
{
}
-void KoTabPalette::plug(QWidget * w, const QString & /*name*/, int position)
+void KoTabPalette::plug(TQWidget * w, const TQString & /*name*/, int position)
{
if (!w) return;
- w -> unsetFont(); // Use the parent font
+ w -> unsetFont(); // Use the tqparent font
m_page -> insertTab(w, w -> caption(), position);
show();
@@ -60,19 +60,19 @@ void KoTabPalette::resetFont()
m_page->unsetFont();
}
-void KoTabPalette::unplug(const QWidget * w)
+void KoTabPalette::unplug(const TQWidget * w)
{
- m_page->removePage(const_cast<QWidget *>(w));
+ m_page->removePage(const_cast<TQWidget *>(w));
if (m_page->count() == 0)
hide();
}
-void KoTabPalette::showPage(QWidget *w)
+void KoTabPalette::showPage(TQWidget *w)
{
m_page->showPage(w);
- if (m_hiddenPages.find(w) == m_hiddenPages.end()) return;
+ if (m_hiddenPages.tqfind(w) == m_hiddenPages.end()) return;
- int i = *m_hiddenPages.find(w);
+ int i = *m_hiddenPages.tqfind(w);
m_page->insertTab(w, w->caption(), i);
m_hiddenPages.erase(w);
show();
@@ -87,9 +87,9 @@ void KoTabPalette::makeVisible(bool v)
hide();
}
-int KoTabPalette::indexOf(QWidget *w)
+int KoTabPalette::indexOf(TQWidget *w)
{
- if (m_hiddenPages.find(w) != m_hiddenPages.end()) {
+ if (m_hiddenPages.tqfind(w) != m_hiddenPages.end()) {
int i = m_page->indexOf(w);
return -i;
}
@@ -98,14 +98,14 @@ int KoTabPalette::indexOf(QWidget *w)
}
}
-bool KoTabPalette::isHidden(QWidget * w)
+bool KoTabPalette::isHidden(TQWidget * w)
{
- return (m_hiddenPages.find(w) != m_hiddenPages.end());
+ return (m_hiddenPages.tqfind(w) != m_hiddenPages.end());
}
-void KoTabPalette::hidePage( QWidget *w)
+void KoTabPalette::hidePage( TQWidget *w)
{
- if (m_hiddenPages.find(w) != m_hiddenPages.end()) return;
+ if (m_hiddenPages.tqfind(w) != m_hiddenPages.end()) return;
int i = m_page->indexOf(w);
m_page->removePage(w);
@@ -115,10 +115,10 @@ void KoTabPalette::hidePage( QWidget *w)
}
}
-void KoTabPalette::togglePageHidden(QWidget *w)
+void KoTabPalette::togglePageHidden(TQWidget *w)
{
- if (m_hiddenPages.find(w) != m_hiddenPages.end()) {
- int i = *m_hiddenPages.find(w);
+ if (m_hiddenPages.tqfind(w) != m_hiddenPages.end()) {
+ int i = *m_hiddenPages.tqfind(w);
m_page->insertTab(w, w->caption(), i);
m_hiddenPages.erase(w);
show();
diff --git a/lib/kopalette/kotabpalette.h b/lib/kopalette/kotabpalette.h
index 85ff086a..18d46806 100644
--- a/lib/kopalette/kotabpalette.h
+++ b/lib/kopalette/kotabpalette.h
@@ -18,13 +18,13 @@
#ifndef _KO_TAB_PALETTE_
#define _KO_TAB_PALETTE_
-#include <qdockwindow.h>
+#include <tqdockwindow.h>
#include <ktabwidget.h>
#include "kopalette.h"
class KoView;
-class QWidget;
+class TQWidget;
@@ -37,28 +37,29 @@ class QWidget;
class KoTabPalette : public KoPalette {
Q_OBJECT
+ TQ_OBJECT
public:
- KoTabPalette(QWidget * parent, const char * name);
+ KoTabPalette(TQWidget * tqparent, const char * name);
virtual ~KoTabPalette();
public:
virtual void resetFont();
- virtual void plug(QWidget * widget, const QString & name, int position = -1);
- virtual void unplug(const QWidget * widget);
- void showPage(QWidget *w);
+ virtual void plug(TQWidget * widget, const TQString & name, int position = -1);
+ virtual void unplug(const TQWidget * widget);
+ void showPage(TQWidget *w);
void makeVisible(bool v);
- virtual void hidePage(QWidget * w);
- int indexOf(QWidget *w);
- bool isHidden(QWidget *w);
- virtual void togglePageHidden(QWidget *w);
+ virtual void hidePage(TQWidget * w);
+ int indexOf(TQWidget *w);
+ bool isHidden(TQWidget *w);
+ virtual void togglePageHidden(TQWidget *w);
private:
KTabWidget * m_page;
- QMap<QWidget*, int> m_hiddenPages;
+ TQMap<TQWidget*, int> m_hiddenPages;
};
#endif //_KO_TAB_PALETTE_
diff --git a/lib/kopalette/kotoolboxpalette.cc b/lib/kopalette/kotoolboxpalette.cc
index 12dbee55..c41382cf 100644
--- a/lib/kopalette/kotoolboxpalette.cc
+++ b/lib/kopalette/kotoolboxpalette.cc
@@ -17,17 +17,17 @@
*/
-#include <qdockwindow.h>
-#include <qtoolbox.h>
+#include <tqdockwindow.h>
+#include <tqtoolbox.h>
#include <kopalette.h>
#include <kopalettemanager.h>
#include <kotoolboxpalette.h>
-KoToolBoxPalette::KoToolBoxPalette(QWidget * parent, const char * name)
- : KoPalette(parent, name)
+KoToolBoxPalette::KoToolBoxPalette(TQWidget * tqparent, const char * name)
+ : KoPalette(tqparent, name)
{
- m_page = new QToolBox(this);
+ m_page = new TQToolBox(this);
m_page->unsetFont();
setMainWidget(m_page);
m_style = PALETTE_TOOLBOX;
@@ -45,27 +45,27 @@ void KoToolBoxPalette::resetFont()
}
-void KoToolBoxPalette::plug(QWidget *w, const QString & label, int position)
+void KoToolBoxPalette::plug(TQWidget *w, const TQString & label, int position)
{
w->unsetFont();
m_page->insertItem( position, w, label );
}
-void KoToolBoxPalette::unplug(const QWidget *w)
+void KoToolBoxPalette::unplug(const TQWidget *w)
{
- m_page->removeItem( const_cast<QWidget*>(w) );
+ m_page->removeItem( const_cast<TQWidget*>(w) );
}
-void KoToolBoxPalette::showPage(QWidget *w)
+void KoToolBoxPalette::showPage(TQWidget *w)
{
m_page->setCurrentItem( w );
}
-int KoToolBoxPalette::indexOf(QWidget *w)
+int KoToolBoxPalette::indexOf(TQWidget *w)
{
- if (m_hiddenPages.find(w) != m_hiddenPages.end()) {
+ if (m_hiddenPages.tqfind(w) != m_hiddenPages.end()) {
return m_page->indexOf(w);
}
else {
@@ -84,15 +84,15 @@ void KoToolBoxPalette::makeVisible(bool v)
}
}
-bool KoToolBoxPalette::isHidden(QWidget * w)
+bool KoToolBoxPalette::isHidden(TQWidget * w)
{
- return (m_hiddenPages.find(w) != m_hiddenPages.end());
+ return (m_hiddenPages.tqfind(w) != m_hiddenPages.end());
}
-void KoToolBoxPalette::togglePageHidden(QWidget *w)
+void KoToolBoxPalette::togglePageHidden(TQWidget *w)
{
- if (m_hiddenPages.find(w) != m_hiddenPages.end()) {
- int i = *m_hiddenPages.find(w);
+ if (m_hiddenPages.tqfind(w) != m_hiddenPages.end()) {
+ int i = *m_hiddenPages.tqfind(w);
m_page->insertItem(i, w, w->caption());
show();
}
@@ -107,9 +107,9 @@ void KoToolBoxPalette::togglePageHidden(QWidget *w)
}
-void KoToolBoxPalette::hidePage( QWidget * w)
+void KoToolBoxPalette::hidePage( TQWidget * w)
{
- if (m_hiddenPages.find(w) != m_hiddenPages.end()) return;
+ if (m_hiddenPages.tqfind(w) != m_hiddenPages.end()) return;
int i = m_page->indexOf(w);
m_page->removeItem(w);
m_hiddenPages[w] = i;
diff --git a/lib/kopalette/kotoolboxpalette.h b/lib/kopalette/kotoolboxpalette.h
index 5b5fa991..b4c8290f 100644
--- a/lib/kopalette/kotoolboxpalette.h
+++ b/lib/kopalette/kotoolboxpalette.h
@@ -18,8 +18,8 @@
#ifndef _KO_TOOLBOX_PALETTE_
#define _KO_TOOLBOX_PALETTE_
-#include <qdockwindow.h>
-#include <qtoolbox.h>
+#include <tqdockwindow.h>
+#include <tqtoolbox.h>
#include <kopalettemanager.h>
@@ -30,27 +30,28 @@
class KoToolBoxPalette : public KoPalette {
Q_OBJECT
+ TQ_OBJECT
public:
- KoToolBoxPalette(QWidget * parent, const char * name);
+ KoToolBoxPalette(TQWidget * tqparent, const char * name);
~KoToolBoxPalette();
public:
void resetFont();
- virtual void plug(QWidget * widget, const QString & name, int position = INT_MAX);
- virtual void unplug(const QWidget * widget);
- void showPage(QWidget *w);
+ virtual void plug(TQWidget * widget, const TQString & name, int position = INT_MAX);
+ virtual void unplug(const TQWidget * widget);
+ void showPage(TQWidget *w);
void makeVisible(bool v);
- virtual void hidePage(QWidget * w);
- int indexOf(QWidget *w);
- bool isHidden(QWidget *w);
- void togglePageHidden(QWidget *w);
+ virtual void hidePage(TQWidget * w);
+ int indexOf(TQWidget *w);
+ bool isHidden(TQWidget *w);
+ void togglePageHidden(TQWidget *w);
private:
- QToolBox * m_page;
+ TQToolBox * m_page;
- QMap<QWidget*, int> m_hiddenPages;
+ TQMap<TQWidget*, int> m_hiddenPages;
};
#endif //_KO_TOOLBOX_PALETTE_