diff options
author | Mavridis Philippe <[email protected]> | 2021-01-13 19:30:17 +0200 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2021-01-13 19:30:17 +0200 |
commit | 357ddeb8afd82d69ef871c146f4fc8f2c67fb17e (patch) | |
tree | dc3ef0e6fedd64f5fb177c114f72e1515a07cd1b /src/k3bjobprogressosd_mod.cpp | |
parent | c6cbd71bc169ac0e927e52325dbbbcb506abbc73 (diff) | |
download | klamav-357ddeb8afd82d69ef871c146f4fc8f2c67fb17e.tar.gz klamav-357ddeb8afd82d69ef871c146f4fc8f2c67fb17e.zip |
Conversion Qt3->TQt
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'src/k3bjobprogressosd_mod.cpp')
-rw-r--r-- | src/k3bjobprogressosd_mod.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/k3bjobprogressosd_mod.cpp b/src/k3bjobprogressosd_mod.cpp index a531c64..1431bf3 100644 --- a/src/k3bjobprogressosd_mod.cpp +++ b/src/k3bjobprogressosd_mod.cpp @@ -29,15 +29,15 @@ #include <klocale.h> #include <kpopupmenu.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qapplication.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqapplication.h> #include <X11/Xlib.h> -K3bJobProgressOSD::K3bJobProgressOSD( QWidget* parent, const char* name ) - : QWidget( parent, name, WType_TopLevel | WNoAutoErase | WStyle_Customize | WX11BypassWM | WStyle_StaysOnTop ), +K3bJobProgressOSD::K3bJobProgressOSD( TQWidget* parent, const char* name ) + : TQWidget( parent, name, WType_TopLevel | WNoAutoErase | WStyle_Customize | WX11BypassWM | WStyle_StaysOnTop ), m_dirty(true), m_dragging(false), m_screen(0), @@ -67,11 +67,11 @@ void K3bJobProgressOSD::show() if( m_dirty ) renderOSD(); - QWidget::show(); + TQWidget::show(); } -void K3bJobProgressOSD::setText( const QString& text ) +void K3bJobProgressOSD::setText( const TQString& text ) { if( m_text != text ) { m_text = text; @@ -90,7 +90,7 @@ void K3bJobProgressOSD::setProgress( int p ) } -void K3bJobProgressOSD::setPosition( const QPoint& p ) +void K3bJobProgressOSD::setPosition( const TQPoint& p ) { m_position = p; reposition(); @@ -115,39 +115,39 @@ void K3bJobProgressOSD::renderOSD() // ---------------------------------------- // calculate needed size - QPixmap icon = KGlobal::iconLoader()->loadIcon( "klamav", KIcon::NoGroup, 32 ); + TQPixmap icon = KGlobal::iconLoader()->loadIcon( "klamav", KIcon::NoGroup, 32 ); int margin = 10; int textWidth = fontMetrics().width( m_text ); // do not change the size everytime the text changes, just in case we are too small - QSize newSize( QMAX( QMAX( 2*margin + icon.width() + margin + textWidth, 100 ), width() ), - QMAX( 2*margin + icon.height(), 2*margin + fontMetrics().height()*2 ) ); + TQSize newSize( TQMAX( TQMAX( 2*margin + icon.width() + margin + textWidth, 100 ), width() ), + TQMAX( 2*margin + icon.height(), 2*margin + fontMetrics().height()*2 ) ); m_osdBuffer.resize( newSize ); - QPainter p( &m_osdBuffer ); + TQPainter p( &m_osdBuffer ); - p.setPen( Qt::black ); + p.setPen( TQt::black ); // draw the background and the frame - QRect thisRect( 0, 0, newSize.width(), newSize.height() ); - p.fillRect( thisRect, Qt::white ); + TQRect thisRect( 0, 0, newSize.width(), newSize.height() ); + p.fillRect( thisRect, TQt::white ); p.drawRect( thisRect ); // draw the k3b icon p.drawPixmap( margin, (newSize.height()-icon.height())/2, icon ); // draw the text - QSize textSize = fontMetrics().size( 0, m_text ); + TQSize textSize = fontMetrics().size( 0, m_text ); int textX = 2*margin + icon.width(); int textY = margin + fontMetrics().ascent(); p.drawText( textX, textY, m_text ); // draw the progress textY += fontMetrics().descent() + 4; - QRect progressRect( textX, textY, newSize.width()-textX-margin, newSize.height()-textY-margin ); + TQRect progressRect( textX, textY, newSize.width()-textX-margin, newSize.height()-textY-margin ); p.drawRect( progressRect ); progressRect.setWidth( m_progress > 0 ? m_progress*progressRect.width()/100 : 0 ); - p.fillRect( progressRect, Qt::black ); + p.fillRect( progressRect, TQt::black ); // reposition the osd reposition( newSize ); @@ -160,19 +160,19 @@ void K3bJobProgressOSD::renderOSD() void K3bJobProgressOSD::setScreen( int screen ) { - const int n = QApplication::desktop()->numScreens(); + const int n = TQApplication::desktop()->numScreens(); m_screen = (screen >= n) ? n-1 : screen; reposition(); } -void K3bJobProgressOSD::reposition( QSize newSize ) +void K3bJobProgressOSD::reposition( TQSize newSize ) { if( !newSize.isValid() ) newSize = size(); - QPoint newPos = m_position; - const QRect& screen = QApplication::desktop()->screenGeometry( m_screen ); + TQPoint newPos = m_position; + const TQRect& screen = TQApplication::desktop()->screenGeometry( m_screen ); // now to properly resize if put into one of the corners we interpret the position // depending on the quadrant @@ -197,13 +197,13 @@ void K3bJobProgressOSD::reposition( QSize newSize ) } -void K3bJobProgressOSD::paintEvent( QPaintEvent* ) +void K3bJobProgressOSD::paintEvent( TQPaintEvent* ) { bitBlt( this, 0, 0, &m_osdBuffer ); } -void K3bJobProgressOSD::mousePressEvent( QMouseEvent* e ) +void K3bJobProgressOSD::mousePressEvent( TQMouseEvent* e ) { m_dragOffset = e->pos(); @@ -219,7 +219,7 @@ void K3bJobProgressOSD::mousePressEvent( QMouseEvent* e ) } -void K3bJobProgressOSD::mouseReleaseEvent( QMouseEvent* ) +void K3bJobProgressOSD::mouseReleaseEvent( TQMouseEvent* ) { if( m_dragging ) { m_dragging = false; @@ -228,16 +228,16 @@ void K3bJobProgressOSD::mouseReleaseEvent( QMouseEvent* ) } -void K3bJobProgressOSD::mouseMoveEvent( QMouseEvent* e ) +void K3bJobProgressOSD::mouseMoveEvent( TQMouseEvent* e ) { if( m_dragging && this == mouseGrabber() ) { // check if the osd has been dragged out of the current screen - int currentScreen = QApplication::desktop()->screenNumber( e->globalPos() ); + int currentScreen = TQApplication::desktop()->screenNumber( e->globalPos() ); if( currentScreen != -1 ) m_screen = currentScreen; - const QRect& screen = QApplication::desktop()->screenGeometry( m_screen ); + const TQRect& screen = TQApplication::desktop()->screenGeometry( m_screen ); // make sure the position is valid m_position = fixupPosition( e->globalPos() - m_dragOffset - screen.topLeft() ); @@ -256,10 +256,10 @@ void K3bJobProgressOSD::mouseMoveEvent( QMouseEvent* e ) } -QPoint K3bJobProgressOSD::fixupPosition( const QPoint& pp ) +TQPoint K3bJobProgressOSD::fixupPosition( const TQPoint& pp ) { - QPoint p(pp); - const QRect& screen = QApplication::desktop()->screenGeometry( m_screen ); + TQPoint p(pp); + const TQRect& screen = TQApplication::desktop()->screenGeometry( m_screen ); int maxY = screen.height() - height() - s_outerMargin; int maxX = screen.width() - width() - s_outerMargin; @@ -281,7 +281,7 @@ QPoint K3bJobProgressOSD::fixupPosition( const QPoint& pp ) void K3bJobProgressOSD::readSettings( KConfigBase* c ) { - QString oldGroup = c->group(); + TQString oldGroup = c->group(); c->setGroup( "KlamOSD Position" ); setPosition( c->readPointEntry( "Position", 0 ) ); @@ -293,7 +293,7 @@ void K3bJobProgressOSD::readSettings( KConfigBase* c ) void K3bJobProgressOSD::saveSettings( KConfigBase* c ) { - QString oldGroup = c->group(); + TQString oldGroup = c->group(); c->setGroup( "KlamOSD Position" ); c->writeEntry( "Position", m_position ); |