diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-11 04:44:41 +0000 |
commit | a374efce3a207b39514be3c52264091400ce297e (patch) | |
tree | 77bdf654b55826d4f59b53a5621310206bcaead1 /kalzium/src/element.cpp | |
parent | f81a494f3957d5cf38c787973415597941934727 (diff) | |
download | tdeedu-a374efce3a207b39514be3c52264091400ce297e.tar.gz tdeedu-a374efce3a207b39514be3c52264091400ce297e.zip |
TQt4 port kdeedu
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1236073 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kalzium/src/element.cpp')
-rw-r--r-- | kalzium/src/element.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp index 3fc7e493..687f0ad8 100644 --- a/kalzium/src/element.cpp +++ b/kalzium/src/element.cpp @@ -68,8 +68,8 @@ TQString Element::parsedOrbits( bool canBeEmpty ) TQString orbits = m_orbits; TQRegExp rxs("([a-z])([0-9]+)"); TQRegExp rxb("([a-z]{2}) ",false); - orbits.replace(rxs,"\\1<sup>\\2</sup>"); //superscript around electron number - orbits.replace(rxb,"<b>\\1</b> "); //bold around element symbols + orbits.tqreplace(rxs,"\\1<sup>\\2</sup>"); //superscript around electron number + orbits.tqreplace(rxb,"<b>\\1</b> "); //bold around element symbols return orbits; } @@ -106,7 +106,7 @@ const TQString Element::adjustRadius( RADIUSTYPE rtype ) if ( val <= 0 ) v = i18n( "Value unknown" ); else - v = i18n( "%1 is a length, eg: 12.3 pm", "%1 pm" ).arg( KalziumUtils::localizedValue( val, 6 ) ); + v = i18n( "%1 is a length, eg: 12.3 pm", "%1 pm" ).tqarg( KalziumUtils::localizedValue( val, 6 ) ); return v; } @@ -132,7 +132,7 @@ const TQString Element::adjustUnits( const int type, double value ) const TQString Element::adjustUnits( const int type ) { - TQString v = TQString::null; + TQString v = TQString(); double val = 0.0; //the value to convert @@ -151,19 +151,19 @@ const TQString Element::adjustUnits( const int type ) TQString strVal = KalziumUtils::localizedValue( newvalue, 6 ); switch (Prefs::temperature()) { case 0: //Kelvin - v = i18n( "%1 is the temperature in Kelvin", "%1 K" ).arg( strVal ); + v = i18n( "%1 is the temperature in Kelvin", "%1 K" ).tqarg( strVal ); break; case 1://Kelvin to Celsius - v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).arg( strVal ).arg( TQChar(0xB0) ); + v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).tqarg( strVal ).tqarg( TQChar(0xB0) ); break; case 2: // Kelvin to Fahrenheit - v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" ).arg( strVal ).arg( TQChar(0xB0) ); + v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" ).tqarg( strVal ).tqarg( TQChar(0xB0) ); break; case 3: // Kelvin to Rankine - v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).arg( strVal ).arg( TQChar(0xB0) ); + v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).tqarg( strVal ).tqarg( TQChar(0xB0) ); break; case 4: // Kelvin to Reaumur - v = i18n( "%1 is the temperature in Reaumur", "%1 %2R" ).arg( strVal ).arg( TQChar(0xB0) ); + v = i18n( "%1 is the temperature in Reaumur", "%1 %2R" ).tqarg( strVal ).tqarg( TQChar(0xB0) ); break; } } @@ -186,12 +186,12 @@ const TQString Element::adjustUnits( const int type ) { if ( Prefs::energies() == 0 ) { - v = i18n( "%1 kJ/mol" ).arg( KalziumUtils::localizedValue( val, 6 ) ); + v = i18n( "%1 kJ/mol" ).tqarg( KalziumUtils::localizedValue( val, 6 ) ); } else // use electronvolt { val/=96.6; - v = i18n( "%1 eV" ).arg( KalziumUtils::localizedValue( val, 6 ) ); + v = i18n( "%1 eV" ).tqarg( KalziumUtils::localizedValue( val, 6 ) ); } } } @@ -201,7 +201,7 @@ const TQString Element::adjustUnits( const int type ) if ( val <= 0 ) v = i18n( "Value unknown" ); else - v = i18n( "%1 u" ).arg( KalziumUtils::localizedValue( val, 6 ) ); + v = i18n( "%1 u" ).tqarg( KalziumUtils::localizedValue( val, 6 ) ); } else if ( type == DENSITY ) // its a density { @@ -213,11 +213,11 @@ const TQString Element::adjustUnits( const int type ) { if ( boiling() < 295.0 && melting() < 295.0)//gasoline { - v = i18n( "%1 g/L" ).arg( KalziumUtils::localizedValue( val, 6 ) ); + v = i18n( "%1 g/L" ).tqarg( KalziumUtils::localizedValue( val, 6 ) ); } else//liquid or solid { - v = i18n( "%1 g/cm<sup>3</sup>" ).arg( KalziumUtils::localizedValue( val, 6 )); + v = i18n( "%1 g/cm<sup>3</sup>" ).tqarg( KalziumUtils::localizedValue( val, 6 )); } } } @@ -230,7 +230,7 @@ const TQString Element::adjustUnits( const int type ) } else { - v = i18n( "This element was discovered in the year %1" ).arg( TQString::number( val ) ); + v = i18n( "This element was discovered in the year %1" ).tqarg( TQString::number( val ) ); } } @@ -263,18 +263,18 @@ void Element::drawStateOfMatter( TQPainter* p, double temp ) p->setFont( f ); //top left - p->setPen( Qt::black ); + p->setPen( TQt::black ); text = KalziumUtils::localizedValue( KalziumUtils::strippedValue( mass( ) ), 6 ); - p->drawText( X,Y ,ELEMENTSIZE,h_small,Qt::AlignCenter, text ); + p->drawText( X,Y ,ELEMENTSIZE,h_small,TQt::AlignCenter, text ); text = TQString::number( number() ); - p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,Qt::AlignCenter, text ); + p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,TQt::AlignCenter, text ); p->setFont( symbol_font ); - p->drawText( X,Y, ELEMENTSIZE,ELEMENTSIZE,Qt::AlignCenter, symbol() ); + p->drawText( X,Y, ELEMENTSIZE,ELEMENTSIZE,TQt::AlignCenter, symbol() ); //border - p->setPen( Qt::black ); + p->setPen( TQt::black ); p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); } @@ -289,7 +289,7 @@ TQColor Element::currentColor( const double temp ) //If either the mp or bp is not known return //This is to avoid undefined behaviour // if ( iButton_boiling <= 0.0 || iButton_melting <= 0.0 ) -// return Qt::lightGray; +// return TQt::lightGray; if ( temp < iButton_melting ) { //the element is solid @@ -305,7 +305,7 @@ TQColor Element::currentColor( const double temp ) color= Prefs::color_vapor(); } else - color = Qt::lightGray; + color = TQt::lightGray; return color; } @@ -329,23 +329,23 @@ void Element::drawGradient( TQPainter* p, const TQString& value, const TQColor& p->setPen( c ); p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, c ); - p->setPen( Qt::black ); + p->setPen( TQt::black ); TQFont symbol_font = p->font(); TQFont f = p->font(); f.setPointSize( KalziumUtils::maxSize(value, TQRect( X,Y+ELEMENTSIZE-h_small, ELEMENTSIZE, h_small ),f, p ) ); p->setFont( f ); - p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,Qt::AlignCenter, value ); + p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,TQt::AlignCenter, value ); const TQRect rect = TQRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 ); int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p ); symbol_font.setPointSize( goodsize ); p->setFont( symbol_font ); - p->drawText( X+1,Y+5, ELEMENTSIZE-2,ELEMENTSIZE-10,Qt::AlignCenter, symbol() ); + p->drawText( X+1,Y+5, ELEMENTSIZE-2,ELEMENTSIZE-10,TQt::AlignCenter, symbol() ); //border - p->setPen( Qt::black ); + p->setPen( TQt::black ); p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); } @@ -357,18 +357,18 @@ void Element::drawGrayedOut( TQPainter *p ) //The Y-coordinate int Y = yPos(); - p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, Qt::lightGray ); + p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, TQt::lightGray ); - p->setPen( Qt::darkGray ); + p->setPen( TQt::darkGray ); TQFont symbol_font = p->font(); const TQRect rect = TQRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 ); int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p ); symbol_font.setPointSize( goodsize ); p->setFont( symbol_font ); - p->drawText( X+1,Y+5, ELEMENTSIZE-2,ELEMENTSIZE-10,Qt::AlignCenter, symbol() ); + p->drawText( X+1,Y+5, ELEMENTSIZE-2,ELEMENTSIZE-10,TQt::AlignCenter, symbol() ); - p->setPen( Qt::black ); + p->setPen( TQt::black ); p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); } @@ -385,7 +385,7 @@ void Element::drawSelf( TQPainter* p, bool simple, bool isCrystal ) p->setPen( elementColor() ); p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, elementColor() ); - p->setPen( Qt::black ); + p->setPen( TQt::black ); TQString text; TQFont symbol_font = p->font(); @@ -399,9 +399,9 @@ void Element::drawSelf( TQPainter* p, bool simple, bool isCrystal ) p->setFont( symbol_font ); if ( !simple ) - p->drawText( X+1,Y+5, ELEMENTSIZE-2,max,Qt::AlignCenter, symbol() ); + p->drawText( X+1,Y+5, ELEMENTSIZE-2,max,TQt::AlignCenter, symbol() ); else - p->drawText( X+1,Y+5, ELEMENTSIZE-2,max,Qt::AlignHCenter, symbol() ); + p->drawText( X+1,Y+5, ELEMENTSIZE-2,max,TQt::AlignHCenter, symbol() ); TQFont f = p->font(); @@ -441,11 +441,11 @@ void Element::drawSelf( TQPainter* p, bool simple, bool isCrystal ) } else text = KalziumUtils::localizedValue( KalziumUtils::strippedValue( mass( ) ), 6 ); - p->drawText( X+2,Y ,ELEMENTSIZE-4 ,h_small,Qt::AlignCenter, text ); + p->drawText( X+2,Y ,ELEMENTSIZE-4 ,h_small,TQt::AlignCenter, text ); } text = TQString::number( number() ); - p->drawText( X+2,Y+ELEMENTSIZE-h_small , ELEMENTSIZE-4, h_small,Qt::AlignCenter, text ); + p->drawText( X+2,Y+ELEMENTSIZE-h_small , ELEMENTSIZE-4, h_small,TQt::AlignCenter, text ); p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); } |