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 /arts/gui/kde/ktickmarks_impl.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 'arts/gui/kde/ktickmarks_impl.cpp')
-rw-r--r-- | arts/gui/kde/ktickmarks_impl.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/arts/gui/kde/ktickmarks_impl.cpp b/arts/gui/kde/ktickmarks_impl.cpp index 4db81ee0..1a95c2a6 100644 --- a/arts/gui/kde/ktickmarks_impl.cpp +++ b/arts/gui/kde/ktickmarks_impl.cpp @@ -21,13 +21,13 @@ #include "ktickmarks_impl.h" #include <kdebug.h> -#include <qpainter.h> -#include <qfont.h> -#include <qfontmetrics.h> +#include <tqpainter.h> +#include <tqfont.h> +#include <tqfontmetrics.h> -KTickmarks_impl::KTickmarks_impl( QFrame* w ) : Arts::KFrame_impl( w ? w : new KTickmarks_Widget( 0 ) ) +KTickmarks_impl::KTickmarks_impl( TQFrame* w ) : Arts::KFrame_impl( w ? w : new KTickmarks_Widget( 0 ) ) { - //kdDebug()<<"KTickmarks_impl::KTickmarks_impl( QFrame* w="<<w<<" )"<<endl; + //kdDebug()<<"KTickmarks_impl::KTickmarks_impl( TQFrame* w="<<w<<" )"<<endl; _tmwidget = static_cast<KTickmarks_Widget*>( _qwidget ); } @@ -50,22 +50,22 @@ void KTickmarks_impl::constructor( float min, float max, Arts::Direction dir, lo this->min( min ); this->max( max ); direction( dir ); position( pos ); } -KTickmarks_Widget::KTickmarks_Widget( KTickmarks_impl* impl, QWidget* p, const char* n ) : QFrame( p,n ), dB2VolCalc( -24, 0 ), _impl( impl ), _pos( Arts::posLeft ), _dir( Arts::BottomToTop ), minstep( 1 ), substep( 0.5 ) { +KTickmarks_Widget::KTickmarks_Widget( KTickmarks_impl* impl, TQWidget* p, const char* n ) : TQFrame( p,n ), dB2VolCalc( -24, 0 ), _impl( impl ), _pos( Arts::posLeft ), _dir( Arts::BottomToTop ), minstep( 1 ), substep( 0.5 ) { setMinimumSize( 20,20 ); } -void KTickmarks_Widget::drawContents( QPainter* p ) { - //kdDebug()<<"KTickmarks::drawContents( QPainter* "<<p<<" )"<<endl; +void KTickmarks_Widget::drawContents( TQPainter* p ) { + //kdDebug()<<"KTickmarks::drawContents( TQPainter* "<<p<<" )"<<endl; bool left=false, right=false; if ( _pos&Arts::posLeft ) left=true; if ( _pos&Arts::posRight ) right=true; // Setting the font - QFont font; + TQFont font; font.setPixelSize( 8 /*font.pixelSize()/2*/ ); // Maybe this could be adjusted... p->setFont( font ); // Determining the size of the largest text (currently the text at the minimum-scale) - QFontMetrics fontmetric( font ); - QRect fontrect = fontmetric.boundingRect( QString::number( dbmin ) ); + TQFontMetrics fontmetric( font ); + TQRect fontrect = fontmetric.boundingRect( TQString::number( dbmin ) ); // Calculating stepsizes float _minstepcount = ( dbmax-dbmin )/minstep; float _minstep = minstep; // this value gets changed @@ -75,8 +75,8 @@ void KTickmarks_Widget::drawContents( QPainter* p ) { int _minsize; // Shorcuts int w,h; - QColor colornormal = colorGroup().foreground(); - QColor colordiff = colorGroup().buttonText(); + TQColor colornormal = colorGroup().foreground(); + TQColor colordiff = colorGroup().buttonText(); if ( _dir == Arts::BottomToTop || _dir == Arts::TopToBottom ) { p->translate( contentsRect().left(), contentsRect().bottom() ); @@ -95,7 +95,7 @@ void KTickmarks_Widget::drawContents( QPainter* p ) { w = contentsRect().width(); // Just a shortcut h=0; // Painting substep marks - p->setPen( QPen( colordiff, 1 ) ); + p->setPen( TQPen( colordiff, 1 ) ); for ( float i=dbmax; i>=dbmin; i-=_substep ) { h = int( -contentsRect().height() * dbtondb( i ) ); if ( _dir==Arts::TopToBottom ) h = 1 - h; @@ -103,7 +103,7 @@ void KTickmarks_Widget::drawContents( QPainter* p ) { if ( right ) p->drawLine( w-3, h, w, h ); } // Painting step marks and texts - p->setPen( QPen( colornormal, 1 ) ); + p->setPen( TQPen( colornormal, 1 ) ); for ( float i=0; i>=dbmin; i-=_minstep ) { h = int( -contentsRect().height() * dbtondb( i ) ); if ( _dir==Arts::TopToBottom ) h = 1 - h; @@ -111,7 +111,7 @@ void KTickmarks_Widget::drawContents( QPainter* p ) { p->drawText( ( w - (left)*6 - (right)*6 - fontrect.width() )/2 + (left)*6 , h-fontrect.height()/2, fontrect.width(), fontrect.height()+2, - Qt::AlignRight|Qt::AlignTop, QString::number( i ) ); + Qt::AlignRight|Qt::AlignTop, TQString::number( i ) ); if ( right ) p->drawLine( w-6, h, w, h ); } for ( float i=_minstep; i<=dbmax; i+=_minstep ) { @@ -121,7 +121,7 @@ void KTickmarks_Widget::drawContents( QPainter* p ) { p->drawText( ( w - (left)*6 - (right)*6 - fontrect.width() )/2 + (left)*6 , h-fontrect.height()/2, fontrect.width(), fontrect.height()+2, - Qt::AlignRight|Qt::AlignTop, QString::number( i ) ); + Qt::AlignRight|Qt::AlignTop, TQString::number( i ) ); if ( right ) p->drawLine( w-6, h, w, h ); } } else { @@ -141,7 +141,7 @@ void KTickmarks_Widget::drawContents( QPainter* p ) { w = 0; // Just a shortcut h = frameWidth() + contentsRect().height(); // Painting substep marks - p->setPen( QPen( colordiff, 1 ) ); + p->setPen( TQPen( colordiff, 1 ) ); for ( float i=dbmax; i>=dbmin; i-=_substep ) { w = this->frameWidth()+ int( contentsRect().width() * dbtondb( i ) ); if ( _dir==Arts::RightToLeft ) w = 1 - w; @@ -149,7 +149,7 @@ void KTickmarks_Widget::drawContents( QPainter* p ) { if ( right ) p->drawLine( w, h-3, w, h ); } // Painting step marks and texts - p->setPen( QPen( colornormal, 1 ) ); + p->setPen( TQPen( colornormal, 1 ) ); for ( float i=0; i>=dbmin; i-=_minstep ) { w = int( contentsRect().width() * dbtondb( i ) ); if ( _dir==Arts::RightToLeft ) w = 1 - w; @@ -157,7 +157,7 @@ void KTickmarks_Widget::drawContents( QPainter* p ) { p->drawText( w - fontrect.width()/2 , ( h - (left)*6 - (right)*6 - fontrect.height() )/2 + (left)*6, fontrect.width(), fontrect.height()+2, - Qt::AlignRight|Qt::AlignTop, QString::number( i ) ); + Qt::AlignRight|Qt::AlignTop, TQString::number( i ) ); if ( right ) p->drawLine( w, h-6, w, h ); } for ( float i=_minstep; i<=dbmax; i+=_minstep ) { @@ -167,7 +167,7 @@ void KTickmarks_Widget::drawContents( QPainter* p ) { p->drawText( w - fontrect.width()/2 , ( h - (left)*6 - (right)*6 - fontrect.height() )/2 + (left)*6, fontrect.width(), fontrect.height()+2, - Qt::AlignRight|Qt::AlignTop, QString::number( i ) ); + Qt::AlignRight|Qt::AlignTop, TQString::number( i ) ); if ( right ) p->drawLine( w, h-6, w, h ); } } |