summaryrefslogtreecommitdiffstats
path: root/krec/krecfileviewhelpers.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:43:15 +0000
commite654398e46e37abf457b2b1122ab898d2c51c49f (patch)
treed39ee6440f3c3663c3ead84a2d4cc2d034667e96 /krec/krecfileviewhelpers.cpp
parente4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff)
downloadtdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.tar.gz
tdemultimedia-e654398e46e37abf457b2b1122ab898d2c51c49f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1157644 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krec/krecfileviewhelpers.cpp')
-rw-r--r--krec/krecfileviewhelpers.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/krec/krecfileviewhelpers.cpp b/krec/krecfileviewhelpers.cpp
index 8025f576..a064dfea 100644
--- a/krec/krecfileviewhelpers.cpp
+++ b/krec/krecfileviewhelpers.cpp
@@ -18,19 +18,19 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qpainter.h>
-#include <qpointarray.h>
-#include <qpopupmenu.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqpainter.h>
+#include <tqpointarray.h>
+#include <tqpopupmenu.h>
#include <kpopupmenu.h>
-KRecTimeBar::KRecTimeBar( QWidget* p, const char* n ) : QFrame( p,n )
+KRecTimeBar::KRecTimeBar( TQWidget* p, const char* n ) : TQFrame( p,n )
,_size(10), _pos(0)
{
//kdDebug( 60005 ) << k_funcinfo << endl;
setMinimumSize( 10,10 );
- setFrameStyle( QFrame::Panel|QFrame::Plain );
+ setFrameStyle( TQFrame::Panel|TQFrame::Plain );
setLineWidth( 1 );
}
@@ -38,24 +38,24 @@ KRecTimeBar::~KRecTimeBar() {
//kdDebug( 60005 ) << k_funcinfo << endl;
}
-void KRecTimeBar::drawContents( QPainter* p ) {
+void KRecTimeBar::drawContents( TQPainter* p ) {
int w = contentsRect().width();
int h = contentsRect().height();
int t = contentsRect().top();
int l = contentsRect().left();
- p->setPen( QColor( 255,0,0 ) );
+ p->setPen( TQColor( 255,0,0 ) );
if ( _pos < _size ) {
int x = int( l + w * float( _pos ) / _size );
p->drawLine( x, t, x, int( t+h/2 ) );
} else {
- QPointArray tmp;
+ TQPointArray tmp;
tmp.putPoints( 0, 4, l+w-3,t+h/4, l+w-3,t+h/4*3, l+w,t+h/2, l+w-3,t+h/4 );
p->drawPolyline( tmp );
}
}
-void KRecTimeBar::mouseReleaseEvent( QMouseEvent* qme ) {
- QIODevice::Offset pos = 0;
+void KRecTimeBar::mouseReleaseEvent( TQMouseEvent* qme ) {
+ TQIODevice::Offset pos = 0;
if ( _size > 0 )
pos = int( float( qme->x() - contentsRect().left() ) / contentsRect().width() * _size );
//kdDebug( 60005 ) << k_funcinfo << "New Position: " << pos << endl;
@@ -73,18 +73,18 @@ void KRecTimeBar::newSize( int n ) {
}
-KRecTimeDisplay::KRecTimeDisplay( QWidget* p, const char* n )
- : QFrame( p,n )
+KRecTimeDisplay::KRecTimeDisplay( TQWidget* p, const char* n )
+ : TQFrame( p,n )
, _posmenu( 0 ), _sizemenu( 0 )
, _sizevalue( 0 ), _posvalue( 0 )
, _samplingRate( 44100 ), _bits( 16 ), _channels( 2 )
{
_position = new AKLabel( this );
- connect( _position, SIGNAL( showContextMenu( const QPoint & ) ), this, SLOT( timeContextMenu( const QPoint &) ) );
+ connect( _position, TQT_SIGNAL( showContextMenu( const TQPoint & ) ), this, TQT_SLOT( timeContextMenu( const TQPoint &) ) );
_size = new AKLabel( this );
- connect( _size, SIGNAL( showContextMenu( const QPoint &) ), this, SLOT( sizeContextMenu( const QPoint &) ) );
+ connect( _size, TQT_SIGNAL( showContextMenu( const TQPoint &) ), this, TQT_SLOT( sizeContextMenu( const TQPoint &) ) );
- _layout = new QBoxLayout( this, QBoxLayout::LeftToRight, 0, 2 );
+ _layout = new TQBoxLayout( this, TQBoxLayout::LeftToRight, 0, 2 );
_layout->addStretch( 100 );
_layout->addWidget( _position );
_layout->addSpacing( 2 );
@@ -98,10 +98,10 @@ KRecTimeDisplay::~KRecTimeDisplay() {
void KRecTimeDisplay::reset() {
_position->setText( positionText( 0, 0 ) );
_size->setText( sizeText( 0, 0 ) );
- _position->setFrameStyle( QFrame::Panel|QFrame::Sunken );
+ _position->setFrameStyle( TQFrame::Panel|TQFrame::Sunken );
_position->setLineWidth( 1 );
_position->setMargin( 2 );
- _size->setFrameStyle( QFrame::Panel|QFrame::Sunken );
+ _size->setFrameStyle( TQFrame::Panel|TQFrame::Sunken );
_size->setLineWidth( 1 );
_size->setMargin( 2 );
}
@@ -119,7 +119,7 @@ void KRecTimeDisplay::newSize( int n ) {
_sizevalue = n;
_size->setText( sizeText( KRecGlobal::the()->timeFormatMode(), n ) );
}
-void KRecTimeDisplay::newFilename( const QString &n ) {
+void KRecTimeDisplay::newFilename( const TQString &n ) {
_filename = n;
if ( _filename.isNull() ) {
newPos( 0 );
@@ -127,8 +127,8 @@ void KRecTimeDisplay::newFilename( const QString &n ) {
}
}
-QString KRecTimeDisplay::formatTime( const int mode, const int sample ) const {
- QString text;
+TQString KRecTimeDisplay::formatTime( const int mode, const int sample ) const {
+ TQString text;
bool verbose = mode / 100;
switch ( mode % 100 ) {
case 3:
@@ -137,13 +137,13 @@ QString KRecTimeDisplay::formatTime( const int mode, const int sample ) const {
int kbyte = bytes % 1024;
bytes /= 1024;
int mbyte = bytes % 1024;
- text += QString::number( mbyte );
+ text += TQString::number( mbyte );
if ( verbose ) text += i18n( "MB" );
text += ".";
if ( kbyte < 1000 ) text += "0";
if ( kbyte < 100 ) text += "0";
if ( kbyte < 10 ) text += "0";
- text += QString::number( kbyte );
+ text += TQString::number( kbyte );
if ( verbose ) text += i18n( "kB" );
}
break;
@@ -157,20 +157,20 @@ QString KRecTimeDisplay::formatTime( const int mode, const int sample ) const {
int mins = value % 60;
value = value / 60;
if ( value ) {
- text += QString::number( value );
+ text += TQString::number( value );
if ( verbose ) text += i18n( "hours" );
text += ":";
}
if ( mins<10 ) text += "0";
- text += QString::number( mins );
+ text += TQString::number( mins );
if ( verbose ) text += i18n( "mins" );
text += ":";
if ( secs<10 ) text += "0";
- text += QString::number( secs );
+ text += TQString::number( secs );
if ( verbose ) text += i18n( "secs" );
text += ".";
if ( frames < 10 ) text += "0";
- text += QString::number( frames );
+ text += TQString::number( frames );
if ( verbose ) text += i18n( "frames" );
}
break;
@@ -184,36 +184,36 @@ QString KRecTimeDisplay::formatTime( const int mode, const int sample ) const {
int mins = value % 60;
value = value / 60;
if ( value ) {
- text += QString::number( value );
+ text += TQString::number( value );
if ( verbose ) text += i18n( "hours" );
text += ":";
}
if ( mins<10 ) text += "0";
- text += QString::number( mins );
+ text += TQString::number( mins );
if ( verbose ) text += i18n( "mins" );
text += ":";
if ( secs<10 ) text += "0";
- text += QString::number( secs );
+ text += TQString::number( secs );
if ( verbose ) text += i18n( "secs" );
text += ".";
if ( samples < 10000 && ( _samplingRate / 60 > 10000 ) ) text += "0";
if ( samples < 1000 ) text += "0";
if ( samples < 100 ) text += "0";
if ( samples < 10 ) text += "0";
- text += QString::number( samples );
+ text += TQString::number( samples );
if ( verbose ) text += i18n( "samples" );
}
break;
case 0:
default:
- text = QString::number( sample );
+ text = TQString::number( sample );
if ( verbose ) text += i18n( "samples" );
break;
};
return text;
}
-void KRecTimeDisplay::timeContextMenu( QPopupMenu* menu ) {
+void KRecTimeDisplay::timeContextMenu( TQPopupMenu* menu ) {
if ( !_filename.isNull() ) {
menu->insertSeparator( 0 );
menu->insertItem( i18n( "kByte: %1" ).arg( formatTime( 3, _posvalue ) ), -1, 0 );
@@ -226,13 +226,13 @@ void KRecTimeDisplay::timeContextMenu( QPopupMenu* menu ) {
} else
menu->insertItem( i18n( "<no file>" ), -1, 0 );
}
-void KRecTimeDisplay::timeContextMenu( const QPoint &point ) {
+void KRecTimeDisplay::timeContextMenu( const TQPoint &point ) {
if ( _posmenu ) delete _posmenu;
_posmenu = new KPopupMenu( this );
timeContextMenu( _posmenu );
_posmenu->exec( point );
}
-void KRecTimeDisplay::sizeContextMenu( QPopupMenu* menu ) {
+void KRecTimeDisplay::sizeContextMenu( TQPopupMenu* menu ) {
if ( !_filename.isNull() ) {
menu->insertSeparator( 0 );
menu->insertItem( i18n( "kByte: %1" ).arg( formatTime( 3, _sizevalue ) ), -1, 0 );
@@ -245,7 +245,7 @@ void KRecTimeDisplay::sizeContextMenu( QPopupMenu* menu ) {
} else
menu->insertItem( i18n( "<no file>" ), -1, 0 );
}
-void KRecTimeDisplay::sizeContextMenu( const QPoint &point ) {
+void KRecTimeDisplay::sizeContextMenu( const TQPoint &point ) {
if ( _sizemenu ) delete _sizemenu;
_sizemenu = new KPopupMenu( this );
sizeContextMenu( _sizemenu );
@@ -254,14 +254,14 @@ void KRecTimeDisplay::sizeContextMenu( const QPoint &point ) {
void KRecTimeDisplay::jumpToTime() {
}
-QString KRecTimeDisplay::positionText( int m, int n ) {
+TQString KRecTimeDisplay::positionText( int m, int n ) {
return i18n( "Position: %1" ).arg( formatTime( m,n ) );
}
-QString KRecTimeDisplay::sizeText( int m, int n ) {
+TQString KRecTimeDisplay::sizeText( int m, int n ) {
return i18n( "Size: %1" ).arg( formatTime( m,n ) );
}
-void AKLabel::mousePressEvent( QMouseEvent* qme ) {
+void AKLabel::mousePressEvent( TQMouseEvent* qme ) {
if ( qme->button() == Qt::RightButton )
emit showContextMenu( qme->globalPos() );
}