summaryrefslogtreecommitdiffstats
path: root/lib/kofficeui/tkaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kofficeui/tkaction.cpp')
-rw-r--r--lib/kofficeui/tkaction.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/lib/kofficeui/tkaction.cpp b/lib/kofficeui/tkaction.cpp
index f627df56..4af7d8d9 100644
--- a/lib/kofficeui/tkaction.cpp
+++ b/lib/kofficeui/tkaction.cpp
@@ -21,19 +21,19 @@
#include "tktoolbarbutton.h"
#include "tkcombobox.h"
-#include <qlabel.h>
-#include <qlayout.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
#include <ktoolbar.h>
#include <kiconloader.h>
#define SET_FOR_ALL_CONTAINER(WIDGET_TYPE,METHOD_NAME,VALUE) \
for( int id = 0; id < containerCount(); ++id ) { \
- QWidget* w = container(id); \
+ TQWidget* w = container(id); \
if ( w->inherits("KToolBar") ) { \
- QWidget* r = static_cast<KToolBar*>(w)->getWidget(itemId(id)); \
+ TQWidget* r = static_cast<KToolBar*>(w)->getWidget(itemId(id)); \
if (qstrcmp(r->name(),"KTToolBarLayout")==0) \
- r = (QWidget*)r->child("widget"); \
+ r = (TQWidget*)r->child("widget"); \
if ( r && r->inherits(#WIDGET_TYPE) ) { \
WIDGET_TYPE* b = static_cast<WIDGET_TYPE*>(r); \
b->METHOD_NAME(VALUE); \
@@ -41,8 +41,8 @@
} \
}
-TKAction::TKAction(QObject* parent, const char* name)
-: KAction( "", 0, parent, name )
+TKAction::TKAction(TQObject* tqparent, const char* name)
+: KAction( "", 0, tqparent, name )
{
m_imode = TK::IconOnly;
}
@@ -51,7 +51,7 @@ TKAction::~TKAction()
{
}
-int TKAction::plug(QWidget* widget, int index)
+int TKAction::plug(TQWidget* widget, int index)
{
if ( widget->inherits("KToolBar") ) {
KToolBar* bar = static_cast<KToolBar*>(widget);
@@ -65,13 +65,13 @@ int TKAction::plug(QWidget* widget, int index)
TKToolBarButton* b = new TKToolBarButton(icon(),plainText(),bar,name(),instance);
// we don't need clicked() and buttonClicked(), do we?
- // connect(b,SIGNAL(clicked()),SLOT(slotActivated()));
+ // connect(b,TQT_SIGNAL(clicked()),TQT_SLOT(slotActivated()));
b->setIconMode(m_imode);
initToolBarButton(b);
bar->insertWidget( id_, 100, b, index );
addContainer(bar,id_);
- connect( bar, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) );
+ connect( bar, TQT_SIGNAL(destroyed()), this, TQT_SLOT(slotDestroyed()) );
return containerCount() - 1;
}
@@ -80,7 +80,7 @@ int TKAction::plug(QWidget* widget, int index)
void TKAction::initToolBarButton(TKToolBarButton* button)
{
- connect(button,SIGNAL(buttonClicked()),SLOT(slotActivated()));
+ connect(button,TQT_SIGNAL(buttonClicked()),TQT_SLOT(slotActivated()));
}
TK::IconMode TKAction::iconMode()
@@ -94,13 +94,13 @@ void TKAction::setIconMode(TK::IconMode mode)
SET_FOR_ALL_CONTAINER(TKToolBarButton,setIconMode,mode)
}
-void TKAction::setText(const QString& text)
+void TKAction::setText(const TQString& text)
{
KAction::setText(text);
updateLayout();
}
-void TKAction::setIcon(const QString& icon)
+void TKAction::setIcon(const TQString& icon)
{
KAction::setIcon(icon);
updateLayout();
@@ -110,9 +110,9 @@ void TKAction::updateLayout()
{
int len = containerCount();
for( int id = 0; id < len; ++id ) {
- QWidget* w = container( id );
+ TQWidget* w = container( id );
if (w->inherits("KToolBar")) {
- QWidget* r = static_cast<KToolBar*>(w)->getWidget(itemId(id));
+ TQWidget* r = static_cast<KToolBar*>(w)->getWidget(itemId(id));
if (qstrcmp(r->name(),"KTToolBarLayout")==0) {
updateLayout(r);
}
@@ -120,29 +120,29 @@ void TKAction::updateLayout()
}
}
-QWidget* TKAction::createLayout(QWidget* parent, QWidget* children)
+TQWidget* TKAction::createLayout(TQWidget* tqparent, TQWidget* tqchildren)
{
- QWidget* base = new QWidget(parent,"KTToolBarLayout");
- QLabel* textLabel = new QLabel(base,"text");
+ TQWidget* base = new TQWidget(tqparent,"KTToolBarLayout");
+ TQLabel* textLabel = new TQLabel(base,"text");
textLabel->setMinimumHeight(1);
- QLabel* pixLabel = new QLabel(base,"pixmap");
- children->reparent(base,QPoint(0,0));
- children->setName("widget");
- QHBoxLayout* layout = new QHBoxLayout(base,0,3);
- layout->setResizeMode(QLayout::Minimum);
- layout->addWidget(textLabel);
- layout->addWidget(pixLabel);
- layout->addWidget(children,1);
+ TQLabel* pixLabel = new TQLabel(base,"pixmap");
+ tqchildren->reparent(base,TQPoint(0,0));
+ tqchildren->setName("widget");
+ TQHBoxLayout* tqlayout = new TQHBoxLayout(base,0,3);
+ tqlayout->setResizeMode(TQLayout::Minimum);
+ tqlayout->addWidget(textLabel);
+ tqlayout->addWidget(pixLabel);
+ tqlayout->addWidget(tqchildren,1);
updateLayout(base);
return base;
}
-void TKAction::updateLayout(QWidget* base)
+void TKAction::updateLayout(TQWidget* base)
{
- QLabel* textLabel = (QLabel*)base->child("text");
- QLabel* pixLabel = (QLabel*)base->child("pixmap");
- QWidget* w = (QWidget*)base->child("widget");
+ TQLabel* textLabel = (TQLabel*)base->child("text");
+ TQLabel* pixLabel = (TQLabel*)base->child("pixmap");
+ TQWidget* w = (TQWidget*)base->child("widget");
if (!textLabel || !pixLabel || !w)
return;
@@ -153,7 +153,7 @@ void TKAction::updateLayout(QWidget* base)
} else
textLabel->hide();
- QPixmap pix;
+ TQPixmap pix;
if (hasIcon())
pix = iconSet(KIcon::Small).pixmap();
@@ -166,13 +166,13 @@ void TKAction::updateLayout(QWidget* base)
} else
pixLabel->hide();
- base->setFixedWidth( w->sizeHint().width() +
- (textLabel->isVisible() ? textLabel->sizeHint().width():0) +
- (pixLabel->isVisible() ? pixLabel->sizeHint().width():0) );
+ base->setFixedWidth( w->tqsizeHint().width() +
+ (textLabel->isVisible() ? textLabel->tqsizeHint().width():0) +
+ (pixLabel->isVisible() ? pixLabel->tqsizeHint().width():0) );
}
/******************************************************************************/
-TKBaseSelectAction::TKBaseSelectAction( QObject* parent, const char* name )
-: TKAction(parent,name)
+TKBaseSelectAction::TKBaseSelectAction( TQObject* tqparent, const char* name )
+: TKAction(tqparent,name)
{
m_current = 0;
m_editable = false;
@@ -182,7 +182,7 @@ TKBaseSelectAction::~TKBaseSelectAction()
{
}
-int TKBaseSelectAction::plug(QWidget* widget, int index)
+int TKBaseSelectAction::plug(TQWidget* widget, int index)
{
if ( widget->inherits("KToolBar") )
{
@@ -191,13 +191,13 @@ int TKBaseSelectAction::plug(QWidget* widget, int index)
TKComboBox* cb = new TKComboBox(m_editable,bar);
initComboBox(cb);
- cb->setMinimumWidth( cb->sizeHint().width() );
- QWidget* base = createLayout(bar,cb);
+ cb->setMinimumWidth( cb->tqsizeHint().width() );
+ TQWidget* base = createLayout(bar,cb);
bar->insertWidget( id_, 100, base, index );
addContainer( bar, id_ );
- connect( bar, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) );
+ connect( bar, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( slotDestroyed() ) );
setCurrentItem(currentItem());
@@ -213,7 +213,7 @@ int TKBaseSelectAction::currentItem()
void TKBaseSelectAction::initComboBox(TKComboBox* cb)
{
- connect(cb,SIGNAL(activated(int)),SLOT(slotActivated(int)));
+ connect(cb,TQT_SIGNAL(activated(int)),TQT_SLOT(slotActivated(int)));
}
void TKBaseSelectAction::setEditable(bool editable)
@@ -248,8 +248,8 @@ void TKBaseSelectAction::activate(int id)
emit activated(id);
}
/******************************************************************************/
-TKSelectAction::TKSelectAction( QObject* parent, const char* name )
-: TKBaseSelectAction(parent,name)
+TKSelectAction::TKSelectAction( TQObject* tqparent, const char* name )
+: TKBaseSelectAction(tqparent,name)
{
}
@@ -260,16 +260,16 @@ TKSelectAction::~TKSelectAction()
void TKSelectAction::initComboBox(TKComboBox* cb)
{
TKBaseSelectAction::initComboBox(cb);
- connect(cb,SIGNAL(activated(const QString&)),SLOT(slotActivated(const QString&)));
+ connect(cb,TQT_SIGNAL(activated(const TQString&)),TQT_SLOT(slotActivated(const TQString&)));
cb->insertStringList(items());
}
-void TKSelectAction::slotActivated(const QString& text)
+void TKSelectAction::slotActivated(const TQString& text)
{
emit activated(text);
}
-void TKSelectAction::setItems(const QStringList& lst )
+void TKSelectAction::setItems(const TQStringList& lst )
{
m_list = lst;
m_current = -1;
@@ -281,7 +281,7 @@ void TKSelectAction::setItems(const QStringList& lst )
setEnabled ( lst.count() > 0 || m_editable );
}
-QStringList TKSelectAction::items() const
+TQStringList TKSelectAction::items() const
{
return m_list;
}
@@ -291,7 +291,7 @@ void TKSelectAction::clear()
SET_FOR_ALL_CONTAINER(TKComboBox,clear, )
}
-void TKSelectAction::setEditText(const QString& text)
+void TKSelectAction::setEditText(const TQString& text)
{
SET_FOR_ALL_CONTAINER(TKComboBox,setEditText,text)
}