summaryrefslogtreecommitdiffstats
path: root/lib/kofficeui/KoToolBox.cpp
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/kofficeui/KoToolBox.cpp
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/kofficeui/KoToolBox.cpp')
-rw-r--r--lib/kofficeui/KoToolBox.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/lib/kofficeui/KoToolBox.cpp b/lib/kofficeui/KoToolBox.cpp
index 60a3a2bf9..ca7db5a71 100644
--- a/lib/kofficeui/KoToolBox.cpp
+++ b/lib/kofficeui/KoToolBox.cpp
@@ -17,15 +17,15 @@
Boston, MA 02110-1301, USA.
*/
-#include <qbuttongroup.h>
-#include <qnamespace.h>
-#include <qtoolbutton.h>
-#include <qlabel.h>
-#include <qtooltip.h>
-#include <qlayout.h>
-#include <qpixmap.h>
-#include <qtoolbar.h>
-#include <qdockwindow.h>
+#include <tqbuttongroup.h>
+#include <tqnamespace.h>
+#include <tqtoolbutton.h>
+#include <tqlabel.h>
+#include <tqtooltip.h>
+#include <tqlayout.h>
+#include <tqpixmap.h>
+#include <tqtoolbar.h>
+#include <tqdockwindow.h>
#include <kdebug.h>
#include <kparts/event.h>
@@ -45,14 +45,14 @@
#endif
KoToolBox::KoToolBox( KMainWindow *mainWin, const char* name, KInstance* instance, int numberOfTooltypes )
- : KToolBar( mainWin, Qt::DockLeft, false, name, true, true), m_instance(instance)
+ : KToolBar( mainWin, TQt::DockLeft, false, name, true, true), m_instance(instance)
{
setFullSize( false );
setMargin(2);
- m_buttonGroup = new QButtonGroup( 0L );
+ m_buttonGroup = new TQButtonGroup( 0L );
m_buttonGroup->setExclusive( true );
- connect( m_buttonGroup, SIGNAL( pressed( int ) ), this, SLOT( slotButtonPressed( int ) ) );
+ connect( m_buttonGroup, TQT_SIGNAL( pressed( int ) ), this, TQT_SLOT( slotButtonPressed( int ) ) );
m_tools.setAutoDelete( true );
// Create separate lists for the various sorts of tools
@@ -83,7 +83,7 @@ void KoToolBox::slotButtonPressed( int id )
}
-void KoToolBox::registerTool( KAction *tool, int toolType, Q_UINT32 priority )
+void KoToolBox::registerTool( KAction *tool, int toolType, TQ_UINT32 priority )
{
uint prio = priority;
ToolList * tl = m_tools.at(toolType);
@@ -91,18 +91,18 @@ void KoToolBox::registerTool( KAction *tool, int toolType, Q_UINT32 priority )
(*tl)[prio] = tool;
}
-QToolButton *KoToolBox::createButton(QWidget * parent, const char* iconName, QString tooltip)
+TQToolButton *KoToolBox::createButton(TQWidget * tqparent, const char* iconName, TQString tooltip)
{
- QToolButton *button = new QToolButton(parent);
+ TQToolButton *button = new TQToolButton(tqparent);
if ( iconName && *iconName ) {
- QPixmap pixmap = BarIcon( iconName, m_instance );
+ TQPixmap pixmap = BarIcon( iconName, m_instance );
button->setPixmap( pixmap );
button->setToggleButton( true );
}
if ( !tooltip.isEmpty() ) {
- QToolTip::add( button, tooltip );
+ TQToolTip::add( button, tooltip );
}
return button;
}
@@ -125,7 +125,7 @@ void KoToolBox::setupTools()
KAction *tool = it.data();
if(! tool)
continue;
- QToolButton *bn = createButton(tools->getNextParent(), tool->icon().latin1(), tool->toolTip());
+ TQToolButton *bn = createButton(tools->getNextParent(), tool->icon().latin1(), tool->toolTip());
tools->add(bn);
m_buttonGroup->insert( bn, id++ );
m_idToActionMap.append( tool );
@@ -145,7 +145,7 @@ void KoToolBox::setOrientation ( Qt::Orientation o )
o = o == Qt::Vertical ? Qt::Horizontal : Qt::Vertical;
}
- QDockWindow::setOrientation( o );
+ TQDockWindow::setOrientation( o );
for (uint i = 0; i < m_toolBoxes.count(); ++i) {
ToolArea *t = m_toolBoxes.at(i);
@@ -171,12 +171,12 @@ void KoToolBox::enableTools(bool enable)
it.data()->setEnabled(enable);
}
m_buttonGroup->setEnabled(enable);
- for (Q_UINT32 i = 0; i < m_numberOfButtons; ++i) {
- m_buttonGroup->find( i )->setEnabled( enable );
+ for (TQ_UINT32 i = 0; i < m_numberOfButtons; ++i) {
+ m_buttonGroup->tqfind( i )->setEnabled( enable );
}
}
-void KoToolBox::slotSetTool(const QString & toolname)
+void KoToolBox::slotSetTool(const TQString & toolname)
{
for (uint i = 0; i < m_idToActionMap.count(); ++i) {
KAction * a = m_idToActionMap.at(i);
@@ -193,25 +193,25 @@ void KoToolBox::slotSetTool(const QString & toolname)
// class ToolArea
-ToolArea::ToolArea(QWidget *parent)
- : QWidget(parent), m_left(true)
+ToolArea::ToolArea(TQWidget *tqparent)
+ : TQWidget(tqparent), m_left(true)
{
- m_layout = new QBoxLayout(this, QBoxLayout::LeftToRight, 0, 0, 0);
- QWidget *w = new QWidget(this);
+ m_layout = new TQBoxLayout(this, TQBoxLayout::LeftToRight, 0, 0, 0);
+ TQWidget *w = new TQWidget(this);
m_layout->addWidget(w);
- QGridLayout *grid = new QGridLayout(w, 2, 2);
- m_leftRow = new QWidget(w);
+ TQGridLayout *grid = new TQGridLayout(w, 2, 2);
+ m_leftRow = new TQWidget(w);
grid->addWidget(m_leftRow, 0, 0);
- m_leftLayout = new QBoxLayout(m_leftRow, QBoxLayout::TopToBottom, 0, 1, 0);
+ m_leftLayout = new TQBoxLayout(m_leftRow, TQBoxLayout::TopToBottom, 0, 1, 0);
- w = new QWidget(this);
+ w = new TQWidget(this);
m_layout->addWidget(w);
- grid = new QGridLayout(w, 2, 2);
- m_rightRow = new QWidget(w);
+ grid = new TQGridLayout(w, 2, 2);
+ m_rightRow = new TQWidget(w);
grid->addWidget(m_rightRow, 0, 0);
- m_rightLayout = new QBoxLayout(m_rightRow, QBoxLayout::TopToBottom, 0, 1, 0);
+ m_rightLayout = new TQBoxLayout(m_rightRow, TQBoxLayout::TopToBottom, 0, 1, 0);
}
@@ -220,7 +220,7 @@ ToolArea::~ToolArea()
}
-void ToolArea::add(QWidget *button)
+void ToolArea::add(TQWidget *button)
{
if (m_left)
m_leftLayout->addWidget(button);
@@ -231,7 +231,7 @@ void ToolArea::add(QWidget *button)
}
-QWidget* ToolArea::getNextParent()
+TQWidget* ToolArea::getNextParent()
{
if (m_left)
return m_leftRow;
@@ -241,15 +241,15 @@ QWidget* ToolArea::getNextParent()
void ToolArea::setOrientation ( Qt::Orientation o )
{
- QBoxLayout::Direction dir = (o != Qt::Horizontal
- ? QBoxLayout::TopToBottom
- : QBoxLayout::LeftToRight);
+ TQBoxLayout::Direction dir = (o != Qt::Horizontal
+ ? TQBoxLayout::TopToBottom
+ : TQBoxLayout::LeftToRight);
m_leftLayout->setDirection(dir);
m_rightLayout->setDirection(dir);
m_layout->setDirection(o == Qt::Horizontal
- ? QBoxLayout::TopToBottom
- : QBoxLayout::LeftToRight);
+ ? TQBoxLayout::TopToBottom
+ : TQBoxLayout::LeftToRight);
}