diff options
Diffstat (limited to 'kalzium/src/spectrumwidget.cpp')
-rw-r--r-- | kalzium/src/spectrumwidget.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/kalzium/src/spectrumwidget.cpp b/kalzium/src/spectrumwidget.cpp index 54f70972..2431b407 100644 --- a/kalzium/src/spectrumwidget.cpp +++ b/kalzium/src/spectrumwidget.cpp @@ -39,7 +39,7 @@ #include <ieeefp.h> #endif -SpectrumWidget::SpectrumWidget( TQWidget *parent, const char* name ) : TQWidget( parent, name ) +SpectrumWidget::SpectrumWidget( TQWidget *tqparent, const char* name ) : TQWidget( tqparent, name ) { startValue = 0; endValue = 0; @@ -57,7 +57,7 @@ SpectrumWidget::SpectrumWidget( TQWidget *parent, const char* name ) : TQWidget( setType( EmissionSpectrum ); setMinimumSize( 400, 230 ); - setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); + tqsetSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); setBackgroundMode( NoBackground ); } @@ -70,8 +70,8 @@ void SpectrumWidget::paintEvent( TQPaintEvent * /*e*/ ) m_pixmap.fill( this, width(), height() ); TQPainter p; - p.begin( &m_pixmap, this ); - p.fillRect( 0, 0, width(), m_realHeight, Qt::black ); + p.tqbegin( &m_pixmap, this ); + p.fillRect( 0, 0, width(), m_realHeight, TQt::black ); paintBands( &p ); @@ -89,7 +89,7 @@ void SpectrumWidget::paintEvent( TQPaintEvent * /*e*/ ) void SpectrumWidget::drawZoomLine( TQPainter* p ) { - p->setPen( Qt::white ); + p->setPen( TQt::white ); p->drawLine( m_LMBPointPress.x(), m_LMBPointPress.y(), m_LMBPointCurrent.x(), m_LMBPointPress.y() ); p->drawLine( m_LMBPointCurrent.x(), m_LMBPointPress.y()+10, m_LMBPointCurrent.x(), m_LMBPointPress.y()-10 ); p->drawLine( m_LMBPointPress.x(), m_LMBPointPress.y()+10, m_LMBPointPress.x(), m_LMBPointPress.y()-10 ); @@ -107,7 +107,7 @@ void SpectrumWidget::paintBands( TQPainter* p ) p->drawLine( x,0,x, m_realHeight ); } - p->setPen( Qt::black ); + p->setPen( TQt::black ); } int i = 0; @@ -131,12 +131,12 @@ void SpectrumWidget::paintBands( TQPainter* p ) p->setPen( linecolor( ( *it ).wavelength ) ); p->drawLine( x,0,x, m_realHeight-1 ); - p->setPen( Qt::black ); + p->setPen( TQt::black ); // p->drawLine( x,m_realHeight,x, m_realHeight ); break; case AbsorptionSpectrum: - p->setPen( Qt::black ); + p->setPen( TQt::black ); p->drawLine( x,0,x, m_realHeight-1 ); break; } @@ -223,7 +223,7 @@ int SpectrumWidget::Adjust( double color, double factor ) if ( color == 0.0 ) return 0; else - return qRound( IntensityMax * pow( color*factor, Gamma ) ); + return tqRound( IntensityMax * pow( color*factor, Gamma ) ); } void SpectrumWidget::drawTickmarks( TQPainter* p ) @@ -249,8 +249,8 @@ void SpectrumWidget::drawTickmarks( TQPainter* p ) i*d < width()-space ) { pos = ( double ) ( i*d )/width(); - p->fillRect( i*d-space, m_realHeight+12, 2*space, 15, Qt::white ); - p->drawText( i*d-space, m_realHeight+12, 2*space, 15, Qt::AlignCenter, KalziumUtils::localizedValue( KalziumUtils::strippedValue( Wavelength( pos ) ), 6 ) ); + p->fillRect( i*d-space, m_realHeight+12, 2*space, 15, TQt::white ); + p->drawText( i*d-space, m_realHeight+12, 2*space, 15, TQt::AlignCenter, KalziumUtils::localizedValue( KalziumUtils::strippedValue( Wavelength( pos ) ), 6 ) ); } } else {//small tickmarks @@ -320,9 +320,9 @@ void SpectrumWidget::mouseMoveEvent( TQMouseEvent *e ) void SpectrumWidget::mousePressEvent( TQMouseEvent *e ) { - if ( e->button() == TQMouseEvent::LeftButton ) + if ( e->button() == Qt::LeftButton ) m_LMBPointPress = e->pos(); - if ( e->button() == TQMouseEvent::RightButton ) + if ( e->button() == Qt::RightButton ) slotZoomOut(); //FIXME //the tooltip is not really working. Better to not have it @@ -376,22 +376,22 @@ void SpectrumWidget::PrepareTooltip( double wavelength ) void SpectrumWidget::drawTooltip( TQPainter *p ) { - p->setPen( Qt::white ); + p->setPen( TQt::white ); TQPoint pt = mapFromGlobal( TQCursor::pos() ); - p->drawText( pt, i18n("Wavelength: %1").arg(m_band.wavelength) ); + p->drawText( pt, i18n("Wavelength: %1").tqarg(m_band.wavelength) ); pt.setY( pt.y() + 15 ); - p->drawText( pt, i18n("Intensity: %1").arg(m_band.intensity) ); + p->drawText( pt, i18n("Intensity: %1").tqarg(m_band.intensity) ); pt.setY( pt.y() + 15 ); - p->drawText( pt, i18n("Energy 1, Energy 2: %1, %2").arg(m_band.energy1).arg( m_band.energy2 )); + p->drawText( pt, i18n("Energy 1, Energy 2: %1, %2").tqarg(m_band.energy1).tqarg( m_band.energy2 )); pt.setY( pt.y() + 15 ); - p->drawText( pt, i18n("Term 1, Term 2: %1, %2").arg(m_band.term1).arg( m_band.term2 )); + p->drawText( pt, i18n("Term 1, Term 2: %1, %2").tqarg(m_band.term1).tqarg( m_band.term2 )); pt.setY( pt.y() + 15 ); - p->drawText( pt, i18n("J 1, J 2: %1, %2").arg(m_band.J1).arg( m_band.J2 )); + p->drawText( pt, i18n("J 1, J 2: %1, %2").tqarg(m_band.J1).tqarg( m_band.J2 )); } void SpectrumWidget::mouseReleaseEvent( TQMouseEvent *e ) { - if ( e->button() == TQMouseEvent::LeftButton ) + if ( e->button() == Qt::LeftButton ) { int left = (int)Wavelength( ( double )m_LMBPointPress.x()/width() ); int right = (int)Wavelength( ( double )e->pos().x()/width() ); @@ -415,12 +415,12 @@ TQPixmap SpectrumWidget::pixmap() TQString text; if( m_type == EmissionSpectrum ) - text = i18n( "Emission spectrum of %1" ).arg( m_spectrum->parentElement()->elname() ); + text = i18n( "Emission spectrum of %1" ).tqarg( m_spectrum->tqparentElement()->elname() ); else - text = i18n( "Absorption spectrum of %1" ).arg( m_spectrum->parentElement()->elname() ); + text = i18n( "Absorption spectrum of %1" ).tqarg( m_spectrum->tqparentElement()->elname() ); TQPainter p( &tmp ); - p.setPen( Qt::black ); + p.setPen( TQt::black ); p.drawText( 30, m_realHeight + 70, text ); return tmp; |