diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2021-01-13 19:30:17 +0200 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2021-01-13 19:30:17 +0200 |
commit | 357ddeb8afd82d69ef871c146f4fc8f2c67fb17e (patch) | |
tree | dc3ef0e6fedd64f5fb177c114f72e1515a07cd1b /src/tabwidget.cpp | |
parent | c6cbd71bc169ac0e927e52325dbbbcb506abbc73 (diff) | |
download | klamav-357ddeb8afd82d69ef871c146f4fc8f2c67fb17e.tar.gz klamav-357ddeb8afd82d69ef871c146f4fc8f2c67fb17e.zip |
Conversion Qt3->TQt
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'src/tabwidget.cpp')
-rw-r--r-- | src/tabwidget.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp index 3103b72..e2d4577 100644 --- a/src/tabwidget.cpp +++ b/src/tabwidget.cpp @@ -7,8 +7,8 @@ #include "tabwidget.h" -#include <qstyle.h> -#include <qclipboard.h> +#include <tqstyle.h> +#include <tqclipboard.h> #include <kapplication.h> #include <ktabbar.h> @@ -22,13 +22,13 @@ using namespace KlamAV; -TabWidget::TabWidget(QWidget * parent, const char *name) +TabWidget::TabWidget(TQWidget * parent, const char *name) :KTabWidget(parent, name), m_CurrentMaxLength(30) { setTabReorderingEnabled(false); - connect( this, SIGNAL( currentChanged(QWidget *) ), this, - SLOT( slotTabChanged(QWidget *) ) ); - connect(this, SIGNAL(closeRequest(QWidget*)), this, SLOT(slotCloseRequest(QWidget*))); + connect( this, SIGNAL( currentChanged(TQWidget *) ), this, + SLOT( slotTabChanged(TQWidget *) ) ); + connect(this, SIGNAL(closeRequest(TQWidget*)), this, SLOT(slotCloseRequest(TQWidget*))); //setHoverCloseButton(Settings::closeButtonOnTabs()); } @@ -51,12 +51,12 @@ void TabWidget::addFrame(Frame *f) Frame *TabWidget::currentFrame() { - QWidget *w=currentPage(); + TQWidget *w=currentPage(); if (!w) return 0; return m_frames[w]; } -void TabWidget::slotTabChanged(QWidget *w) +void TabWidget::slotTabChanged(TQWidget *w) { emit currentFrameChanged(m_frames[w]); } @@ -73,29 +73,29 @@ void TabWidget::removeFrame(Frame *f) unsigned int TabWidget::tabBarWidthForMaxChars( uint maxLength ) { int hframe, overlap; - hframe = tabBar()->style().pixelMetric( QStyle::PM_TabBarTabHSpace, this ); - overlap = tabBar()->style().pixelMetric( QStyle::PM_TabBarTabOverlap, this ); + hframe = tabBar()->style().pixelMetric( TQStyle::PM_TabBarTabHSpace, this ); + overlap = tabBar()->style().pixelMetric( TQStyle::PM_TabBarTabOverlap, this ); - QFontMetrics fm = tabBar()->fontMetrics(); + TQFontMetrics fm = tabBar()->fontMetrics(); int x = 0; for( int i=0; i < count(); ++i ) { Frame *f=m_frames[page(i)]; - QString newTitle=f->title(); + TQString newTitle=f->title(); if ( newTitle.length() > maxLength ) newTitle = newTitle.left( maxLength-3 ) + "..."; - QTab* tab = tabBar()->tabAt( i ); + TQTab* tab = tabBar()->tabAt( i ); int lw = fm.width( newTitle ); int iw = 0; if ( tab->iconSet() ) - iw = tab->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 4; + iw = tab->iconSet()->pixmap( TQIconSet::Small, TQIconSet::Normal ).width() + 4; - x += ( tabBar()->style().sizeFromContents( QStyle::CT_TabBarTab, this, QSize( QMAX( lw + hframe + iw, QApplication::globalStrut().width() ), 0 ), QStyleOption( tab ) ) ).width(); + x += ( tabBar()->style().sizeFromContents( TQStyle::CT_TabBarTab, this, TQSize( TQMAX( lw + hframe + iw, TQApplication::globalStrut().width() ), 0 ), TQStyleOption( tab ) ) ).width(); } return x; } -void TabWidget::setTitle( const QString &title , QWidget* sender) +void TabWidget::setTitle( const TQString &title , TQWidget* sender) { removeTabToolTip( sender ); @@ -106,9 +106,9 @@ void TabWidget::setTitle( const QString &title , QWidget* sender) uint lcw=0, rcw=0; int tabBarHeight = tabBar()->sizeHint().height(); if ( cornerWidget( TopLeft ) && cornerWidget( TopLeft )->isVisible() ) - lcw = QMAX( cornerWidget( TopLeft )->width(), tabBarHeight ); + lcw = TQMAX( cornerWidget( TopLeft )->width(), tabBarHeight ); if ( cornerWidget( TopRight ) && cornerWidget( TopRight )->isVisible() ) - rcw = QMAX( cornerWidget( TopRight )->width(), tabBarHeight ); + rcw = TQMAX( cornerWidget( TopRight )->width(), tabBarHeight ); uint maxTabBarWidth = width() - lcw - rcw; uint newMaxLength=30; @@ -116,7 +116,7 @@ void TabWidget::setTitle( const QString &title , QWidget* sender) if ( tabBarWidthForMaxChars( newMaxLength ) < maxTabBarWidth ) break; } - QString newTitle = title; + TQString newTitle = title; if ( newTitle.length() > newMaxLength ) { setTabToolTip( sender, newTitle ); @@ -148,7 +148,7 @@ void TabWidget::setTitle( const QString &title , QWidget* sender) } } -void TabWidget::contextMenu(int i, const QPoint &p) +void TabWidget::contextMenu(int i, const TQPoint &p) { currentItem = page(i); KPopupMenu popup; @@ -183,7 +183,7 @@ void TabWidget::slotCopyLinkAddress() KURL url; if (KHTMLView *view = dynamic_cast<KHTMLView*>(currentItem)) url = view->part()->url(); else return; - QClipboard *cb = QApplication::clipboard(); + TQClipboard *cb = TQApplication::clipboard(); if(cb) cb->setText(url.prettyURL()); } @@ -195,7 +195,7 @@ void TabWidget::slotCloseTab() currentItem = 0; } -void TabWidget::slotCloseRequest(QWidget* widget) +void TabWidget::slotCloseRequest(TQWidget* widget) { if (m_frames.find(widget) != NULL) removeFrame(m_frames.find(widget)); |