diff options
Diffstat (limited to 'lib/kformula/symbolaction.cc')
-rw-r--r-- | lib/kformula/symbolaction.cc | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/lib/kformula/symbolaction.cc b/lib/kformula/symbolaction.cc index 7939f231..6a80eeec 100644 --- a/lib/kformula/symbolaction.cc +++ b/lib/kformula/symbolaction.cc @@ -17,8 +17,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qlistbox.h> -#include <qpainter.h> +#include <tqlistbox.h> +#include <tqpainter.h> #include <kapplication.h> #include <kcombobox.h> @@ -34,64 +34,64 @@ KFORMULA_NAMESPACE_BEGIN -class SymbolComboItem : public QListBoxItem +class SymbolComboItem : public TQListBoxItem { public: - SymbolComboItem( const QString&, const QFont& , QChar, QComboBox* combo ); + SymbolComboItem( const TQString&, const TQFont& , TQChar, TQComboBox* combo ); virtual ~SymbolComboItem(); - virtual int width( const QListBox* ) const; - virtual int height( const QListBox* ) const; + virtual int width( const TQListBox* ) const; + virtual int height( const TQListBox* ) const; protected: - virtual void paint( QPainter *p ); + virtual void paint( TQPainter *p ); private: - QComboBox *m_combo; - QString m_name; - QFont m_font; - QChar m_symbol; + TQComboBox *m_combo; + TQString m_name; + TQFont m_font; + TQChar m_symbol; static int widest; }; int SymbolComboItem::widest = 0; -SymbolComboItem::SymbolComboItem( const QString &name, const QFont& font, - QChar symbol, QComboBox *combo ) - : QListBoxItem( combo->listBox() ), +SymbolComboItem::SymbolComboItem( const TQString &name, const TQFont& font, + TQChar symbol, TQComboBox *combo ) + : TQListBoxItem( combo->listBox() ), m_combo( combo ), m_name( name ), m_font( font ), m_symbol( symbol ) { setText( name ); - int charWidth = QFontMetrics( m_font ).width( QChar( m_symbol ) ); - widest = QMAX( widest, charWidth ); + int charWidth = TQFontMetrics( m_font ).width( TQChar( m_symbol ) ); + widest = TQMAX( widest, charWidth ); } SymbolComboItem::~SymbolComboItem() { } -int SymbolComboItem::width( const QListBox * /*lb*/ ) const +int SymbolComboItem::width( const TQListBox * /*lb*/ ) const { - return widest + QFontMetrics( KGlobalSettings::generalFont() ).width( text() ) + 12; + return widest + TQFontMetrics( KGlobalSettings::generalFont() ).width( text() ) + 12; } -int SymbolComboItem::height( const QListBox * /*lb*/ ) const +int SymbolComboItem::height( const TQListBox * /*lb*/ ) const { - int generalHeight = QFontMetrics( KGlobalSettings::generalFont() ).lineSpacing(); - int fontHeight = QFontMetrics( m_font ).lineSpacing(); - return QMAX( generalHeight, fontHeight ) + 2; + int generalHeight = TQFontMetrics( KGlobalSettings::generalFont() ).lineSpacing(); + int fontHeight = TQFontMetrics( m_font ).lineSpacing(); + return TQMAX( generalHeight, fontHeight ) + 2; } -void SymbolComboItem::paint( QPainter *p ) +void SymbolComboItem::paint( TQPainter *p ) { p->setFont( m_font ); - QFontMetrics fm( p->fontMetrics() ); + TQFontMetrics fm( p->fontMetrics() ); p->drawText( 3, fm.ascent() + fm.leading() / 2, - QString( "%1" ).arg( QChar( m_symbol ) ) ); + TQString( "%1" ).tqarg( TQChar( m_symbol ) ) ); p->setFont( KGlobalSettings::generalFont() ); fm = p->fontMetrics(); @@ -101,21 +101,21 @@ void SymbolComboItem::paint( QPainter *p ) /* * The symbol action * */ -SymbolAction::SymbolAction( QObject* parent, const char* name ) - : KSelectAction( parent, name ) +SymbolAction::SymbolAction( TQObject* tqparent, const char* name ) + : KSelectAction( tqparent, name ) { setEditable( FALSE ); } -SymbolAction::SymbolAction( const QString& text, const KShortcut& cut, - const QObject* receiver, const char* slot, - QObject* parent, const char* name ) - : KSelectAction( text, cut, receiver, slot, parent, name ) +SymbolAction::SymbolAction( const TQString& text, const KShortcut& cut, + const TQObject* receiver, const char* slot, + TQObject* tqparent, const char* name ) + : KSelectAction( text, cut, receiver, slot, tqparent, name ) { setEditable( FALSE ); } -int SymbolAction::plug( QWidget* w, int index ) +int SymbolAction::plug( TQWidget* w, int index ) { if (kapp && !kapp->authorizeKAction(name())) return -1; @@ -124,15 +124,15 @@ int SymbolAction::plug( QWidget* w, int index ) KToolBar* bar = static_cast<KToolBar*>( w ); int id_ = KAction::getToolButtonID(); KComboBox *cb = new KComboBox( bar ); - connect( cb, SIGNAL( activated( const QString & ) ), - SLOT( slotActivated( const QString & ) ) ); + connect( cb, TQT_SIGNAL( activated( const TQString & ) ), + TQT_SLOT( slotActivated( const TQString & ) ) ); cb->setEnabled( isEnabled() ); bar->insertWidget( id_, comboWidth(), cb, index ); - cb->setMinimumWidth( cb->sizeHint().width() ); + cb->setMinimumWidth( cb->tqsizeHint().width() ); addContainer( bar, id_ ); - connect( bar, SIGNAL( destroyed() ), this, SLOT( slotDestroyed() ) ); + connect( bar, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( slotDestroyed() ) ); updateItems( containerCount() - 1 ); @@ -141,9 +141,9 @@ int SymbolAction::plug( QWidget* w, int index ) else return KSelectAction::plug( w, index ); } -void SymbolAction::setSymbols( const QStringList &names, - const QFont& font, - const QMemArray<QChar>& chars ) +void SymbolAction::setSymbols( const TQStringList &names, + const TQFont& font, + const TQMemArray<TQChar>& chars ) { m_chars = chars; m_font = font; @@ -156,17 +156,17 @@ void SymbolAction::setSymbols( const QStringList &names, void SymbolAction::updateItems( int id ) { - QWidget *w = container( id ); + TQWidget *w = container( id ); if ( w->inherits( "KToolBar" ) ) { - QWidget *r = static_cast<KToolBar*>( w )->getWidget( itemId( id ) ); - if ( r->inherits( "QComboBox" ) ) { - QComboBox *cb = static_cast<QComboBox*>( r ); + TQWidget *r = static_cast<KToolBar*>( w )->getWidget( itemId( id ) ); + if ( r->inherits( TQCOMBOBOX_OBJECT_NAME_STRING ) ) { + TQComboBox *cb = static_cast<TQComboBox*>( r ); cb->clear(); for( uint i = 0; i < items().count(); ++i ) { new SymbolComboItem( *items().at( i ), m_font, m_chars.at( i ), cb ); } - cb->setMinimumWidth( cb->sizeHint().width() ); + cb->setMinimumWidth( cb->tqsizeHint().width() ); } } } |