summaryrefslogtreecommitdiffstats
path: root/src/app/slider.cpp
diff options
context:
space:
mode:
authorgregory guy <[email protected]>2020-06-13 16:09:24 +0200
committergregory guy <[email protected]>2020-06-13 16:09:24 +0200
commit2c9bc9b806f533df7b8f5349467d0f4be95314a4 (patch)
tree15f82ae94dd430374f3d939958912c4fb2855326 /src/app/slider.cpp
parent38eaf7209a322a622e1b898eaa5477568ca9c6b6 (diff)
downloadcodeine-2c9bc9b806f533df7b8f5349467d0f4be95314a4.tar.gz
codeine-2c9bc9b806f533df7b8f5349467d0f4be95314a4.zip
Conversion qt3 -> tqt3
Signed-off-by: gregory guy <[email protected]>
Diffstat (limited to 'src/app/slider.cpp')
-rw-r--r--src/app/slider.cpp64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/app/slider.cpp b/src/app/slider.cpp
index 89b5ced..205a3b8 100644
--- a/src/app/slider.cpp
+++ b/src/app/slider.cpp
@@ -3,12 +3,12 @@
#include "debug.h"
#include "slider.h"
-#include <qapplication.h>
-#include <qlabel.h>
-#include <qsize.h>
-#include <qtooltip.h>
+#include <ntqapplication.h>
+#include <ntqlabel.h>
+#include <ntqsize.h>
+#include <ntqtooltip.h>
-#include <qpainter.h>
+#include <ntqpainter.h>
#include "xineEngine.h"
using Codeine::Slider;
@@ -17,8 +17,8 @@ using Codeine::Slider;
Slider *Slider::s_instance = 0;
-Slider::Slider( QWidget *parent, uint max )
- : QSlider( Qt::Horizontal, parent )
+Slider::Slider( TQWidget *parent, uint max )
+ : TQSlider( TQt::Horizontal, parent )
, m_sliding( false )
, m_outside( false )
, m_prevValue( 0 )
@@ -27,34 +27,34 @@ Slider::Slider( QWidget *parent, uint max )
setRange( 0, max );
setFocusPolicy( NoFocus );
- setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding );
+ setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding );
}
void
-Slider::wheelEvent( QWheelEvent *e )
+Slider::wheelEvent( TQWheelEvent *e )
{
//if you use this class elsewhere, NOTE this is Codeine specific
e->ignore(); //pass to VideoWindow
}
void
-Slider::mouseMoveEvent( QMouseEvent *e )
+Slider::mouseMoveEvent( TQMouseEvent *e )
{
if( m_sliding )
{
//feels better, but using set value of 20 is bad of course
- QRect rect = this->rect();
+ TQRect rect = this->rect();
rect.addCoords( -20, -20, 20, 20 );
if( !rect.contains( e->pos() ) ) {
if( !m_outside )
- QSlider::setValue( m_prevValue );
+ TQSlider::setValue( m_prevValue );
m_outside = true;
} else {
m_outside = false;
- QSlider::setValue(
- QRangeControl::valueFromPosition(
+ TQSlider::setValue(
+ TQRangeControl::valueFromPosition(
e->pos().x() - sliderRect().width()/2,
width() - sliderRect().width() ) );
@@ -62,43 +62,43 @@ Slider::mouseMoveEvent( QMouseEvent *e )
}
}
else
- QSlider::mouseMoveEvent( e );
+ TQSlider::mouseMoveEvent( e );
}
void
-Slider::mousePressEvent( QMouseEvent *e )
+Slider::mousePressEvent( TQMouseEvent *e )
{
m_sliding = true;
- m_prevValue = QSlider::value();
+ m_prevValue = TQSlider::value();
if( !sliderRect().contains( e->pos() ) )
mouseMoveEvent( e );
}
void
-Slider::mouseReleaseEvent( QMouseEvent* )
+Slider::mouseReleaseEvent( TQMouseEvent* )
{
- if( !m_outside && QSlider::value() != m_prevValue )
+ if( !m_outside && TQSlider::value() != m_prevValue )
emit sliderReleased( value() );
m_sliding = false;
m_outside = false;
}
-static inline QString timeAsString( const int s )
+static inline TQString timeAsString( const int s )
{
- #define zeroPad( n ) n < 10 ? QString("0%1").arg( n ) : QString::number( n )
+ #define zeroPad( n ) n < 10 ? TQString("0%1").arg( n ) : TQString::number( n )
using Codeine::engine;
const int m = s / 60;
const int h = m / 60;
- QString time;
+ TQString time;
time.prepend( zeroPad( s % 60 ) ); //seconds
time.prepend( ':' );
time.prepend( zeroPad( m % 60 ) ); //minutes
time.prepend( ':' );
- time.prepend( QString::number( h ) ); //hours
+ time.prepend( TQString::number( h ) ); //hours
return time;
}
@@ -106,17 +106,17 @@ static inline QString timeAsString( const int s )
void
Slider::setValue( int newValue )
{
- static QLabel *w1 = 0;
- static QLabel *w2 = 0;
+ static TQLabel *w1 = 0;
+ static TQLabel *w2 = 0;
if (!w1) {
- w1 = new QLabel( this );
- w1->setPalette( QToolTip::palette() );
- w1->setFrameStyle( QFrame::Plain | QFrame::Box );
+ w1 = new TQLabel( this );
+ w1->setPalette( TQToolTip::palette() );
+ w1->setFrameStyle( TQFrame::Plain | TQFrame::Box );
- w2 = new QLabel( this );
- w2->setPalette( QToolTip::palette() );
- w2->setFrameStyle( QFrame::Plain | QFrame::Box );
+ w2 = new TQLabel( this );
+ w2->setPalette( TQToolTip::palette() );
+ w2->setFrameStyle( TQFrame::Plain | TQFrame::Box );
}
//TODO stupidly inefficeint! :)
@@ -131,7 +131,7 @@ Slider::setValue( int newValue )
const int left = int(l * (newValue / 65535.0));
const int right = l - left;
- QSlider::setValue( newValue );
+ TQSlider::setValue( newValue );
w1->move( 0, height() - w1->height() - 1 );
w1->setText( timeAsString( left ) + ' ' );
w1->adjustSize();