diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:43:15 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:43:15 +0000 |
commit | e654398e46e37abf457b2b1122ab898d2c51c49f (patch) | |
tree | d39ee6440f3c3663c3ead84a2d4cc2d034667e96 /krec/krecfilewidgets.cpp | |
parent | e4f29b18e19394b9352f52a6c0d0d0e3932cf511 (diff) | |
download | tdemultimedia-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/krecfilewidgets.cpp')
-rw-r--r-- | krec/krecfilewidgets.cpp | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/krec/krecfilewidgets.cpp b/krec/krecfilewidgets.cpp index 44fd6a4e..16f2db93 100644 --- a/krec/krecfilewidgets.cpp +++ b/krec/krecfilewidgets.cpp @@ -19,26 +19,26 @@ #include <kdebug.h> #include <klocale.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qpainter.h> -#include <qpointarray.h> -#include <qlineedit.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpainter.h> +#include <tqpointarray.h> +#include <tqlineedit.h> #include <kinputdialog.h> -#include <qregion.h> -#include <qrect.h> -#include <qfont.h> -#include <qfontmetrics.h> +#include <tqregion.h> +#include <tqrect.h> +#include <tqfont.h> +#include <tqfontmetrics.h> #include <kpopupmenu.h> #include <kactionclasses.h> #include <kaction.h> -KRecFileWidget::KRecFileWidget( KRecFile* file, QWidget* p, const char* n ) - : QFrame( p,n ) +KRecFileWidget::KRecFileWidget( KRecFile* file, TQWidget* p, const char* n ) + : TQFrame( p,n ) , _file( 0 ) { kdDebug( 60005 ) << k_funcinfo << file << endl; - setFrameStyle( QFrame::Panel|QFrame::Sunken ); + setFrameStyle( TQFrame::Panel|TQFrame::Sunken ); setLineWidth( 1 ); setMinimumHeight( 20 ); @@ -53,7 +53,7 @@ kdDebug( 60005 ) << k_funcinfo << file << endl; if ( _file != file ) { _file = file; //kdDebug( 60005 ) << "Removing widgets" << endl; - QValueList<KRecBufferWidget*>::iterator it = bufferwidgets.begin(); + TQValueList<KRecBufferWidget*>::iterator it = bufferwidgets.begin(); while ( it != bufferwidgets.end() ) { delete ( *it ); ++it; @@ -61,22 +61,22 @@ kdDebug( 60005 ) << k_funcinfo << file << endl; bufferwidgets.clear(); resizeEvent(); if ( _file ) { - for ( QValueList<KRecBuffer*>::iterator it = _file->_buffers.begin(); it != _file->_buffers.end(); ++it ) { + for ( TQValueList<KRecBuffer*>::iterator it = _file->_buffers.begin(); it != _file->_buffers.end(); ++it ) { newBuffer( ( *it ) ); } - connect( _file, SIGNAL( sNewBuffer( KRecBuffer* ) ), this, SLOT( newBuffer( KRecBuffer* ) ) ); - connect( _file, SIGNAL( sDeleteBuffer( KRecBuffer* ) ), this, SLOT( deleteBuffer( KRecBuffer* ) ) ); + connect( _file, TQT_SIGNAL( sNewBuffer( KRecBuffer* ) ), this, TQT_SLOT( newBuffer( KRecBuffer* ) ) ); + connect( _file, TQT_SIGNAL( sDeleteBuffer( KRecBuffer* ) ), this, TQT_SLOT( deleteBuffer( KRecBuffer* ) ) ); //kdDebug( 60005 ) << _file->_currentBuffer << endl; } } } -void KRecFileWidget::resizeEvent( QResizeEvent* /*qre*/ ) { +void KRecFileWidget::resizeEvent( TQResizeEvent* /*qre*/ ) { //kdDebug( 60005 ) << k_funcinfo << endl; if ( _file ) { int w = contentsRect().width(); int h = contentsRect().height(); - QValueList<KRecBufferWidget*>::iterator it; + TQValueList<KRecBufferWidget*>::iterator it; for ( it = bufferwidgets.begin(); it != bufferwidgets.end(); ++it ) { int width, x; if ( !_file->offsetSize()==0 && !( *it )->buffer()->size()==0 ) { @@ -91,21 +91,21 @@ void KRecFileWidget::resizeEvent( QResizeEvent* /*qre*/ ) { } } -void KRecFileWidget::mouseReleaseEvent( QMouseEvent* qme ) { +void KRecFileWidget::mouseReleaseEvent( TQMouseEvent* qme ) { kdDebug( 60005 ) << k_funcinfo << "(" << qme->x() << "|" << qme->y() << ")" << endl; } void KRecFileWidget::newBuffer( KRecBuffer* buffer ) { //kdDebug( 60005 ) << k_funcinfo << buffer << endl; KRecBufferWidget *tmp = new KRecBufferWidget( buffer, this ); - connect( tmp, SIGNAL( popupMenu( KRecBufferWidget*, QPoint ) ), this, SLOT( popupMenu( KRecBufferWidget*, QPoint ) ) ); + connect( tmp, TQT_SIGNAL( popupMenu( KRecBufferWidget*, TQPoint ) ), this, TQT_SLOT( popupMenu( KRecBufferWidget*, TQPoint ) ) ); bufferwidgets.append( tmp ); tmp->show(); resizeEvent(); } void KRecFileWidget::deleteBuffer( KRecBuffer* buffer ) { //kdDebug( 60005 ) << k_funcinfo << buffer << endl; - QValueList<KRecBufferWidget*>::iterator it = bufferwidgets.begin(); + TQValueList<KRecBufferWidget*>::iterator it = bufferwidgets.begin(); KRecBufferWidget* tmp = 0; while ( it != bufferwidgets.end() ) { if ( ( *it )->buffer() == buffer ) tmp = ( *it ); @@ -117,14 +117,14 @@ void KRecFileWidget::deleteBuffer( KRecBuffer* buffer ) { } } -void KRecFileWidget::popupMenu( KRecBufferWidget* bw, QPoint pos ) { +void KRecFileWidget::popupMenu( KRecBufferWidget* bw, TQPoint pos ) { KPopupMenu tmp( this ); KToggleAction* _activeaction = new KToggleAction( i18n( "Toggle Active/Disabled State" ), KShortcut(), this ); _activeaction->setChecked( bw->buffer()->active() ); - connect( _activeaction, SIGNAL( toggled( bool ) ), bw->buffer(), SLOT( setActive( bool ) ) ); - KAction* _removeaction = new KAction( i18n( "Remove This Part" ), "fileremove", KShortcut(), bw->buffer(), SLOT( deleteBuffer() ), this ); - KAction* _changetitle = new KAction( i18n( "Change Title of This Part" ), KShortcut(), bw, SLOT( changeTitle() ), this ); - KAction* _changecomment = new KAction( i18n( "Change Comment of This Part" ), KShortcut(), bw, SLOT( changeComment() ), this ); + connect( _activeaction, TQT_SIGNAL( toggled( bool ) ), bw->buffer(), TQT_SLOT( setActive( bool ) ) ); + KAction* _removeaction = new KAction( i18n( "Remove This Part" ), "fileremove", KShortcut(), bw->buffer(), TQT_SLOT( deleteBuffer() ), this ); + KAction* _changetitle = new KAction( i18n( "Change Title of This Part" ), KShortcut(), bw, TQT_SLOT( changeTitle() ), this ); + KAction* _changecomment = new KAction( i18n( "Change Comment of This Part" ), KShortcut(), bw, TQT_SLOT( changeComment() ), this ); _activeaction->plug( &tmp ); _changetitle->plug( &tmp ); _changecomment->plug( &tmp ); @@ -141,20 +141,20 @@ void KRecFileWidget::popupMenu( KRecBufferWidget* bw, QPoint pos ) { -KRecBufferWidget::KRecBufferWidget( KRecBuffer* buffer, QWidget* p, const char* n ) - : QFrame( p,n ) +KRecBufferWidget::KRecBufferWidget( KRecBuffer* buffer, TQWidget* p, const char* n ) + : TQFrame( p,n ) , _buffer( buffer ) , _main_region( 0 ), _title_region( 0 ), _fileend_region( 0 ) , alreadyreadsize( 0 ) { - connect( _buffer, SIGNAL( somethingChanged() ), this, SLOT( update() ) ); + connect( _buffer, TQT_SIGNAL( somethingChanged() ), this, TQT_SLOT( update() ) ); kdDebug( 60005 ) << k_funcinfo << endl; } KRecBufferWidget::~KRecBufferWidget() { kdDebug( 60005 ) << k_funcinfo << endl; } -void KRecBufferWidget::resizeEvent( QResizeEvent* ) { +void KRecBufferWidget::resizeEvent( TQResizeEvent* ) { //kdDebug( 60005 ) << k_funcinfo << endl; } @@ -164,17 +164,17 @@ void KRecBufferWidget::initLayout() { int _title_width = fontMetrics().boundingRect( _buffer->filename() ).width() + 10; if ( _title_width > width() ) _title_width = width(); if ( _main_region ) delete _main_region; - _main_region = new QRegion( QRect( 0, _title_height, width(), height()-_title_height ) ); + _main_region = new TQRegion( TQRect( 0, _title_height, width(), height()-_title_height ) ); if ( _title_region ) delete _title_region; if ( _buffer->active() ) - _title_region = new QRegion( QRect( 0, 0, _title_width, _title_height ) ); + _title_region = new TQRegion( TQRect( 0, 0, _title_width, _title_height ) ); else - _title_region = new QRegion( QRect( 0, _title_height/2, _title_width, _title_height/2 ) ); + _title_region = new TQRegion( TQRect( 0, _title_height/2, _title_width, _title_height/2 ) ); if ( _fileend_region ) { delete _fileend_region; _fileend_region=0; } if ( _buffer->active() ) - _fileend_region = new QRegion( QRect( width()-4, _title_height/2, 4, _title_height/2 ) ); + _fileend_region = new TQRegion( TQRect( width()-4, _title_height/2, 4, _title_height/2 ) ); else - _fileend_region = new QRegion( QRect( width()-4, _title_height/4*3, 4, _title_height/4 ) ); + _fileend_region = new TQRegion( TQRect( width()-4, _title_height/4*3, 4, _title_height/4 ) ); setMask( _main_region->unite( *_title_region ).unite( *_fileend_region ) ); @@ -183,60 +183,60 @@ void KRecBufferWidget::initLayout() { _bottomright = _main_region->boundingRect().bottomRight(); _topright = _main_region->boundingRect().topRight(); _bottommiddle = _title_region->boundingRect().bottomRight(); - _bottommiddle += QPoint( 0, 1 ); + _bottommiddle += TQPoint( 0, 1 ); _topmiddle = _title_region->boundingRect().topRight(); } -void KRecBufferWidget::drawFrame( QPainter* p ) { +void KRecBufferWidget::drawFrame( TQPainter* p ) { //kdDebug( 60005 ) << k_funcinfo << endl; if ( _buffer->active() ) p->setBrush( colorGroup().highlight() ); else p->setBrush( colorGroup().highlight().dark() ); - p->setPen( QPen( colorGroup().dark(), 1 ) ); + p->setPen( TQPen( colorGroup().dark(), 1 ) ); p->drawRect( _title_region->boundingRect() ); p->drawRect( _fileend_region->boundingRect() ); - p->setBrush( QBrush() ); - p->setPen( QPen( colorGroup().dark(), 1 ) ); + p->setBrush( TQBrush() ); + p->setPen( TQPen( colorGroup().dark(), 1 ) ); p->drawRect( _main_region->boundingRect() ); - p->setPen( QPen( colorGroup().highlightedText() ) ); + p->setPen( TQPen( colorGroup().highlightedText() ) ); p->drawText( _title_region->boundingRect(), Qt::AlignCenter, _buffer->title() ); } -void KRecBufferWidget::drawContents( QPainter* p ) { +void KRecBufferWidget::drawContents( TQPainter* p ) { //kdDebug( 60005 ) << k_funcinfo << endl; initSamples(); int space = ( _main_region->boundingRect().height() - 2 ) / 2; int xoffset = _main_region->boundingRect().top() + space + 1; - p->setPen( QPen( QColor( 0,0,255 ) ) ); + p->setPen( TQPen( TQColor( 0,0,255 ) ) ); for ( uint i=0; i<samples1.count(); i++ ) p->drawPoint( i, int( samples1[ i ]->getMax() * space + xoffset ) ); for ( uint i=0; i<samples1.count(); i++ ) p->drawPoint( i, int( samples1[ i ]->getMin() * space + xoffset ) ); - p->setPen( QPen( QColor( 255,0,0 ) ) ); + p->setPen( TQPen( TQColor( 255,0,0 ) ) ); for ( uint i=0; i<samples1.count(); i++ ) p->drawPoint( i, int( samples1[ i ]->getValue() * space + xoffset ) ); - p->setPen( QPen( QColor( 0,0,0 ) ) ); - QString comment = _buffer->comment(); + p->setPen( TQPen( TQColor( 0,0,0 ) ) ); + TQString comment = _buffer->comment(); if ( comment.isNull() ) comment = i18n( "Lots of Data" ); p->drawText( _main_region->boundingRect(), Qt::AlignCenter, comment ); } -void KRecBufferWidget::paintEvent( QPaintEvent* ) { +void KRecBufferWidget::paintEvent( TQPaintEvent* ) { initLayout(); - QPainter *p = new QPainter( this ); + TQPainter *p = new TQPainter( this ); drawFrame( p ); drawContents( p ); delete p; } -void KRecBufferWidget::mousePressEvent( QMouseEvent* qme ) { +void KRecBufferWidget::mousePressEvent( TQMouseEvent* qme ) { kdDebug( 60005 ) << k_funcinfo << endl; if ( _main_region->contains( qme->pos() ) || _title_region->contains( qme->pos() ) ) if ( qme->button() == Qt::RightButton ) emit popupMenu( this, qme->globalPos() ); } -void KRecBufferWidget::mouseDoubleClickEvent( QMouseEvent* qme ) { +void KRecBufferWidget::mouseDoubleClickEvent( TQMouseEvent* qme ) { if ( _title_region->contains( qme->pos() ) ) _buffer->setActive( !_buffer->active() ); } @@ -301,12 +301,12 @@ void KRecBufferWidget::initSamples() { void KRecBufferWidget::changeTitle() { - QString tmp = KInputDialog::getText( i18n( "New Title" ), i18n( "Enter new part title:" ), _buffer->title() ); + TQString tmp = KInputDialog::getText( i18n( "New Title" ), i18n( "Enter new part title:" ), _buffer->title() ); if ( !tmp.isNull() ) _buffer->setTitle( tmp ); } void KRecBufferWidget::changeComment() { - QString tmp = KInputDialog::getText( i18n( "New Comment" ), i18n( "Enter new part comment:" ), _buffer->comment() ); + TQString tmp = KInputDialog::getText( i18n( "New Comment" ), i18n( "Enter new part comment:" ), _buffer->comment() ); if ( !tmp.isNull() ) _buffer->setComment( tmp ); } |