diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:39:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:39:55 +0000 |
commit | 0a6e0958c03e41c87b15557b6f407874f20c2f8d (patch) | |
tree | 2cdd58c4013b1be09cfcbb4ddae2b05712b9aeee /kalzium | |
parent | 83f9dfafc157ff7823804b3ff457b43d021a5b4b (diff) | |
download | tdeedu-0a6e0958c03e41c87b15557b6f407874f20c2f8d.tar.gz tdeedu-0a6e0958c03e41c87b15557b6f407874f20c2f8d.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1157642 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kalzium')
48 files changed, 874 insertions, 874 deletions
diff --git a/kalzium/src/detailedgraphicaloverview.cpp b/kalzium/src/detailedgraphicaloverview.cpp index 56c086ff..d31e2579 100644 --- a/kalzium/src/detailedgraphicaloverview.cpp +++ b/kalzium/src/detailedgraphicaloverview.cpp @@ -23,19 +23,19 @@ email : cniehaus@kde.org #include <kglobal.h> //QT-Includes -#include <qpainter.h> -#include <qstring.h> -#include <qpixmap.h> -#include <qrect.h> +#include <tqpainter.h> +#include <tqstring.h> +#include <tqpixmap.h> +#include <tqrect.h> -DetailedGraphicalOverview::DetailedGraphicalOverview( Element *el, QWidget *parent, const char *name ) -: QWidget( parent, name ) +DetailedGraphicalOverview::DetailedGraphicalOverview( Element *el, TQWidget *parent, const char *name ) +: TQWidget( parent, name ) { init( el ); } -DetailedGraphicalOverview::DetailedGraphicalOverview( QWidget *parent, const char *name ) -: QWidget( parent, name ) +DetailedGraphicalOverview::DetailedGraphicalOverview( TQWidget *parent, const char *name ) +: TQWidget( parent, name ) { init( 0L ); } @@ -49,14 +49,14 @@ void DetailedGraphicalOverview::init( Element *el ) update(); } -void DetailedGraphicalOverview::paintEvent( QPaintEvent* ) +void DetailedGraphicalOverview::paintEvent( TQPaintEvent* ) { int h = height(); int w = width(); - QPixmap pm( w, h ); + TQPixmap pm( w, h ); - QPainter p; + TQPainter p; p.begin( &pm ); p.setBrush(Qt::SolidPattern); @@ -83,26 +83,26 @@ void DetailedGraphicalOverview::paintEvent( QPaintEvent* ) p.setBrush( Qt::black ); p.setBrush(Qt::NoBrush); - QFont fA = KGlobalSettings::generalFont(); - QFont fB = KGlobalSettings::generalFont(); - QFont fC = KGlobalSettings::generalFont(); + TQFont fA = KGlobalSettings::generalFont(); + TQFont fB = KGlobalSettings::generalFont(); + TQFont fC = KGlobalSettings::generalFont(); - QString strLocalizedMass = KalziumUtils::localizedValue( m_element->mass(), 6 ); + TQString strLocalizedMass = KalziumUtils::localizedValue( m_element->mass(), 6 ); fA.setPointSize( fA.pointSize() + 20 ); //Huge font fA.setBold( true ); fB.setPointSize( fB.pointSize() + 6 ); //Big font fC.setPointSize( fC.pointSize() + 4 ); //Big font fC.setBold( true ); - QFontMetrics fmA = QFontMetrics( fA ); - QFontMetrics fmB = QFontMetrics( fB ); + TQFontMetrics fmA = TQFontMetrics( fA ); + TQFontMetrics fmB = TQFontMetrics( fB ); //coordinates for element symbol: near the center int xA = 4 * w / 10; int yA = h / 2; //coordinates for the atomic number: offset from element symbol to the upper left - int xB = xA - fmB.width( QString::number( m_element->number() ) ); + int xB = xA - fmB.width( TQString::number( m_element->number() ) ); int yB = yA - fmA.height() + fmB.height(); //Element Symbol @@ -111,9 +111,9 @@ void DetailedGraphicalOverview::paintEvent( QPaintEvent* ) //Atomic number p.setFont( fB ); - p.drawText( xB, yB, QString::number( m_element->number() )); + p.drawText( xB, yB, TQString::number( m_element->number() )); - QRect rect( 0, 20, w/2, h ); + TQRect rect( 0, 20, w/2, h ); p.setFont( fC ); @@ -150,7 +150,7 @@ void DetailedGraphicalOverview::paintEvent( QPaintEvent* ) bitBlt( this, 0, 0, &pm ); } -void DetailedGraphicalOverview::drawBiologicalSymbol( QPainter *p ) +void DetailedGraphicalOverview::drawBiologicalSymbol( TQPainter *p ) { if ( !m_element ) return; const int db = h_t; //diameter of the big circle @@ -167,7 +167,7 @@ void DetailedGraphicalOverview::drawBiologicalSymbol( QPainter *p ) p->setBrush( Qt::SolidPattern ); p->setBrush( Qt::white ); p->setPen( Qt::black ); - p->drawRoundRect( QRect( width() - radius, + p->drawRoundRect( TQRect( width() - radius, -radius, 2 * radius, 2 * radius ), 70, 70 ); diff --git a/kalzium/src/detailedgraphicaloverview.h b/kalzium/src/detailedgraphicaloverview.h index 2f095be7..6fb649dc 100644 --- a/kalzium/src/detailedgraphicaloverview.h +++ b/kalzium/src/detailedgraphicaloverview.h @@ -15,7 +15,7 @@ * * ***************************************************************************/ -#include <qwidget.h> +#include <tqwidget.h> class Element; @@ -30,8 +30,8 @@ class DetailedGraphicalOverview : public QWidget Q_OBJECT public: - DetailedGraphicalOverview( Element *el, QWidget *parent, const char *name=0 ); - DetailedGraphicalOverview( QWidget *parent, const char *name=0 ); + DetailedGraphicalOverview( Element *el, TQWidget *parent, const char *name=0 ); + DetailedGraphicalOverview( TQWidget *parent, const char *name=0 ); /** * sets the elements whose data will be used to @p el @@ -45,7 +45,7 @@ class DetailedGraphicalOverview : public QWidget * draw the small symbol which symbolises the * relevence for humans */ - void drawBiologicalSymbol( QPainter *p ); + void drawBiologicalSymbol( TQPainter *p ); //calculation of the corners int x1,x2,y1,y2,h_t; @@ -57,7 +57,7 @@ class DetailedGraphicalOverview : public QWidget Element *m_element; protected: - virtual void paintEvent( QPaintEvent* ); + virtual void paintEvent( TQPaintEvent* ); /** * initialization method diff --git a/kalzium/src/detailinfodlg.cpp b/kalzium/src/detailinfodlg.cpp index c099ccd8..c4fc8899 100644 --- a/kalzium/src/detailinfodlg.cpp +++ b/kalzium/src/detailinfodlg.cpp @@ -28,13 +28,13 @@ #include <kcombobox.h> #include <kapplication.h> -#include <qfile.h> -#include <qlabel.h> -#include <qimage.h> -#include <qwhatsthis.h> -#include <qlayout.h> -#include <qpushbutton.h> -#include <qwidgetstack.h> +#include <tqfile.h> +#include <tqlabel.h> +#include <tqimage.h> +#include <tqwhatsthis.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqwidgetstack.h> #include "element.h" #include "orbitswidget.h" @@ -44,7 +44,7 @@ //TODO add bondxx-radius (H-H-distance for example) -DetailedInfoDlg::DetailedInfoDlg( Element *el , QWidget *parent, const char *name) +DetailedInfoDlg::DetailedInfoDlg( Element *el , TQWidget *parent, const char *name) : KDialogBase( IconList, name, Help|User1|User2|Close, Close, parent, name, false, //non modal false, @@ -66,7 +66,7 @@ DetailedInfoDlg::DetailedInfoDlg( Element *el , QWidget *parent, const char *nam createContent(); m_actionCollection = new KActionCollection(this); - KStdAction::quit(this, SLOT(slotClose()), m_actionCollection); + KStdAction::quit(this, TQT_SLOT(slotClose()), m_actionCollection); setButtonTip( User2, i18n( "Goes to the previous element" ) ); setButtonTip( User1, i18n( "Goes to the next element" ) ); @@ -91,10 +91,10 @@ void DetailedInfoDlg::setElement(Element *element) enableButton( User1, false ); } -KHTMLPart* DetailedInfoDlg::addHTMLTab( const QString& title, const QString& icontext, const QString& iconname ) +KHTMLPart* DetailedInfoDlg::addHTMLTab( const TQString& title, const TQString& icontext, const TQString& iconname ) { - QFrame *frame = addPage(title, icontext, BarIcon(iconname)); - QVBoxLayout *layout = new QVBoxLayout( frame ); + TQFrame *frame = addPage(title, icontext, BarIcon(iconname)); + TQVBoxLayout *layout = new TQVBoxLayout( frame ); layout->setMargin( 0 ); KHTMLPart *w = new KHTMLPart( frame, "html-part", frame ); layout->addWidget( w->view() ); @@ -102,7 +102,7 @@ KHTMLPart* DetailedInfoDlg::addHTMLTab( const QString& title, const QString& ico return w; } -void DetailedInfoDlg::fillHTMLTab( KHTMLPart* htmlpart, const QString& htmlcode ) +void DetailedInfoDlg::fillHTMLTab( KHTMLPart* htmlpart, const TQString& htmlcode ) { if ( !htmlpart ) return; @@ -111,13 +111,13 @@ void DetailedInfoDlg::fillHTMLTab( KHTMLPart* htmlpart, const QString& htmlcode htmlpart->end(); } -QString DetailedInfoDlg::getHtml(DATATYPE type) +TQString DetailedInfoDlg::getHtml(DATATYPE type) { - QString html = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head><title>Chemical data</title><link rel=\"stylesheet\" type=\"text/css\" href=\""; + TQString html = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head><title>Chemical data</title><link rel=\"stylesheet\" type=\"text/css\" href=\""; html += m_baseHtml + "\" /><base href=\"" + m_baseHtml + "\"/></head><body><div class=\"chemdata\">"; //get the list of ionisation-energies - QValueList<double> ionlist = m_element->ionisationList(); + TQValueList<double> ionlist = m_element->ionisationList(); html.append( "<div><table summary=\"header\"><tr><td>" ); html.append( m_element->symbol() ); @@ -221,7 +221,7 @@ QString DetailedInfoDlg::getHtml(DATATYPE type) { html.append( "<tr><td><img src=\"ionisation.png\" alt=\"icon\"/></td><td>" ); html.append( i18n("the first variable is a number. The result is for example '1.' or '5.', the second is the value of the ionisation energy", - "%1. Ionization energy: %2" ).arg( QString::number( i+1 ), m_element->adjustUnits( Element::IE, ionlist[i] ) ) ); + "%1. Ionization energy: %2" ).arg( TQString::number( i+1 ), m_element->adjustUnits( Element::IE, ionlist[i] ) ) ); html.append( "</td></tr>" ); } break; @@ -233,11 +233,11 @@ QString DetailedInfoDlg::getHtml(DATATYPE type) return html; } -QString DetailedInfoDlg::isotopeTable() +TQString DetailedInfoDlg::isotopeTable() { - QValueList<Isotope*> list = m_element->isotopes(); + TQValueList<Isotope*> list = m_element->isotopes(); - QString html; + TQString html; html = "<table class=\"isotopes\" cellspacing=\"0\"><tr><td colspan=\"7\">"; html += i18n( "Isotope-Table" ); @@ -257,17 +257,17 @@ QString DetailedInfoDlg::isotopeTable() html += i18n( "Magnetic Moment" ); html += "</b></td></tr>"; - QValueList<Isotope*>::const_iterator it = list.begin(); - const QValueList<Isotope*>::const_iterator itEnd = list.end(); + TQValueList<Isotope*>::const_iterator it = list.begin(); + const TQValueList<Isotope*>::const_iterator itEnd = list.end(); for ( ; it != itEnd; ++it ) { html.append( "<tr><td align=\"right\">" ); if ( ( *it )->weight() > 0.0 ) html.append( i18n( "%1 u" ).arg( KalziumUtils::localizedValue( ( *it )->weight(), 6 ) ) ); - // html.append( i18n( "%1 u" ).arg( QString::number( ( *it )->weight() ) )); + // html.append( i18n( "%1 u" ).arg( TQString::number( ( *it )->weight() ) )); html.append( "</td><td>" ); - html.append( QString::number( ( *it )->neutrons() ) ); + html.append( TQString::number( ( *it )->neutrons() ) ); html.append( "</td><td>" ); if ( ( *it )->percentage() > 0.0 ) html.append( i18n( "this can for example be '24%'", "%1%" ).arg( KalziumUtils::localizedValue( ( *it )->percentage(), 6 ) ) ); @@ -279,7 +279,7 @@ QString DetailedInfoDlg::isotopeTable() if ( ( *it )->alphapercentage() > 0.0 ){ if ( ( *it )->alphadecay() > 0.0 ) html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it )->alphadecay(), 6 ) ) ); - html.append( i18n( " %1" ).arg( QChar( 945 ) ) ); + html.append( i18n( " %1" ).arg( TQChar( 945 ) ) ); if ( ( *it )->alphapercentage() < 100.0) html.append( i18n( "(%1%)" ).arg( KalziumUtils::localizedValue( (*it )->alphapercentage(), 6 ) ) ); if ( ( *it )->betaminuspercentage() > 0.0 || ( *it )->betapluspercentage() > 0.0 || ( *it )->ecpercentage() > 0.0) @@ -288,7 +288,7 @@ QString DetailedInfoDlg::isotopeTable() if ( ( *it )->betaminuspercentage() > 0.0 ){ if ( ( *it )->betaminusdecay() > 0.0 ) html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it )->betaminusdecay(), 6 ) ) ); - html.append( i18n( " %1<sup>-</sup>" ).arg( QChar( 946 ) ) ); + html.append( i18n( " %1<sup>-</sup>" ).arg( TQChar( 946 ) ) ); if ( ( *it )->betaminuspercentage() < 100.0) html.append( i18n( "(%1%)" ).arg( KalziumUtils::localizedValue( ( *it )->betaminuspercentage(), 6 ) )); if ( ( *it )->betapluspercentage() > 0.0 || ( *it )->ecpercentage() > 0.0 ) @@ -297,7 +297,7 @@ QString DetailedInfoDlg::isotopeTable() if ( ( *it )->betapluspercentage() > 0.0 ){ if ( ( *it )->betaplusdecay() > 0.0 ) html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it )->betaplusdecay(), 6 ) ) ); - html.append( i18n( " %1<sup>+</sup>" ).arg(QChar( 946 ) ) ); + html.append( i18n( " %1<sup>+</sup>" ).arg(TQChar( 946 ) ) ); if ( ( *it )->betapluspercentage() == ( *it )->ecpercentage() ) { if ( ( *it )->ecdecay() > 0.0 ) { html.append( i18n( "%1 MeV" ).arg( KalziumUtils::localizedValue( ( *it )->ecdecay(), 6 ) ) ); @@ -319,8 +319,8 @@ QString DetailedInfoDlg::isotopeTable() html.append( ( *it )->spin() ); html.append( "</td><td>" ); if ( !( *it )->magmoment().isEmpty() ) { - QString v = KGlobal::locale()->formatNumber( ( *it )->magmoment(), false, 6 ); - html.append( i18n( "%1 %2<sub>n</sub>" ).arg( v ).arg( QChar( 956 ) ) ); + TQString v = KGlobal::locale()->formatNumber( ( *it )->magmoment(), false, 6 ); + html.append( i18n( "%1 %2<sub>n</sub>" ).arg( v ).arg( TQChar( 956 ) ) ); } html.append( "</td></tr>" ); @@ -334,23 +334,23 @@ QString DetailedInfoDlg::isotopeTable() void DetailedInfoDlg::createContent( ) { // overview tab - QFrame *m_pOverviewTab = addPage( i18n( "Overview" ), i18n( "Overview" ), BarIcon( "overview" ) ); - QVBoxLayout *overviewLayout = new QVBoxLayout( m_pOverviewTab ); + TQFrame *m_pOverviewTab = addPage( i18n( "Overview" ), i18n( "Overview" ), BarIcon( "overview" ) ); + TQVBoxLayout *overviewLayout = new TQVBoxLayout( m_pOverviewTab ); overviewLayout->setMargin( 0 ); dTab = new DetailedGraphicalOverview( m_pOverviewTab, "DetailedGraphicalOverview" ); overviewLayout->addWidget( dTab ); // picture tab - QFrame *m_pPictureTab = addPage( i18n( "Picture" ), i18n( "What does this element look like?" ), BarIcon( "elempic" ) ); - QVBoxLayout *mainLayout = new QVBoxLayout( m_pPictureTab ); + TQFrame *m_pPictureTab = addPage( i18n( "Picture" ), i18n( "What does this element look like?" ), BarIcon( "elempic" ) ); + TQVBoxLayout *mainLayout = new TQVBoxLayout( m_pPictureTab ); mainLayout->setMargin( 0 ); - piclabel = new QLabel( m_pPictureTab ); + piclabel = new TQLabel( m_pPictureTab ); piclabel->setMinimumSize( 400, 350 ); mainLayout->addWidget( piclabel ); // atomic model tab - QFrame *m_pModelTab = addPage( i18n( "Atom Model" ), i18n( "Atom Model" ), BarIcon( "orbits" ) ); - QVBoxLayout *modelLayout = new QVBoxLayout( m_pModelTab ); + TQFrame *m_pModelTab = addPage( i18n( "Atom Model" ), i18n( "Atom Model" ), BarIcon( "orbits" ) ); + TQVBoxLayout *modelLayout = new TQVBoxLayout( m_pModelTab ); modelLayout->setMargin( 0 ); wOrbits = new OrbitsWidget( m_pModelTab ); modelLayout->addWidget( wOrbits ); @@ -361,22 +361,22 @@ void DetailedInfoDlg::createContent( ) m_htmlpages["misc"] = addHTMLTab( i18n( "Miscellaneous" ), i18n( "Miscellaneous" ), "misc" ); // spectrum widget tab - QFrame *m_pSpectrumTab = addPage( i18n("Spectrum"), i18n( "Spectrum" ), BarIcon( "spectrum" )); - QVBoxLayout *spectrumLayout = new QVBoxLayout( m_pSpectrumTab , 0, KDialog::spacingHint() ); + TQFrame *m_pSpectrumTab = addPage( i18n("Spectrum"), i18n( "Spectrum" ), BarIcon( "spectrum" )); + TQVBoxLayout *spectrumLayout = new TQVBoxLayout( m_pSpectrumTab , 0, KDialog::spacingHint() ); spectrumLayout->setMargin( 0 ); - m_spectrumStack = new QWidgetStack( m_pSpectrumTab ); + m_spectrumStack = new TQWidgetStack( m_pSpectrumTab ); spectrumLayout->addWidget( m_spectrumStack ); m_spectrumview = new SpectrumViewImpl( m_spectrumStack, "spectrumwidget" ); m_spectrumStack->addWidget( m_spectrumview ); - m_spectrumLabel = new QLabel( m_spectrumStack ); + m_spectrumLabel = new TQLabel( m_spectrumStack ); m_spectrumStack->addWidget( m_spectrumLabel ); } void DetailedInfoDlg::reloadContent() { // reading the most common data - const QString element_name = m_element->elname(); - const QString element_symbol = m_element->symbol(); + const TQString element_name = m_element->elname(); + const TQString element_symbol = m_element->symbol(); // updating caption setCaption( i18n( "For example Carbon (6)" , "%1 (%2)" ).arg( element_name ).arg( m_elementNumber ) ); @@ -385,12 +385,12 @@ void DetailedInfoDlg::reloadContent() dTab->setElement( m_element ); // updating picture tab - QString picpath = m_picsdir + element_symbol + ".jpg"; - if ( QFile::exists( picpath ) ) + TQString picpath = m_picsdir + element_symbol + ".jpg"; + if ( TQFile::exists( picpath ) ) { - QImage img( picpath, "JPEG" ); - img = img.smoothScale ( 400, 400, QImage::ScaleMin ); - QPixmap pic; + TQImage img( picpath, "JPEG" ); + img = img.smoothScale ( 400, 400, TQImage::ScaleMin ); + TQPixmap pic; pic.convertFromImage( img ); piclabel->setPixmap( pic ); } @@ -399,7 +399,7 @@ void DetailedInfoDlg::reloadContent() // updating atomic model tab wOrbits->setElementNumber( m_elementNumber ); - QWhatsThis::add( wOrbits, + TQWhatsThis::add( wOrbits, i18n( "Here you can see the atomic hull of %1. %2 has the configuration %3." ) .arg( m_element->elname() ) .arg( m_element->elname() ) @@ -431,7 +431,7 @@ void DetailedInfoDlg::slotHelp() { emit helpClicked(); - QString chapter = "infodialog_overview"; + TQString chapter = "infodialog_overview"; switch ( activePageIndex() ){ case 0: chapter = "infodialog_overview"; @@ -460,7 +460,7 @@ void DetailedInfoDlg::slotHelp() kapp->invokeHelp ( chapter, "kalzium" ); } -void DetailedInfoDlg::wheelEvent( QWheelEvent *ev ) +void DetailedInfoDlg::wheelEvent( TQWheelEvent *ev ) { if ( ev->delta() < 0 ) // setting the previous element diff --git a/kalzium/src/detailinfodlg.h b/kalzium/src/detailinfodlg.h index d5dacc29..f633459d 100644 --- a/kalzium/src/detailinfodlg.h +++ b/kalzium/src/detailinfodlg.h @@ -18,7 +18,7 @@ #include <kdialogbase.h> -#include <qmap.h> +#include <tqmap.h> class DetailedGraphicalOverview; class Element; @@ -41,7 +41,7 @@ class DetailedInfoDlg : public KDialogBase Q_OBJECT public: - DetailedInfoDlg( Element *el , QWidget *parent=0, const char *name=0); + DetailedInfoDlg( Element *el , TQWidget *parent=0, const char *name=0); void setElement(Element *el); @@ -60,14 +60,14 @@ class DetailedInfoDlg : public KDialogBase SpectrumViewImpl *m_spectrumview; - QString isotopeTable(); + TQString isotopeTable(); - QMap<QString, KHTMLPart*> m_htmlpages; + TQMap<TQString, KHTMLPart*> m_htmlpages; - QLabel *piclabel; + TQLabel *piclabel; - QWidgetStack* m_spectrumStack; - QLabel* m_spectrumLabel; + TQWidgetStack* m_spectrumStack; + TQLabel* m_spectrumLabel; DetailedGraphicalOverview *dTab; @@ -80,10 +80,10 @@ class DetailedInfoDlg : public KDialogBase void createContent(); void reloadContent(); - QString getHtml(DATATYPE); + TQString getHtml(DATATYPE); - QString m_baseHtml; - QString m_picsdir; + TQString m_baseHtml; + TQString m_picsdir; /** * Add a new HTML page to the dialog. @@ -95,14 +95,14 @@ class DetailedInfoDlg : public KDialogBase * @returns the pointer to the resulting KHTMLPart, needed for * writing HTML code on it */ - KHTMLPart* addHTMLTab( const QString& title, const QString& icontext, const QString& iconname ); + KHTMLPart* addHTMLTab( const TQString& title, const TQString& icontext, const TQString& iconname ); /** * Change the HTML code in an HTML page. * * @param htmlpart the KHTMLPart to edit * @param htmlcode the HTML code to display */ - void fillHTMLTab( KHTMLPart* htmlpart, const QString& htmlcode ); + void fillHTMLTab( KHTMLPart* htmlpart, const TQString& htmlcode ); protected slots: virtual void slotUser1(); @@ -113,7 +113,7 @@ class DetailedInfoDlg : public KDialogBase virtual void slotHelp(); protected: - virtual void wheelEvent ( QWheelEvent * ev ); + virtual void wheelEvent ( TQWheelEvent * ev ); signals: void elementChanged( int ); diff --git a/kalzium/src/element.cpp b/kalzium/src/element.cpp index a909a5ac..3fc7e493 100644 --- a/kalzium/src/element.cpp +++ b/kalzium/src/element.cpp @@ -26,11 +26,11 @@ #include "kalziumutils.h" #include "tempunit.h" -#include <qdom.h> -#include <qfile.h> -#include <qpainter.h> -#include <qregexp.h> -#include <qfontmetrics.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqpainter.h> +#include <tqregexp.h> +#include <tqfontmetrics.h> #include <kdebug.h> #include <klocale.h> @@ -46,8 +46,8 @@ Element::Element() Isotope* Element::isotopeByNucleons( int numberOfNucleons ) { - QValueList<Isotope*>::ConstIterator it = m_isotopeList.begin(); - const QValueList<Isotope*>::ConstIterator itEnd = m_isotopeList.end(); + TQValueList<Isotope*>::ConstIterator it = m_isotopeList.begin(); + const TQValueList<Isotope*>::ConstIterator itEnd = m_isotopeList.end(); for ( ; it != itEnd; ++it ) { @@ -57,7 +57,7 @@ Isotope* Element::isotopeByNucleons( int numberOfNucleons ) return 0; } -QString Element::parsedOrbits( bool canBeEmpty ) +TQString Element::parsedOrbits( bool canBeEmpty ) { if ( m_orbits.isEmpty() ) if ( !canBeEmpty ) @@ -65,9 +65,9 @@ QString Element::parsedOrbits( bool canBeEmpty ) else return ""; - QString orbits = m_orbits; - QRegExp rxs("([a-z])([0-9]+)"); - QRegExp rxb("([a-z]{2}) ",false); + 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 return orbits; @@ -82,10 +82,10 @@ double Element::meanmass() return m_mass/m_number; } -const QString Element::adjustRadius( RADIUSTYPE rtype ) +const TQString Element::adjustRadius( RADIUSTYPE rtype ) { double val = 0.0; - QString v; + TQString v; switch ( rtype ) { @@ -110,9 +110,9 @@ const QString Element::adjustRadius( RADIUSTYPE rtype ) return v; } -const QString Element::adjustUnits( const int type, double value ) +const TQString Element::adjustUnits( const int type, double value ) { - QString v; + TQString v; if ( type == IE ) //an ionization energy { if ( Prefs::energies() == 0 ) @@ -130,9 +130,9 @@ const QString Element::adjustUnits( const int type, double value ) return v; } -const QString Element::adjustUnits( const int type ) +const TQString Element::adjustUnits( const int type ) { - QString v = QString::null; + TQString v = TQString::null; double val = 0.0; //the value to convert @@ -148,22 +148,22 @@ const QString Element::adjustUnits( const int type ) else { double newvalue = TempUnit::convert( val, (int)TempUnit::Kelvin, Prefs::temperature() ); - QString strVal = KalziumUtils::localizedValue( newvalue, 6 ); + TQString strVal = KalziumUtils::localizedValue( newvalue, 6 ); switch (Prefs::temperature()) { case 0: //Kelvin v = i18n( "%1 is the temperature in Kelvin", "%1 K" ).arg( strVal ); break; case 1://Kelvin to Celsius - v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).arg( strVal ).arg( QChar(0xB0) ); + v = i18n( "%1 is the temperature in Celsius", "%1 %2C" ).arg( strVal ).arg( TQChar(0xB0) ); break; case 2: // Kelvin to Fahrenheit - v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" ).arg( strVal ).arg( QChar(0xB0) ); + v = i18n( "%1 is the temperature in Fahrenheit", "%1 %2F" ).arg( strVal ).arg( TQChar(0xB0) ); break; case 3: // Kelvin to Rankine - v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).arg( strVal ).arg( QChar(0xB0) ); + v = i18n( "%1 is the temperature in Rankine", "%1 %2Ra" ).arg( strVal ).arg( TQChar(0xB0) ); break; case 4: // Kelvin to Reaumur - v = i18n( "%1 is the temperature in Reaumur", "%1 %2R" ).arg( strVal ).arg( QChar(0xB0) ); + v = i18n( "%1 is the temperature in Reaumur", "%1 %2R" ).arg( strVal ).arg( TQChar(0xB0) ); break; } } @@ -230,14 +230,14 @@ const QString Element::adjustUnits( const int type ) } else { - v = i18n( "This element was discovered in the year %1" ).arg( QString::number( val ) ); + v = i18n( "This element was discovered in the year %1" ).arg( TQString::number( val ) ); } } return v; } -void Element::drawStateOfMatter( QPainter* p, double temp ) +void Element::drawStateOfMatter( TQPainter* p, double temp ) { //the height of a "line" inside an element int h_small = 15; //the size for the small units like elementnumber @@ -248,16 +248,16 @@ void Element::drawStateOfMatter( QPainter* p, double temp ) //The Y-coordinate int Y = yPos(); - QColor color = currentColor( temp ); + TQColor color = currentColor( temp ); p->setPen( color ); p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, color ); - QString text; - QFont symbol_font = p->font(); + TQString text; + TQFont symbol_font = p->font(); symbol_font.setPointSize( 10 ); - QFont f = p->font(); + TQFont f = p->font(); f.setPointSize( 9 ); p->setFont( f ); @@ -267,7 +267,7 @@ void Element::drawStateOfMatter( QPainter* p, double temp ) text = KalziumUtils::localizedValue( KalziumUtils::strippedValue( mass( ) ), 6 ); p->drawText( X,Y ,ELEMENTSIZE,h_small,Qt::AlignCenter, text ); - text = QString::number( number() ); + text = TQString::number( number() ); p->drawText( X,Y+ELEMENTSIZE-h_small , ELEMENTSIZE, h_small,Qt::AlignCenter, text ); p->setFont( symbol_font ); @@ -278,9 +278,9 @@ void Element::drawStateOfMatter( QPainter* p, double temp ) p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); } -QColor Element::currentColor( const double temp ) +TQColor Element::currentColor( const double temp ) { - QColor color; + TQColor color; //take the colours for the given temperature const double iButton_melting = melting(); @@ -311,7 +311,7 @@ QColor Element::currentColor( const double temp ) } -void Element::drawGradient( QPainter* p, const QString& value, const QColor& c) +void Element::drawGradient( TQPainter* p, const TQString& value, const TQColor& c) { //Set the elementColor to c to make the overviewwidget show //the correct color @@ -330,15 +330,15 @@ void Element::drawGradient( QPainter* p, const QString& value, const QColor& c) p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, c ); p->setPen( Qt::black ); - QFont symbol_font = p->font(); - QFont f = p->font(); + TQFont symbol_font = p->font(); + TQFont f = p->font(); - f.setPointSize( KalziumUtils::maxSize(value, QRect( X,Y+ELEMENTSIZE-h_small, ELEMENTSIZE, h_small ),f, p ) ); + 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 ); - const QRect rect = QRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 ); + 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 ); @@ -349,7 +349,7 @@ void Element::drawGradient( QPainter* p, const QString& value, const QColor& c) p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); } -void Element::drawGrayedOut( QPainter *p ) +void Element::drawGrayedOut( TQPainter *p ) { //The X-coordiante int X = xPos(); @@ -361,8 +361,8 @@ void Element::drawGrayedOut( QPainter *p ) p->setPen( Qt::darkGray ); - QFont symbol_font = p->font(); - const QRect rect = QRect( X,Y,ELEMENTSIZE-2,ELEMENTSIZE-10 ); + 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 ); @@ -372,7 +372,7 @@ void Element::drawGrayedOut( QPainter *p ) p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); } -void Element::drawSelf( QPainter* p, bool simple, bool isCrystal ) +void Element::drawSelf( TQPainter* p, bool simple, bool isCrystal ) { //the height of a "line" inside an element int h_small = 12; //the size for the small units like elementnumber @@ -387,12 +387,12 @@ void Element::drawSelf( QPainter* p, bool simple, bool isCrystal ) p->fillRect( X, Y,ELEMENTSIZE,ELEMENTSIZE, elementColor() ); p->setPen( Qt::black ); - QString text; - QFont symbol_font = p->font(); + TQString text; + TQFont symbol_font = p->font(); const int max = ELEMENTSIZE-10; - const QRect rect = QRect( X,Y,ELEMENTSIZE-2,max ); + const TQRect rect = TQRect( X,Y,ELEMENTSIZE-2,max ); int goodsize = KalziumUtils::maxSize( symbol(), rect, symbol_font, p ); symbol_font.setPointSize( goodsize ); @@ -403,19 +403,19 @@ void Element::drawSelf( QPainter* p, bool simple, bool isCrystal ) else p->drawText( X+1,Y+5, ELEMENTSIZE-2,max,Qt::AlignHCenter, symbol() ); - QFont f = p->font(); + TQFont f = p->font(); - QRect smallRect( X,Y ,ELEMENTSIZE-4,h_small ); - f.setPointSize( KalziumUtils::maxSize( QString::number( number() ), smallRect, f, p ) ); + TQRect smallRect( X,Y ,ELEMENTSIZE-4,h_small ); + f.setPointSize( KalziumUtils::maxSize( TQString::number( number() ), smallRect, f, p ) ); p->setFont( f ); if ( !simple ) {//the user only wants a simple periodic table, don't weight the cell - QString text; + TQString text; if ( isCrystal ) { - QString structure = crystalstructure(); + TQString structure = crystalstructure(); /** * hcp: hexagonal close packed * fcc: face centered cubic @@ -444,7 +444,7 @@ void Element::drawSelf( QPainter* p, bool simple, bool isCrystal ) p->drawText( X+2,Y ,ELEMENTSIZE-4 ,h_small,Qt::AlignCenter, text ); } - text = QString::number( number() ); + text = TQString::number( number() ); p->drawText( X+2,Y+ELEMENTSIZE-h_small , ELEMENTSIZE-4, h_small,Qt::AlignCenter, text ); p->drawRect( X, Y,ELEMENTSIZE+1,ELEMENTSIZE+1); @@ -479,7 +479,7 @@ void Element::setupXY() y = posYRegular[m_number-1]; } -void Element::setRadius( RADIUSTYPE type, double value, const QString& name ) +void Element::setRadius( RADIUSTYPE type, double value, const TQString& name ) { switch ( type ) { @@ -537,12 +537,12 @@ int Element::yPos() const return tmp_y; } -QPoint Element::pos() const +TQPoint Element::pos() const { - return QPoint( xPos(), yPos() ); + return TQPoint( xPos(), yPos() ); } -QPoint Element::coords() const +TQPoint Element::coords() const { - return QPoint( x, y ); + return TQPoint( x, y ); } diff --git a/kalzium/src/element.h b/kalzium/src/element.h index c3d2b091..b68bcb09 100644 --- a/kalzium/src/element.h +++ b/kalzium/src/element.h @@ -22,8 +22,8 @@ #define ELEMENTSIZE 40 -#include <qcolor.h> -#include <qvaluelist.h> +#include <tqcolor.h> +#include <tqvaluelist.h> class Element; class QDomDocument; @@ -36,9 +36,9 @@ class Isotope; struct coordinate; -typedef QValueList<Element*> EList; -typedef QValueList<coordinate> CList; -typedef QValueList<double> doubleList; +typedef TQValueList<Element*> EList; +typedef TQValueList<coordinate> CList; +typedef TQValueList<double> doubleList; struct coordinate{ int x; @@ -96,11 +96,11 @@ class Element{ /** * @return the information where the name of the Element comes from */ - QString nameOrigin() const{ + TQString nameOrigin() const{ return m_origin; } - QString orbits() const{ + TQString orbits() const{ return m_orbits; } @@ -121,7 +121,7 @@ class Element{ * The ionicradius also has a name @p name. This will store the charge of * the ion (for example, +2 or -3 ) */ - void setRadius( RADIUSTYPE type, double value, const QString& name = 0 ); + void setRadius( RADIUSTYPE type, double value, const TQString& name = 0 ); void setDate( int date ) { m_date = date; } void setPeriod( int period ){ m_period = period; } @@ -134,33 +134,33 @@ class Element{ */ void setAbundance( int abundance ){ m_abundance = abundance; } - void setScientist( const QString& value ) { m_scientist = value; } - void setCrysatalstructure( const QString& value ) { m_crystalstructure = value; } - void setName( const QString& value ) { m_name = value; } - void setOrigin( const QString& value ) { m_origin = value; } - void setBlock( const QString& value ) { m_block = value; } - void setGroup( const QString& value ) { m_group = value; } - void setFamily( const QString& value ) { m_family = value; } - void setOrbits( const QString& value ) { m_orbits = value; } - void setSymbol( const QString& value ) { m_symbol = value; } - void setOxydation( const QString& value ) { m_oxstage = value; } - void setAcidicbehaviour( const QString& value ) { m_acidbeh = value; } - void setIsotopes( const QString& value ) { m_isotopes = value; } + void setScientist( const TQString& value ) { m_scientist = value; } + void setCrysatalstructure( const TQString& value ) { m_crystalstructure = value; } + void setName( const TQString& value ) { m_name = value; } + void setOrigin( const TQString& value ) { m_origin = value; } + void setBlock( const TQString& value ) { m_block = value; } + void setGroup( const TQString& value ) { m_group = value; } + void setFamily( const TQString& value ) { m_family = value; } + void setOrbits( const TQString& value ) { m_orbits = value; } + void setSymbol( const TQString& value ) { m_symbol = value; } + void setOxydation( const TQString& value ) { m_oxstage = value; } + void setAcidicbehaviour( const TQString& value ) { m_acidbeh = value; } + void setIsotopes( const TQString& value ) { m_isotopes = value; } void setArtificial(){ m_artificial = true; } void setRadioactive(){ m_radioactive = true; } void setIonisationList( doubleList l ){ m_ionenergies = l; } - QValueList<Isotope*> isotopes() const{ + TQValueList<Isotope*> isotopes() const{ return m_isotopeList; } - QValueList<double> spectrumList() const{ + TQValueList<double> spectrumList() const{ return m_spectrumList; } - void setIsotopeList( QValueList<Isotope*> list ){ + void setIsotopeList( TQValueList<Isotope*> list ){ m_isotopeList = list; } @@ -209,12 +209,12 @@ class Element{ * return the correct color of the element at the * temperature @p temp */ - QColor currentColor( const double temp ); + TQColor currentColor( const double temp ); /** * mutator for the element's color */ - void setElementColor( const QColor &c ) { m_Color = c; } + void setElementColor( const TQColor &c ) { m_Color = c; } /** * @return the importance of the element for biological @@ -241,47 +241,47 @@ class Element{ /** * @return the symbol of the element */ - QString symbol() const { + TQString symbol() const { return m_symbol; } /** * @return the scientist who discovered the element */ - QString scientist() const{ + TQString scientist() const{ return m_scientist; } /** * @return the crystal structure of the element */ - QString crystalstructure() const{ + TQString crystalstructure() const{ return m_crystalstructure; } /** * @return the name of the element */ - QString elname() const { + TQString elname() const { return m_name; } //FIXME I need to add a way to have more than one ionic radius - QString ioncharge() const{ + TQString ioncharge() const{ return m_ionvalue; } /** * @return the chemical block (s, p, d, f) of the element */ - QString block() const { + TQString block() const { return m_block; } /** * @return the group of the element */ - QString group() const { + TQString group() const { return m_group; } @@ -289,32 +289,32 @@ class Element{ return m_period; } - QString family() const { + TQString family() const { return m_family; } /** * @return the acidic behavior of the element */ - QString acidicbeh() const { + TQString acidicbeh() const { return m_acidbeh; } /** * @return the oxydationstages of the element */ - QString oxstage() const { + TQString oxstage() const { return m_oxstage; } /** - * @return the orbits of the element. The QString is already + * @return the orbits of the element. The TQString is already * parsed so that the numbers are superscripts and the first * block is bold. * @param canBeEmpty specifies if the string returned can be * empty instead of a "Unknown structure" one. */ - QString parsedOrbits( bool canBeEmpty = false ); + TQString parsedOrbits( bool canBeEmpty = false ); /** * @return the boiling point of the element in Kelvin @@ -380,9 +380,9 @@ class Element{ * @param type the TYPE of the data * @return the adjusted datastring */ - const QString adjustUnits( const int type ); + const TQString adjustUnits( const int type ); - const QString adjustRadius( RADIUSTYPE rtype ); + const TQString adjustRadius( RADIUSTYPE rtype ); /** * adjusts the units for the data. The user can @@ -395,7 +395,7 @@ class Element{ * @param value the value of the data. * @return the adjusted datastring */ - const QString adjustUnits( const int type, double value ); + const TQString adjustUnits( const int type, double value ); /** * types of datas @@ -417,13 +417,13 @@ class Element{ IONICRADIUS }; - QPoint pos() const; - QPoint coords() const; + TQPoint pos() const; + TQPoint coords() const; /** * accessor for the element's color */ - QColor elementColor() const { + TQColor elementColor() const { return m_Color; } @@ -439,11 +439,11 @@ class Element{ bool m_hasSpectrum; - QValueList<Isotope*> m_isotopeList; + TQValueList<Isotope*> m_isotopeList; - QValueList<double> m_spectrumList; + TQValueList<double> m_spectrumList; - QColor m_Color; + TQColor m_Color; int xPos() const; int yPos() const; @@ -466,7 +466,7 @@ class Element{ m_period, m_abundance; - QString m_symbol, + TQString m_symbol, m_name, m_origin, m_oxstage, @@ -492,13 +492,13 @@ class Element{ * @param value the value to display as text * @param c the color used to paint the element */ - virtual void drawGradient( QPainter* p, const QString& value, const QColor& c); + virtual void drawGradient( TQPainter* p, const TQString& value, const TQColor& c); /** * Draw the Element grayed out. Used in the timeline * @param p the painter used for the painting */ - virtual void drawGrayedOut( QPainter* p ); + virtual void drawGrayedOut( TQPainter* p ); /** * draw the rectangle with the information @@ -506,9 +506,9 @@ class Element{ * @param simple if True more information will be shown * @param isCrystal whether the elements should draw its crystal structure */ - virtual void drawSelf( QPainter* p, bool simple = false, bool isCrystal = false ); + virtual void drawSelf( TQPainter* p, bool simple = false, bool isCrystal = false ); - virtual void drawStateOfMatter( QPainter* p, double temperature ); + virtual void drawStateOfMatter( TQPainter* p, double temperature ); }; diff --git a/kalzium/src/elementdataviewer.cpp b/kalzium/src/elementdataviewer.cpp index 6fe8a3e3..108889cc 100644 --- a/kalzium/src/elementdataviewer.cpp +++ b/kalzium/src/elementdataviewer.cpp @@ -26,11 +26,11 @@ #include <kapplication.h> //QT-Includes -#include <qlayout.h> -#include <qcheckbox.h> -#include <qlabel.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqlabel.h> -ElementDataViewer::ElementDataViewer( QWidget *parent, const char* name ) +ElementDataViewer::ElementDataViewer( TQWidget *parent, const char* name ) : KDialogBase( KDialogBase::Plain, i18n( "Plot Data") , Help | User1 | Close, @@ -41,7 +41,7 @@ ElementDataViewer::ElementDataViewer( QWidget *parent, const char* name ) yData = new AxisData(); - QHBoxLayout *layout = new QHBoxLayout(plainPage(), 0, KDialog::spacingHint() ); + TQHBoxLayout *layout = new TQHBoxLayout(plainPage(), 0, KDialog::spacingHint() ); m_pPlotSetupWidget = new PlotSetupWidget( plainPage(), "plotsetup" ); m_pPlotSetupWidget->from->setMaxValue( d->numberOfElements() - 1 ); @@ -69,15 +69,15 @@ ElementDataViewer::ElementDataViewer( QWidget *parent, const char* name ) setButtonText( User1, i18n("&Plot") ); m_actionCollection = new KActionCollection(this); - KStdAction::quit(this, SLOT(slotClose()), m_actionCollection); + KStdAction::quit(this, TQT_SLOT(slotClose()), m_actionCollection); - connect ( m_pPlotSetupWidget->KCB_y, SIGNAL( activated(int) ), - this, SLOT( drawPlot()) ); + connect ( m_pPlotSetupWidget->KCB_y, TQT_SIGNAL( activated(int) ), + this, TQT_SLOT( drawPlot()) ); - connect ( m_pPlotSetupWidget->connectPoints, SIGNAL( toggled(bool) ), - this, SLOT( drawPlot()) ); - connect ( m_pPlotSetupWidget->showNames, SIGNAL( toggled(bool) ), - this, SLOT( drawPlot()) ); + connect ( m_pPlotSetupWidget->connectPoints, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( drawPlot()) ); + connect ( m_pPlotSetupWidget->showNames, TQT_SIGNAL( toggled(bool) ), + this, TQT_SLOT( drawPlot()) ); // Draw the plot so that the user doesn't have to press the "Plot" // button to seee anything. @@ -128,12 +128,12 @@ void ElementDataViewer::setLimits(int f, int t) m_pPlotWidget->setLimits( f - dx, t + dx, minY - dy, maxY + dy ); } -void ElementDataViewer::paintEvent(QPaintEvent*) +void ElementDataViewer::paintEvent(TQPaintEvent*) { m_pPlotWidget->update(); } -void ElementDataViewer::keyPressEvent(QKeyEvent *e) +void ElementDataViewer::keyPressEvent(TQKeyEvent *e) { switch ( e->key() ) { @@ -294,9 +294,9 @@ void ElementDataViewer::drawPlot() /* * reserve the memory for the KPlotObjects */ - //TODO QT4 replace QMemArray with QVector - QMemArray<KPlotObject*> dataPoint(num); - QMemArray<KPlotObject*> dataPointLabel(num); + //TODO QT4 replace TQMemArray with QVector + TQMemArray<KPlotObject*> dataPoint(num); + TQMemArray<KPlotObject*> dataPointLabel(num); int number = 0; @@ -334,9 +334,9 @@ void ElementDataViewer::drawPlot() } //now set the values for the min, max and avarage value - m_pPlotSetupWidget->aValue->setText( QString::number( av/number ) ); - m_pPlotSetupWidget->minValue->setText( QString::number( min ) ); - m_pPlotSetupWidget->maxValue->setText( QString::number( max ) ); + m_pPlotSetupWidget->aValue->setText( TQString::number( av/number ) ); + m_pPlotSetupWidget->minValue->setText( TQString::number( min ) ); + m_pPlotSetupWidget->maxValue->setText( TQString::number( max ) ); } void ElementDataViewer::initData() diff --git a/kalzium/src/elementdataviewer.h b/kalzium/src/elementdataviewer.h index 4414377c..76fea4b1 100644 --- a/kalzium/src/elementdataviewer.h +++ b/kalzium/src/elementdataviewer.h @@ -16,7 +16,7 @@ #include <kdialogbase.h> -typedef QValueList<double> DoubleList; +typedef TQValueList<double> DoubleList; class Element; class KalziumDataObject; @@ -98,7 +98,7 @@ class ElementDataViewer : public KDialogBase Q_OBJECT public: - ElementDataViewer( QWidget *parent=0 , const char *name =0 ); + ElementDataViewer( TQWidget *parent=0 , const char *name =0 ); /** * the AxixData for the y-Axis @@ -117,8 +117,8 @@ class ElementDataViewer : public KDialogBase void slotUser1(); protected: - virtual void paintEvent(QPaintEvent*); - virtual void keyPressEvent(QKeyEvent *e); + virtual void paintEvent(TQPaintEvent*); + virtual void keyPressEvent(TQKeyEvent *e); protected slots: /** @@ -132,7 +132,7 @@ class ElementDataViewer : public KDialogBase KalziumDataObject *d; - QStringList names; + TQStringList names; KActionCollection* m_actionCollection; diff --git a/kalzium/src/eqchemview.cpp b/kalzium/src/eqchemview.cpp index 6b5a9476..fee6e9c7 100644 --- a/kalzium/src/eqchemview.cpp +++ b/kalzium/src/eqchemview.cpp @@ -18,9 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qlayout.h> -#include <qlabel.h> -#include <qstring.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqstring.h> #include <kdebug.h> #include <klocale.h> @@ -46,11 +46,11 @@ extern "C" { char* solve_equation(const char *) { return NULL; } #endif -eqchemView::eqchemView(QWidget *parent) : QWidget(parent) +eqchemView::eqchemView(TQWidget *parent) : TQWidget(parent) { settingsChanged(); - QGridLayout *l = new QGridLayout(this, 2, 2, 11, 6, "eqchemView::eqchemView layout"); + TQGridLayout *l = new TQGridLayout(this, 2, 2, 11, 6, "eqchemView::eqchemView layout"); m_eqResult = new EqResult(this); m_eqedit = new KLineEdit(this); @@ -63,7 +63,7 @@ eqchemView::eqchemView(QWidget *parent) : QWidget(parent) m_eqclear->setIconSet( KGlobal::instance()->iconLoader()->loadIconSet("locationbar_erase", KIcon::NoGroup, 22 /*KIcon::SizeSmallMedium*/) ); - connect(m_eqclear, SIGNAL(clicked()), m_eqedit, SLOT(clear()) ); + connect(m_eqclear, TQT_SIGNAL(clicked()), m_eqedit, TQT_SLOT(clear()) ); } eqchemView::~eqchemView() @@ -88,14 +88,14 @@ void eqchemView::clear() void eqchemView::compute() { - QString equation( m_eqedit->text() ); + TQString equation( m_eqedit->text() ); equation.replace("+", "+"); equation.replace("->", " -> "); equation.append(" "); equation.prepend(" "); char * result = solve_equation( equation.latin1() ); - QString disp = QString(result); + TQString disp = TQString(result); // mem leak ? free(result); @@ -104,7 +104,7 @@ void eqchemView::compute() m_eqResult->add( equation, disp ); } -EQChemDialog::EQChemDialog( QWidget *parent ) +EQChemDialog::EQChemDialog( TQWidget *parent ) : KDialogBase(parent, "EQChemDialog", true, i18n( "Solve Chemical Equations" ), KDialogBase::Apply|KDialogBase::Close|KDialogBase::Help, KDialogBase::Apply, true ) { diff --git a/kalzium/src/eqchemview.h b/kalzium/src/eqchemview.h index 4e381fc2..418858a4 100644 --- a/kalzium/src/eqchemview.h +++ b/kalzium/src/eqchemview.h @@ -21,7 +21,7 @@ #ifndef _EQCHEMVIEW_H_ #define _EQCHEMVIEW_H_ -#include <qwidget.h> +#include <tqwidget.h> #include <kdialogbase.h> class QPainter; @@ -47,7 +47,7 @@ public: /** * Default constructor */ - eqchemView(QWidget *parent); + eqchemView(TQWidget *parent); /** * Destructor @@ -58,12 +58,12 @@ signals: /** * Use this signal to change the content of the statusbar */ - void signalChangeStatusbar(const QString& text); + void signalChangeStatusbar(const TQString& text); /** * Use this signal to change the content of the caption */ - void signalChangeCaption(const QString& text); + void signalChangeCaption(const TQString& text); public slots: void clear(); @@ -92,7 +92,7 @@ class EQChemDialog : public KDialogBase * * @param parent the parent widget */ - EQChemDialog( QWidget *parent ); + EQChemDialog( TQWidget *parent ); private slots: /** diff --git a/kalzium/src/eqresult.cpp b/kalzium/src/eqresult.cpp index a1ebf555..c128c93e 100644 --- a/kalzium/src/eqresult.cpp +++ b/kalzium/src/eqresult.cpp @@ -18,9 +18,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qtimer.h> -#include <qpainter.h> -#include <qcolor.h> +#include <tqtimer.h> +#include <tqpainter.h> +#include <tqcolor.h> #include <kdebug.h> @@ -28,68 +28,68 @@ // inspired by speedcrunch -QuestionItem::QuestionItem( QListBox* listBox, const QString& e, QColor bg ): -QListBoxItem ( listBox ) +QuestionItem::QuestionItem( TQListBox* listBox, const TQString& e, TQColor bg ): +TQListBoxItem ( listBox ) { m_msg = e; m_bgcolor = bg; } -AnswerItem::AnswerItem( QListBox* listBox, const QString& e, const QString &r, QColor bg ): -QListBoxItem ( listBox ) +AnswerItem::AnswerItem( TQListBox* listBox, const TQString& e, const TQString &r, TQColor bg ): +TQListBoxItem ( listBox ) { m_msg = "<p align=\"right\">"+r+"</p>"; m_origmsg = e; m_bgcolor = bg; - m_richtext = new QSimpleRichText(m_msg, listBox->font()); + m_richtext = new TQSimpleRichText(m_msg, listBox->font()); m_richtext->setWidth( listBox->width() ); } -void QuestionItem::paint( QPainter* painter ) +void QuestionItem::paint( TQPainter* painter ) { int tf = Qt::NoAccel | Qt::SingleLine | Qt::AlignVCenter; - QRect r ( 0, 0, listBox()->contentsWidth(), height( listBox() ) ); + TQRect r ( 0, 0, listBox()->contentsWidth(), height( listBox() ) ); painter->fillRect( r, m_bgcolor ); painter->drawText( r, tf, m_msg ); } -void AnswerItem::paint( QPainter* painter ) +void AnswerItem::paint( TQPainter* painter ) { checkSize(); - QRect r ( 0, 0, listBox()->contentsWidth(), height( listBox() ) ); + TQRect r ( 0, 0, listBox()->contentsWidth(), height( listBox() ) ); painter->fillRect( r, m_bgcolor ); - QColorGroup cg = listBox()->colorGroup(); - cg.setColor( QColorGroup::Background, m_bgcolor ); + TQColorGroup cg = listBox()->colorGroup(); + cg.setColor( TQColorGroup::Background, m_bgcolor ); m_richtext->draw(painter, 0, 0, r, cg ); } -int QuestionItem::width( const QListBox*lb ) const +int QuestionItem::width( const TQListBox*lb ) const { - QFont font = lb->font(); - return QFontMetrics( font ).width( m_msg ); + TQFont font = lb->font(); + return TQFontMetrics( font ).width( m_msg ); } -int QuestionItem::height( const QListBox*lb ) const +int QuestionItem::height( const TQListBox*lb ) const { - QFont font = lb->font(); - return QFontMetrics( font ).height() + 4; + TQFont font = lb->font(); + return TQFontMetrics( font ).height() + 4; } void AnswerItem::checkSize() { - QFont font = listBox()->font(); - int t1 = QFontMetrics( font ).width( m_origmsg+"padding" ); + TQFont font = listBox()->font(); + int t1 = TQFontMetrics( font ).width( m_origmsg+"padding" ); int t2 = listBox()->width() - 20; // take the maximum m_richtext->setWidth( (t1>t2)?t1:t2 ); } -EqResult::EqResult(QWidget *parent) : QListBox(parent) +EqResult::EqResult(TQWidget *parent) : TQListBox(parent) { m_alternate_color = false; setMinimumWidth(140); @@ -99,9 +99,9 @@ EqResult::~EqResult() { } -void EqResult::add(const QString & question, const QString & answer) +void EqResult::add(const TQString & question, const TQString & answer) { - QColor bgcolor = colorGroup().base(); + TQColor bgcolor = colorGroup().base(); if ( m_alternate_color ) bgcolor = bgcolor.dark( 120 ); @@ -111,7 +111,7 @@ void EqResult::add(const QString & question, const QString & answer) new QuestionItem( this, question, bgcolor ); new AnswerItem( this, question, answer, bgcolor ); - QTimer::singleShot( 100, this, SLOT( scrollToEnd() ) ); + TQTimer::singleShot( 100, this, TQT_SLOT( scrollToEnd() ) ); } void EqResult::scrollToEnd() @@ -119,7 +119,7 @@ void EqResult::scrollToEnd() ensureVisible( 0, contentsHeight()-1 ); } -void EqResult::resizeEvent( QResizeEvent* ) +void EqResult::resizeEvent( TQResizeEvent* ) { triggerUpdate( true ); } diff --git a/kalzium/src/eqresult.h b/kalzium/src/eqresult.h index 7b229cde..39e7d85a 100644 --- a/kalzium/src/eqresult.h +++ b/kalzium/src/eqresult.h @@ -21,8 +21,8 @@ #ifndef _EQRESULT_H_ #define _EQRESULT_H_ -#include <qlistbox.h> -#include <qsimplerichtext.h> +#include <tqlistbox.h> +#include <tqsimplerichtext.h> /** * @author Thomas Nagy @@ -30,14 +30,14 @@ class QuestionItem : public QListBoxItem { public: - QuestionItem( QListBox*, const QString&, QColor bg ); + QuestionItem( TQListBox*, const TQString&, TQColor bg ); protected: - void paint( QPainter* p ); - int width( const QListBox* ) const; - int height( const QListBox* ) const; + void paint( TQPainter* p ); + int width( const TQListBox* ) const; + int height( const TQListBox* ) const; private: - QString m_msg; - QColor m_bgcolor; + TQString m_msg; + TQColor m_bgcolor; }; /** @@ -46,24 +46,24 @@ class QuestionItem : public QListBoxItem class AnswerItem : public QListBoxItem { public: - AnswerItem( QListBox*, const QString&, const QString&, QColor bg ); + AnswerItem( TQListBox*, const TQString&, const TQString&, TQColor bg ); ~AnswerItem() { delete m_richtext; } void checkSize(); protected: - void paint( QPainter* p ); - int width( const QListBox* ) const{ + void paint( TQPainter* p ); + int width( const TQListBox* ) const{ return m_richtext->height(); } - int height( const QListBox* ) const{ + int height( const TQListBox* ) const{ return m_richtext->height(); } private: - QString m_msg; - QString m_origmsg; - QColor m_bgcolor; - QSimpleRichText * m_richtext; + TQString m_msg; + TQString m_origmsg; + TQColor m_bgcolor; + TQSimpleRichText * m_richtext; }; /** @@ -74,13 +74,13 @@ class EqResult : public QListBox Q_OBJECT public: - EqResult(QWidget *parent); + EqResult(TQWidget *parent); ~EqResult(); public slots: - void add(const QString &, const QString &); + void add(const TQString &, const TQString &); void scrollToEnd(); - void resizeEvent( QResizeEvent* ); + void resizeEvent( TQResizeEvent* ); private: bool m_alternate_color; diff --git a/kalzium/src/exporter.cpp b/kalzium/src/exporter.cpp index 48f50170..0c667eac 100644 --- a/kalzium/src/exporter.cpp +++ b/kalzium/src/exporter.cpp @@ -19,7 +19,7 @@ #include "exporter.h" -#include <qpixmap.h> +#include <tqpixmap.h> #include <kdebug.h> #include <kimageio.h> @@ -39,11 +39,11 @@ Exporter::~Exporter() { } -bool Exporter::saveAsImage( const QPixmap* pixmap, const QString& fileName, int x, int y, int width, int height ) +bool Exporter::saveAsImage( const TQPixmap* pixmap, const TQString& fileName, int x, int y, int width, int height ) { if ( x != 0 || y != 0 || width != 0 || height != 0 ) { - QPixmap* tmpPixmap = new QPixmap(); + TQPixmap* tmpPixmap = new TQPixmap(); copyBlt( tmpPixmap, 0, 0, pixmap, x, y, width, height ); @@ -55,7 +55,7 @@ bool Exporter::saveAsImage( const QPixmap* pixmap, const QString& fileName, int return pixmap->save( fileName, "PNG" ); } -QString Exporter::supportedImageFormats() +TQString Exporter::supportedImageFormats() { return KImageIO::pattern( KImageIO::Writing ); } diff --git a/kalzium/src/exporter.h b/kalzium/src/exporter.h index c780a394..b093b285 100644 --- a/kalzium/src/exporter.h +++ b/kalzium/src/exporter.h @@ -40,14 +40,14 @@ public: * exported. * @return whether the image was saved successfully */ - bool saveAsImage( const QPixmap* pixmap, const QString& fileName, int x = 0, int y = 0, int width = 0, int height = 0 ); + bool saveAsImage( const TQPixmap* pixmap, const TQString& fileName, int x = 0, int y = 0, int width = 0, int height = 0 ); /** * Which image type can we export to? * @return a string representing a filter string for file dialogs with * the image type we can export to */ - QString supportedImageFormats(); + TQString supportedImageFormats(); }; #endif diff --git a/kalzium/src/isotope.cpp b/kalzium/src/isotope.cpp index b15e38cc..268e99d4 100644 --- a/kalzium/src/isotope.cpp +++ b/kalzium/src/isotope.cpp @@ -23,7 +23,7 @@ #include <kdebug.h> #include <klocale.h> -Isotope::Isotope( int neutrons, int protones, double percentage, double weight, double halflife, QString format, double alphadecay, double betaplusdecay, double betaminusdecay, double ecdecay, double alphapercentage, double betapluspercentage, double betaminuspercentage, double ecpercentage, QString spin, QString magmoment) +Isotope::Isotope( int neutrons, int protones, double percentage, double weight, double halflife, TQString format, double alphadecay, double betaplusdecay, double betaminusdecay, double ecdecay, double alphapercentage, double betapluspercentage, double betaminuspercentage, double ecpercentage, TQString spin, TQString magmoment) { m_neutrons = neutrons; m_protones = protones; @@ -45,9 +45,9 @@ Isotope::Isotope( int neutrons, int protones, double percentage, double weight, m_ecpercentage = ecpercentage; } -QString Isotope::halflifeAsString() +TQString Isotope::halflifeAsString() { - QString halflife; + TQString halflife; if ( !seconds() )//years { diff --git a/kalzium/src/isotope.h b/kalzium/src/isotope.h index feed345f..d32e8a5c 100644 --- a/kalzium/src/isotope.h +++ b/kalzium/src/isotope.h @@ -20,7 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qstring.h> +#include <tqstring.h> /** * @author Carsten Niehaus @@ -36,7 +36,7 @@ class Isotope double percentage, double weight, double halflife, - QString format, + TQString format, double alphadecay, double betaplusdecay, double betaminusdecay, @@ -45,8 +45,8 @@ class Isotope double betapluspercentage, double betaminuspercentage, double ecpercentage, - QString spin, - QString magmoment); + TQString spin, + TQString magmoment); bool seconds() const{ if ( m_format == "seconds" ) @@ -123,20 +123,20 @@ class Isotope return m_ecdecay; } - QString spin() const{ + TQString spin() const{ return m_spin; } - QString magmoment() const{ + TQString magmoment() const{ return m_magmoment; } /** - * @return the halflife as a QString. The format will be + * @return the halflife as a TQString. The format will be * appended, for example "seconds" or "years" depending * on the timeframe */ - QString halflifeAsString(); + TQString halflifeAsString(); /** * @return the percentage of the betaminus decay @@ -172,7 +172,7 @@ class Isotope * isotopes have half-lifes of billion of years. This simply * doesn't fit into a unsigned int or double */ - QString m_format; + TQString m_format; /** * the weight of the isotope @@ -214,12 +214,12 @@ class Isotope /** *spin and parity */ - QString m_spin; + TQString m_spin; /** * magnetic moment */ - QString m_magmoment; + TQString m_magmoment; /** * the percentage with which the istope decays as alpha-rays diff --git a/kalzium/src/kalzium.cpp b/kalzium/src/kalzium.cpp index 613377cd..84c2c984 100644 --- a/kalzium/src/kalzium.cpp +++ b/kalzium/src/kalzium.cpp @@ -32,12 +32,12 @@ #include "kalziumutils.h" #include "config.h" -#include <qdockwindow.h> -#include <qlayout.h> -#include <qtoolbox.h> -#include <qslider.h> -#include <qscrollview.h> -#include <qspinbox.h> +#include <tqdockwindow.h> +#include <tqlayout.h> +#include <tqtoolbox.h> +#include <tqslider.h> +#include <tqscrollview.h> +#include <tqspinbox.h> #include <kconfigdialog.h> #include <kiconloader.h> @@ -61,21 +61,21 @@ Kalzium::Kalzium() // reading the elements from file KalziumDataObject::instance(); - QWidget *centralWidget = new QWidget( this, "centralWidget" ); - m_pCentralLayout = new QVBoxLayout( centralWidget, PerodicTableView_MARGIN, -1, "CentralLayout" ); + TQWidget *centralWidget = new TQWidget( this, "centralWidget" ); + m_pCentralLayout = new TQVBoxLayout( centralWidget, PerodicTableView_MARGIN, -1, "CentralLayout" ); - QScrollView *helperSV = new QScrollView(centralWidget); + TQScrollView *helperSV = new TQScrollView(centralWidget); m_pCentralLayout->addWidget(helperSV); helperSV->viewport()->setPaletteBackgroundColor(paletteBackgroundColor()); - helperSV->setFrameShape(QFrame::NoFrame); + helperSV->setFrameShape(TQFrame::NoFrame); m_PerodicTableView = new PerodicTableView( helperSV->viewport(), "PerodicTableView"); helperSV->addChild( m_PerodicTableView ); m_infoDialog = 0; m_toolboxCurrent = 0; - connect( m_PerodicTableView, SIGNAL( ElementClicked( int ) ), this, SLOT( openInformationDialog( int ) )); - connect( m_PerodicTableView, SIGNAL( MouseOver( int ) ), this, SLOT( slotStatusbar( int ) )); + connect( m_PerodicTableView, TQT_SIGNAL( ElementClicked( int ) ), this, TQT_SLOT( openInformationDialog( int ) )); + connect( m_PerodicTableView, TQT_SIGNAL( MouseOver( int ) ), this, TQT_SLOT( slotStatusbar( int ) )); // layouting setCentralWidget( centralWidget ); @@ -89,8 +89,8 @@ Kalzium::Kalzium() // creating the glossary dialog and loading the glossaries we have m_glossarydlg = new GlossaryDialog( true, this, "glossary" ); - QString dir = KGlobal::dirs()->findResourceDir( "data", "kalzium/data/" ); - QString picturepath = dir + "kalzium/data/bg.jpg"; + TQString dir = KGlobal::dirs()->findResourceDir( "data", "kalzium/data/" ); + TQString picturepath = dir + "kalzium/data/bg.jpg"; KURL u = dir + "kalzium/data/knowledge.xml"; Glossary *g = Glossary::readFromXML( u ); g->setName( i18n( "Knowledge" ) ); @@ -107,17 +107,17 @@ Kalzium::Kalzium() void Kalzium::setupActions() { - m_actionNoScheme = new KToggleAction(i18n("&No Color Scheme"), 0, this, SLOT(slotNoLook()), actionCollection(), "view_look_noscheme"); + m_actionNoScheme = new KToggleAction(i18n("&No Color Scheme"), 0, this, TQT_SLOT(slotNoLook()), actionCollection(), "view_look_noscheme"); // the actions for the color schemes - m_actionGroups = new KToggleAction(i18n("Show &Groups"), 0, this, SLOT(slotLookGroups()), actionCollection(), "view_look_groups"); - m_actionBlocks = new KToggleAction(i18n("Show &Blocks"), 0, this, SLOT(slotLookBlocks()), actionCollection(), "view_look_blocks"); - m_actionAcid = new KToggleAction(i18n("Show &Acid Behavior"), 0, this, SLOT(slotLookAcidBehavior()), actionCollection(), "view_look_acid"); - m_actionFamily = new KToggleAction(i18n("Show &Family"), 0, this, SLOT(slotLookFamily()), actionCollection(), "view_look_family"); - m_actionCrystal = new KToggleAction(i18n("Show &Crystal Structures"), 0, this, SLOT(slotLookCrystal()), actionCollection(), "view_look_crystal"); + m_actionGroups = new KToggleAction(i18n("Show &Groups"), 0, this, TQT_SLOT(slotLookGroups()), actionCollection(), "view_look_groups"); + m_actionBlocks = new KToggleAction(i18n("Show &Blocks"), 0, this, TQT_SLOT(slotLookBlocks()), actionCollection(), "view_look_blocks"); + m_actionAcid = new KToggleAction(i18n("Show &Acid Behavior"), 0, this, TQT_SLOT(slotLookAcidBehavior()), actionCollection(), "view_look_acid"); + m_actionFamily = new KToggleAction(i18n("Show &Family"), 0, this, TQT_SLOT(slotLookFamily()), actionCollection(), "view_look_family"); + m_actionCrystal = new KToggleAction(i18n("Show &Crystal Structures"), 0, this, TQT_SLOT(slotLookCrystal()), actionCollection(), "view_look_crystal"); //the actions for switching PerodicTableView - QStringList gradientlist; + TQStringList gradientlist; gradientlist.append(i18n("Atomic Radius")); gradientlist.append(i18n("Covalent Radius")); gradientlist.append(i18n("van der Waals Radius")); @@ -129,10 +129,10 @@ void Kalzium::setupActions() gradientlist.append(i18n("Electron Affinity")); gradient_action = new KSelectAction(i18n("&Gradient"), 0, this, 0, actionCollection(), "view_look_gradmenu"); gradient_action->setItems(gradientlist); - connect (gradient_action, SIGNAL(activated(int)), this, SLOT(slotSwitchtoGradient(int))); + connect (gradient_action, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSwitchtoGradient(int))); // the actions for switching PerodicTableView - QStringList numlist; + TQStringList numlist; numlist.append(i18n("No N&umeration")); numlist.append(i18n("Show &IUPAC")); numlist.append(i18n("Show &CAS")); @@ -140,25 +140,25 @@ void Kalzium::setupActions() numeration_action = new KSelectAction (i18n("&Numeration"), 0, this, 0, actionCollection(), "view_numerationtype"); numeration_action->setItems(numlist); numeration_action->setCurrentItem(Prefs::numeration()); - connect (numeration_action, SIGNAL(activated(int)), this, SLOT(slotSwitchtoNumeration(int))); + connect (numeration_action, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotSwitchtoNumeration(int))); - m_SidebarAction = new KAction(i18n("Show &Sidebar"), "sidebar", 0, this, SLOT(slotShowHideSidebar()), actionCollection(), "view_sidebar"); + m_SidebarAction = new KAction(i18n("Show &Sidebar"), "sidebar", 0, this, TQT_SLOT(slotShowHideSidebar()), actionCollection(), "view_sidebar"); #ifdef HAVE_FACILE - m_EQSolverAction = new KAction(i18n("&Equation Solver..."), "eqchem", 0, this, SLOT(slotShowEQSolver()), actionCollection(), "tools_eqsolver"); + m_EQSolverAction = new KAction(i18n("&Equation Solver..."), "eqchem", 0, this, TQT_SLOT(slotShowEQSolver()), actionCollection(), "tools_eqsolver"); #endif // tools actions - m_pPlotAction = new KAction(i18n("&Plot Data..."), "plot", 0, this, SLOT(slotPlotData()), actionCollection(), "tools_plotdata"); - m_pGlossaryAction = new KAction(i18n("&Glossary..."), "glossary", 0, this, SLOT(slotGlossary()), actionCollection(), "tools_glossary"); + m_pPlotAction = new KAction(i18n("&Plot Data..."), "plot", 0, this, TQT_SLOT(slotPlotData()), actionCollection(), "tools_plotdata"); + m_pGlossaryAction = new KAction(i18n("&Glossary..."), "glossary", 0, this, TQT_SLOT(slotGlossary()), actionCollection(), "tools_glossary"); // other period view options - m_pLegendAction = new KAction(i18n("Show &Legend"), "legend", 0, this, SLOT(slotShowLegend()), actionCollection(), "view_legend"); - m_pTooltipAction = new KAction(i18n("Show &Tooltip"), "tooltip", 0, this, SLOT(slotEnableTooltips()), actionCollection(), "view_tooltip"); + m_pLegendAction = new KAction(i18n("Show &Legend"), "legend", 0, this, TQT_SLOT(slotShowLegend()), actionCollection(), "view_legend"); + m_pTooltipAction = new KAction(i18n("Show &Tooltip"), "tooltip", 0, this, TQT_SLOT(slotEnableTooltips()), actionCollection(), "view_tooltip"); // the standard actions - KStdAction::preferences(this, SLOT(showSettingsDialog()), actionCollection()); - KStdAction::quit( kapp, SLOT (closeAllWindows()),actionCollection() ); + KStdAction::preferences(this, TQT_SLOT(showSettingsDialog()), actionCollection()); + KStdAction::quit( kapp, TQT_SLOT (closeAllWindows()),actionCollection() ); slotShowScheme( Prefs::colorschemebox() ); slotSwitchtoNumeration( Prefs::numeration() ); @@ -197,51 +197,51 @@ void Kalzium::setupActions() void Kalzium::setupSidebars() { - m_dockWin = new QDockWindow( this ); + m_dockWin = new TQDockWindow( this ); m_dockWin->setNewLine( true ); m_dockWin->setFixedExtentWidth( 220 ); m_dockWin->setResizeEnabled( true ); - m_dockWin->setFrameShape( QFrame::ToolBarPanel ); + m_dockWin->setFrameShape( TQFrame::ToolBarPanel ); m_dockWin->setCaption( i18n( "Sidebar" ) ); - m_dockWin->setCloseMode( QDockWindow::Always ); + m_dockWin->setCloseMode( TQDockWindow::Always ); - QToolBox *m_toolbox = new QToolBox( m_dockWin ); + TQToolBox *m_toolbox = new TQToolBox( m_dockWin ); m_dockWin->setWidget( m_toolbox ); - QWidget *fake = new QWidget( m_dockWin ); - QVBoxLayout *lay = new QVBoxLayout( fake, 5 ); + TQWidget *fake = new TQWidget( m_dockWin ); + TQVBoxLayout *lay = new TQVBoxLayout( fake, 5 ); lay->activate(); m_detailWidget = new DetailedGraphicalOverview( fake, "DetailedGraphicalOverview" ); m_detailWidget->setMinimumSize( 200, m_detailWidget->minimumSize().height() ); - connect( m_PerodicTableView, SIGNAL( MouseOver( int ) ), this, SLOT( slotSelectedNumber( int ) )); + connect( m_PerodicTableView, TQT_SIGNAL( MouseOver( int ) ), this, TQT_SLOT( slotSelectedNumber( int ) )); lay->addWidget( m_detailWidget ); - lay->addItem( new QSpacerItem( 10, 10, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding ) ); + lay->addItem( new TQSpacerItem( 10, 10, TQSizePolicy::Fixed, TQSizePolicy::MinimumExpanding ) ); m_toolbox->addItem( fake, SmallIcon( "overview" ), i18n( "Overview" ) ); m_calcWidget = new MolcalcWidget( m_dockWin, "molcalcwidget" ); m_toolbox->addItem( m_calcWidget, SmallIcon( "calculate" ), i18n( "Calculate" ) ); m_timeWidget = new TimeWidgetIMPL( this, "TimeWidget" ); - connect( m_timeWidget->time_slider, SIGNAL( valueChanged( int ) ), - m_PerodicTableView, SLOT( setDate( int ) ) ); - connect( m_timeWidget->time_slider, SIGNAL( valueChanged( int ) ), - m_timeWidget, SLOT( slotChanged( int ) ) ); - connect( m_timeWidget->Number1, SIGNAL( valueChanged( int ) ), - m_timeWidget, SLOT( slotChanged( int ) ) ); + connect( m_timeWidget->time_slider, TQT_SIGNAL( valueChanged( int ) ), + m_PerodicTableView, TQT_SLOT( setDate( int ) ) ); + connect( m_timeWidget->time_slider, TQT_SIGNAL( valueChanged( int ) ), + m_timeWidget, TQT_SLOT( slotChanged( int ) ) ); + connect( m_timeWidget->Number1, TQT_SIGNAL( valueChanged( int ) ), + m_timeWidget, TQT_SLOT( slotChanged( int ) ) ); m_toolbox->addItem( m_timeWidget, SmallIcon( "timeline" ), i18n( "Timeline" ) ); m_somWidget = new SOMWidgetIMPL( this, "somWidget" ); - connect( m_somWidget->temp_slider, SIGNAL( valueChanged( int ) ), - m_PerodicTableView, SLOT( setTemperature( int ) ) ); + connect( m_somWidget->temp_slider, TQT_SIGNAL( valueChanged( int ) ), + m_PerodicTableView, TQT_SLOT( setTemperature( int ) ) ); m_toolbox->addItem( m_somWidget, SmallIcon( "statematter" ), i18n( "State of Matter" ) ); - connect( m_toolbox, SIGNAL( currentChanged( int ) ), this, SLOT( slotToolboxCurrentChanged( int ) ) ); + connect( m_toolbox, TQT_SIGNAL( currentChanged( int ) ), this, TQT_SLOT( slotToolboxCurrentChanged( int ) ) ); moveDockWindow( m_dockWin, DockLeft ); setDockEnabled( /*m_dockWin, */DockTop, false ); setDockEnabled( /*m_dockWin, */DockBottom, false ); m_dockWin->hide(); - connect( m_dockWin, SIGNAL(visibilityChanged(bool)), this, SLOT(slotSidebarVisibilityChanged(bool))); + connect( m_dockWin, TQT_SIGNAL(visibilityChanged(bool)), this, TQT_SLOT(slotSidebarVisibilityChanged(bool))); } @@ -255,15 +255,15 @@ void Kalzium::slotShowEQSolver() #ifdef HAVE_FACILE EQChemDialog *dlg = new EQChemDialog( this ); - QWidget *page = new QWidget( dlg ); + TQWidget *page = new TQWidget( dlg ); dlg->setMainWidget( page ); - QVBoxLayout *vbox = new QVBoxLayout( page , 0, KDialogBase:: spacingHint() ); + TQVBoxLayout *vbox = new TQVBoxLayout( page , 0, KDialogBase:: spacingHint() ); eqchemView *eqsolver = new eqchemView( page ); eqsolver->setMinimumSize( 600,400 ); vbox->addWidget( eqsolver ); - connect(dlg, SIGNAL(applyClicked()), eqsolver, SLOT(compute())); + connect(dlg, TQT_SIGNAL(applyClicked()), eqsolver, TQT_SLOT(compute())); dlg->show(); #endif } @@ -398,8 +398,8 @@ void Kalzium::showSettingsDialog() //KConfigDialog didn't find an instance of this dialog, so lets create it : KConfigDialog *dialog = new KConfigDialog(this,"settings", Prefs::self()); - connect( dialog, SIGNAL( settingsChanged() ), this , SLOT( slotUpdateSettings() ) ); - connect( dialog, SIGNAL( settingsChanged() ), m_somWidget, SLOT( reloadUnits() ) ); + connect( dialog, TQT_SIGNAL( settingsChanged() ), this , TQT_SLOT( slotUpdateSettings() ) ); + connect( dialog, TQT_SIGNAL( settingsChanged() ), m_somWidget, TQT_SLOT( reloadUnits() ) ); dialog->addPage( new setColors( 0, "colors_page"), i18n("Colors"), "colorize"); dialog->addPage( new setupUnits( 0, "units_page"), i18n("Units"), "gear"); dialog->addPage( new setupMisc( 0, "miscpage" ), i18n( "Miscellaneous" ), "misc" ); @@ -440,10 +440,10 @@ void Kalzium::openInformationDialog( int number ) this, "detailedDlg" ); // Remove the selection when this dialog finishes or hides. - connect(m_infoDialog, SIGNAL(hidden()), - m_PerodicTableView, SLOT(unSelect())); - connect(m_infoDialog, SIGNAL(elementChanged(int)), - m_PerodicTableView, SLOT(selectElement(int))); + connect(m_infoDialog, TQT_SIGNAL(hidden()), + m_PerodicTableView, TQT_SLOT(unSelect())); + connect(m_infoDialog, TQT_SIGNAL(elementChanged(int)), + m_PerodicTableView, TQT_SLOT(selectElement(int))); } m_infoDialog->show(); } diff --git a/kalzium/src/kalzium.h b/kalzium/src/kalzium.h index 5837607b..aeafbcc1 100644 --- a/kalzium/src/kalzium.h +++ b/kalzium/src/kalzium.h @@ -107,7 +107,7 @@ class Kalzium : public KMainWindow /** * the layout of the central Widget ( CentralWidget ) */ - QVBoxLayout *m_pCentralLayout; + TQVBoxLayout *m_pCentralLayout; MolcalcWidget *m_calcWidget; @@ -117,8 +117,8 @@ class Kalzium : public KMainWindow DetailedGraphicalOverview *m_detailWidget; - QDockWindow *m_dockWin; - QToolBox *m_toolbox; + TQDockWindow *m_dockWin; + TQToolBox *m_toolbox; int m_toolboxCurrent; GlossaryDialog *m_glossarydlg; diff --git a/kalzium/src/kalziumdataobject.cpp b/kalzium/src/kalziumdataobject.cpp index 3d1a33bf..a759fee2 100644 --- a/kalzium/src/kalziumdataobject.cpp +++ b/kalzium/src/kalziumdataobject.cpp @@ -23,8 +23,8 @@ #include "isotope.h" #include "spectrum.h" -#include <qdom.h> -#include <qfile.h> +#include <tqdom.h> +#include <tqfile.h> #include <klocale.h> #include <kdebug.h> @@ -41,12 +41,12 @@ KalziumDataObject* KalziumDataObject::instance() KalziumDataObject::KalziumDataObject() { - QDomDocument doc( "datadocument" ); + TQDomDocument doc( "datadocument" ); KURL url; url.setPath( locate("data", "kalzium/data/")); url.setFileName( "data.xml" ); - QFile layoutFile( url.path() ); + TQFile layoutFile( url.path() ); if (!layoutFile.exists()) { @@ -86,11 +86,11 @@ Element* KalziumDataObject::element( int number ) return *( ElementList.at( number-1 ) ); } -EList KalziumDataObject::readData( QDomDocument &dataDocument ) +EList KalziumDataObject::readData( TQDomDocument &dataDocument ) { EList list; - QDomNodeList elementNodes; //the list of all element - QDomElement domElement; //a single element + TQDomNodeList elementNodes; //the list of all element + TQDomElement domElement; //a single element //read in all elements elementNodes = dataDocument.elementsByTagName( "element" ); @@ -99,7 +99,7 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) for ( uint i = 0; i < count; ++i ) {//iterate through all elements - domElement = ( const QDomElement& ) elementNodes.item( i ).toElement(); + domElement = ( const TQDomElement& ) elementNodes.item( i ).toElement(); double mass = domElement.namedItem( "mass" ).toElement().text().toDouble(); double en = domElement.namedItem( "electronegativity" ).toElement().text().toDouble(); @@ -112,7 +112,7 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) double vdw_radius = domElement.namedItem( "radius" ).namedItem( "vdw" ).toElement().text().toDouble(); double atomic_radius = domElement.namedItem( "radius" ).namedItem( "atomic" ).toElement().text().toDouble(); double ionic_radius = domElement.namedItem( "radius" ).namedItem( "ionic" ).toElement().text().toDouble(); - QString ionic_charge = domElement.namedItem( "radius" ).namedItem( "ionic" ).toElement().attributeNode( "charge" ).value(); + TQString ionic_charge = domElement.namedItem( "radius" ).namedItem( "ionic" ).toElement().attributeNode( "charge" ).value(); int bio = domElement.namedItem( "biologicalmeaning" ).toElement().text().toInt(); int radioactive = domElement.namedItem( "radioactive" ).toElement().text().toInt(); @@ -122,37 +122,37 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) int number = domElement.namedItem( "number" ).toElement().text().toInt(); int abundance = domElement.namedItem( "abundance" ).toElement().text().toInt(); - QString scientist = domElement.namedItem( "date" ).toElement().attributeNode( "scientist" ).value(); - QString crystal = domElement.namedItem( "crystalstructure" ).toElement().text(); + TQString scientist = domElement.namedItem( "date" ).toElement().attributeNode( "scientist" ).value(); + TQString crystal = domElement.namedItem( "crystalstructure" ).toElement().text(); - QDomElement nameE = domElement.namedItem( "name" ).toElement(); - QString name = nameE.text(); - QString origin = i18n( nameE.attributeNode( "origin" ).value().utf8() ); + TQDomElement nameE = domElement.namedItem( "name" ).toElement(); + TQString name = nameE.text(); + TQString origin = i18n( nameE.attributeNode( "origin" ).value().utf8() ); - QString block = domElement.namedItem( "block" ).toElement().text(); - QString group = domElement.namedItem( "group" ).toElement().text(); - QString family = domElement.namedItem( "family" ).toElement().text(); - QString orbits = domElement.namedItem( "orbits" ).toElement().text(); - QString symbol = domElement.namedItem( "symbol" ).toElement().text(); - QString oxydation = domElement.namedItem( "oxydation" ).toElement().text(); - QString acidicbehaviour = domElement.namedItem( "acidicbehaviour" ).toElement().text(); + TQString block = domElement.namedItem( "block" ).toElement().text(); + TQString group = domElement.namedItem( "group" ).toElement().text(); + TQString family = domElement.namedItem( "family" ).toElement().text(); + TQString orbits = domElement.namedItem( "orbits" ).toElement().text(); + TQString symbol = domElement.namedItem( "symbol" ).toElement().text(); + TQString oxydation = domElement.namedItem( "oxydation" ).toElement().text(); + TQString acidicbehaviour = domElement.namedItem( "acidicbehaviour" ).toElement().text(); - QDomNodeList elist = domElement.elementsByTagName( "energy" ); - QValueList<double> ionlist; + TQDomNodeList elist = domElement.elementsByTagName( "energy" ); + TQValueList<double> ionlist; for( uint i = 0; i < elist.length(); i++ ) { ionlist.append( elist.item( i ).toElement().text().toDouble() ); } //now read in all the date for the isotopes - QDomNodeList isotopelist = domElement.elementsByTagName( "isotope" ); - QValueList<Isotope*> isolist; + TQDomNodeList isotopelist = domElement.elementsByTagName( "isotope" ); + TQValueList<Isotope*> isolist; for( uint i = 0; i < isotopelist.length(); i++ ) { - QDomElement iso = isotopelist.item( i ).toElement(); + TQDomElement iso = isotopelist.item( i ).toElement(); double halflife = iso.attributeNode( "halflife" ).value().toDouble(); double weight = iso.attributeNode( "weight" ).value().toDouble(); - QString format = iso.attributeNode( "halflifeformat" ).value(); + TQString format = iso.attributeNode( "halflifeformat" ).value(); int neutrons = iso.attributeNode( "neutron" ).value().toInt(); double percentage = iso.attributeNode( "percentage" ).value().toDouble(); double alphapercentage = iso.attributeNode( "alphapercentage" ).value().toDouble(); @@ -163,8 +163,8 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) double betaplusdecay = iso.attributeNode( "betaplusdecay" ).value().toDouble(); double betaminusdecay = iso.attributeNode( "betaminusdecay" ).value().toDouble(); double ecdecay = iso.attributeNode( "ecdecay" ).value().toDouble(); - QString spin = iso.attributeNode( "spin" ).value(); - QString magmoment = iso.attributeNode( "magmoment" ).value(); + TQString spin = iso.attributeNode( "spin" ).value(); + TQString magmoment = iso.attributeNode( "magmoment" ).value(); Isotope *isotope = new Isotope( neutrons, @@ -186,7 +186,7 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) isolist.append( isotope ); } - QDomNodeList spectrumList = domElement.namedItem( "spectra" ).toElement().elementsByTagName( "spectrum" ); + TQDomNodeList spectrumList = domElement.namedItem( "spectra" ).toElement().elementsByTagName( "spectrum" ); Element *e = new Element(); e->setDate(date); @@ -234,7 +234,7 @@ EList KalziumDataObject::readData( QDomDocument &dataDocument ) for( uint i = 0; i < spectrumList.length(); i++ ) { Spectrum::band b; - QDomElement spec = spectrumList.item( i ).toElement(); + TQDomElement spec = spectrumList.item( i ).toElement(); b.intensity = spec.attributeNode( "intensity" ).value().toInt(); b.wavelength = spec.attributeNode( "wavelength" ).value().toDouble()/10.0; diff --git a/kalzium/src/kalziumdataobject.h b/kalzium/src/kalziumdataobject.h index 6d358510..e8508276 100644 --- a/kalzium/src/kalziumdataobject.h +++ b/kalzium/src/kalziumdataobject.h @@ -26,7 +26,7 @@ * @short This class contains all Element objects * * This singleton class collects all the information about the elements of the - * Periodic Table as list of Element (QValueList<Element*>). + * Periodic Table as list of Element (TQValueList<Element*>). * Use: * @code * KalziumDataObject::instance()->ElementList; @@ -48,7 +48,7 @@ class KalziumDataObject static KalziumDataObject* instance(); /** - * The list of elements in a QValueList<Element*> + * The list of elements in a TQValueList<Element*> */ EList ElementList; @@ -69,7 +69,7 @@ class KalziumDataObject KalziumDataObject(); ~KalziumDataObject(); - EList readData( QDomDocument &dataDocument ); + EList readData( TQDomDocument &dataDocument ); /** * Caching the number of elements diff --git a/kalzium/src/kalziumtip.cpp b/kalzium/src/kalziumtip.cpp index 0f053c77..ba2a8252 100644 --- a/kalzium/src/kalziumtip.cpp +++ b/kalzium/src/kalziumtip.cpp @@ -24,12 +24,12 @@ #include "kalziumutils.h" #include "element.h" -#include <qapplication.h> -#include <qpixmap.h> -#include <qimage.h> -#include <qsimplerichtext.h> -#include <qpainter.h> -#include <qdesktopwidget.h> +#include <tqapplication.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqsimplerichtext.h> +#include <tqpainter.h> +#include <tqdesktopwidget.h> #include <kdialog.h> #include <kdebug.h> @@ -38,7 +38,7 @@ #include <klocale.h> #include <kstandarddirs.h> -KalziumTip::KalziumTip( QWidget * parent, const char * name, WFlags f ) : QWidget( parent, name, f ) +KalziumTip::KalziumTip( TQWidget * parent, const char * name, WFlags f ) : TQWidget( parent, name, f ) { setFocusPolicy(NoFocus); //the widget don't get the keyboard focus setBackgroundMode(NoBackground); // widget has no background @@ -48,14 +48,14 @@ KalziumTip::KalziumTip( QWidget * parent, const char * name, WFlags f ) : QWidge m_noElemIcon = KGlobal::iconLoader()->loadIcon( "orbits", KIcon::NoGroup, 64 ); setMouseTracking(true); // receice mouse move events - connect(&m_frameTimer, SIGNAL(timeout()), SLOT(internalUpdate())); + connect(&m_frameTimer, TQT_SIGNAL(timeout()), TQT_SLOT(internalUpdate())); } -void KalziumTip::showTip( QPoint mouse, Element* element, int visibleWidth, int visibleHeight ) +void KalziumTip::showTip( TQPoint mouse, Element* element, int visibleWidth, int visibleHeight ) { - QWidget *p = 0; - if ( dynamic_cast<QWidget*>( parent() ) ) - p = static_cast<QWidget*>( parent() ); + TQWidget *p = 0; + if ( dynamic_cast<TQWidget*>( parent() ) ) + p = static_cast<TQWidget*>( parent() ); if ( p ) { @@ -99,7 +99,7 @@ void KalziumTip::showTip( QPoint mouse, Element* element, int visibleWidth, int } } -void KalziumTip::paintEvent(QPaintEvent* e) +void KalziumTip::paintEvent(TQPaintEvent* e) { if (m_dirty) { @@ -107,11 +107,11 @@ void KalziumTip::paintEvent(QPaintEvent* e) m_dirty = false; } - QPainter p(this); + TQPainter p(this); p.drawPixmap(e->rect().topLeft(), m_pixmap, e->rect()); } -void KalziumTip::mouseMoveEvent(QMouseEvent * e) +void KalziumTip::mouseMoveEvent(TQMouseEvent * e) { // delegate the mouse move event to the parent (actually the elements table) // so that this tooltip doesn't stop to be updated @@ -125,15 +125,15 @@ void KalziumTip::display() delete m_richText; - QString elementname = m_tippedElement->elname(); + TQString elementname = m_tippedElement->elname(); - QString number = i18n( "Number: %1" ) - .arg( QString::number(m_tippedElement->number()) ); + TQString number = i18n( "Number: %1" ) + .arg( TQString::number(m_tippedElement->number()) ); - QString mass = i18n( "Mass: %1" ) + TQString mass = i18n( "Mass: %1" ) .arg( KalziumUtils::localizedValue(m_tippedElement->mass(), 6) ); - m_richText = new QSimpleRichText("<qt><h1>" + elementname + "</h1><p>" + m_richText = new TQSimpleRichText("<qt><h1>" + elementname + "</h1><p>" + number + "</p><p>" + mass +"</p></qt>", font()); @@ -157,7 +157,7 @@ void KalziumTip::displayInternal() // determine text rectangel sizes - QRect textRect(0,0,0,0); + TQRect textRect(0,0,0,0); textRect.setWidth(m_richText->widthUsed()); textRect.setHeight(m_richText->height()); @@ -190,7 +190,7 @@ void KalziumTip::displayInternal() } // draw background - QPainter bufferPainter(&m_pixmap); + TQPainter bufferPainter(&m_pixmap); bufferPainter.setPen(Qt::black); bufferPainter.setBrush(backgroundColor()); bufferPainter.drawRoundRect(0, 0, width, height, @@ -206,10 +206,10 @@ void KalziumTip::displayInternal() } // draw text shadow - QColorGroup cg = colorGroup(); - cg.setColor(QColorGroup::Text, cg.background().dark(115)); - int shadowOffset = QApplication::reverseLayout() ? -1 : 1; - m_richText->draw(&bufferPainter, 5 + textX + shadowOffset, textY + 1, QRect(), cg); + TQColorGroup cg = colorGroup(); + cg.setColor(TQColorGroup::Text, cg.background().dark(115)); + int shadowOffset = TQApplication::reverseLayout() ? -1 : 1; + m_richText->draw(&bufferPainter, 5 + textX + shadowOffset, textY + 1, TQRect(), cg); // draw text cg = colorGroup(); @@ -218,7 +218,7 @@ void KalziumTip::displayInternal() void KalziumTip::dissolveMask() { - QPainter maskPainter(&m_mask); + TQPainter maskPainter(&m_mask); m_mask.fill(Qt::black); @@ -264,12 +264,12 @@ void KalziumTip::hide() { m_frameTimer.stop(); m_tippedElement = 0; - QWidget::hide(); + TQWidget::hide(); } void KalziumTip::plainMask() { - QPainter maskPainter(&m_mask); + TQPainter maskPainter(&m_mask); m_mask.fill(Qt::black); @@ -289,11 +289,11 @@ void KalziumTip::internalUpdate() void KalziumTip::loadIcon() { - QString iconpath = locate( "data" , "kalzium/elempics/" + m_tippedElement->symbol() + ".jpg" ); + TQString iconpath = locate( "data" , "kalzium/elempics/" + m_tippedElement->symbol() + ".jpg" ); if ( !iconpath.isEmpty() ) { - QImage img ( iconpath, "JPEG" ); - img = img.smoothScale ( 128, 128, QImage::ScaleMin ); + TQImage img ( iconpath, "JPEG" ); + img = img.smoothScale ( 128, 128, TQImage::ScaleMin ); m_icon.convertFromImage( img ); } diff --git a/kalzium/src/kalziumtip.h b/kalzium/src/kalziumtip.h index 425e2a7e..217717b1 100644 --- a/kalzium/src/kalziumtip.h +++ b/kalzium/src/kalziumtip.h @@ -22,9 +22,9 @@ ***************************************************************************/ -#include <qwidget.h> -#include <qbitmap.h> -#include <qtimer.h> +#include <tqwidget.h> +#include <tqbitmap.h> +#include <tqtimer.h> class QPaintEvent; class QSimpleRichText; @@ -44,19 +44,19 @@ class KalziumTip : public QWidget public: enum MaskEffect { Plain, Dissolve }; - KalziumTip( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); + KalziumTip( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ); - void showTip( QPoint, Element* element, int visibleWidth, int visibleHeight ); //show the tip + void showTip( TQPoint, Element* element, int visibleWidth, int visibleHeight ); //show the tip void hide(); // hide it protected: - void paintEvent(QPaintEvent * e); + void paintEvent(TQPaintEvent * e); void plainMask(); void dissolveMask(); // if the mouse pointer hovers us, send the event to the parent // so we are some-what 'mouse transparent' - void mouseMoveEvent(QMouseEvent * e); + void mouseMoveEvent(TQMouseEvent * e); void displayInternal(); void display(); @@ -66,19 +66,19 @@ class KalziumTip : public QWidget void internalUpdate(); private: - QBitmap m_mask; - QPoint m_mousePointer; - QPixmap m_pixmap; - QPixmap m_icon; //icon shown on the tip - QPixmap m_noElemIcon; //icon for element wich have no image + TQBitmap m_mask; + TQPoint m_mousePointer; + TQPixmap m_pixmap; + TQPixmap m_icon; //icon shown on the tip + TQPixmap m_noElemIcon; //icon for element wich have no image MaskEffect m_maskEffect; //inidicates to show mask effect or plain - QSimpleRichText* m_richText; + TQSimpleRichText* m_richText; int m_dissolveSize; int m_dissolveDelta; - QTimer m_frameTimer; //timer for the dissolve effect + TQTimer m_frameTimer; //timer for the dissolve effect bool m_dirty; //indicates repainting the tooltip internal const Element* m_tippedElement; //the element the tip is about diff --git a/kalzium/src/kalziumutils.cpp b/kalzium/src/kalziumutils.cpp index 2e4dd127..1522e495 100644 --- a/kalzium/src/kalziumutils.cpp +++ b/kalzium/src/kalziumutils.cpp @@ -15,27 +15,27 @@ #include <kdebug.h> #include <kglobal.h> #include <klocale.h> -#include <qfont.h> -#include <qrect.h> -#include <qpainter.h> -#include <qglobal.h> +#include <tqfont.h> +#include <tqrect.h> +#include <tqpainter.h> +#include <tqglobal.h> #include <math.h> #if defined(Q_OS_SOLARIS) #include <ieeefp.h> #endif -int KalziumUtils::maxSize( const QString& string, const QRect& rect, QFont font, QPainter* p, int minFontSize, int maxFontSize ) +int KalziumUtils::maxSize( const TQString& string, const TQRect& rect, TQFont font, TQPainter* p, int minFontSize, int maxFontSize ) { bool goodSizeFound = false; int size = maxFontSize; - QRect r; + TQRect r; do { font.setPointSize( size ); p->setFont( font ); - r = p->boundingRect( QRect(), Qt::AlignAuto, string ); + r = p->boundingRect( TQRect(), Qt::AlignAuto, string ); r.moveBy( rect.left(), rect.top() ); if ( rect.contains( r ) ) @@ -48,14 +48,14 @@ int KalziumUtils::maxSize( const QString& string, const QRect& rect, QFont font, return size; } -int KalziumUtils::StringHeight( const QString& string, const QFont& font, QPainter* p ) +int KalziumUtils::StringHeight( const TQString& string, const TQFont& font, TQPainter* p ) { - return p->boundingRect( QRect(), Qt::AlignAuto, string ).height(); + return p->boundingRect( TQRect(), Qt::AlignAuto, string ).height(); } -int KalziumUtils::StringWidth( const QString& string, const QFont& font, QPainter* p ) +int KalziumUtils::StringWidth( const TQString& string, const TQFont& font, TQPainter* p ) { - return p->boundingRect( QRect(), Qt::AlignAuto, string ).width(); + return p->boundingRect( TQRect(), Qt::AlignAuto, string ).width(); } double KalziumUtils::strippedValue( double num ) @@ -74,9 +74,9 @@ double KalziumUtils::strippedValue( double num ) return num * power / 10000; } -QString KalziumUtils::localizedValue( double val, int precision, unsigned long options ) +TQString KalziumUtils::localizedValue( double val, int precision, unsigned long options ) { - QString str = KGlobal::locale()->formatNumber( val, precision ); + TQString str = KGlobal::locale()->formatNumber( val, precision ); while( str.endsWith("0") ) str.truncate( str.length()-1); if ( str.endsWith( KGlobal::locale()->decimalSymbol() ) ) diff --git a/kalzium/src/kalziumutils.h b/kalzium/src/kalziumutils.h index 36f66080..f8feb10b 100644 --- a/kalzium/src/kalziumutils.h +++ b/kalzium/src/kalziumutils.h @@ -34,7 +34,7 @@ class KalziumUtils * @param maxFontSize the maximum fontsize * @param minFontSize the maximum fontsize */ - static int maxSize( const QString& string, const QRect& rect, QFont font, QPainter* painter, int minFontSize = 4, int maxFontSize = 20 ); + static int maxSize( const TQString& string, const TQRect& rect, TQFont font, TQPainter* painter, int minFontSize = 4, int maxFontSize = 20 ); /** * calculate the 4-digit value of the value @p w. For @@ -51,7 +51,7 @@ class KalziumUtils * @param options the options used for formatting of @p val * @return */ - static QString localizedValue( double val, int precision, unsigned long options = 0 ); + static TQString localizedValue( double val, int precision, unsigned long options = 0 ); /** * @param string the string which is measured @@ -59,14 +59,14 @@ class KalziumUtils * @param painter the used painter * @return the width of the string @p string */ - static int StringWidth( const QString& string, const QFont& font, QPainter* painter ); + static int StringWidth( const TQString& string, const TQFont& font, TQPainter* painter ); /** * @param string the string which is measured * @param font the used font * @param painter the used painter * @return the height of the string @p string */ - static int StringHeight( const QString& string, const QFont& font, QPainter* painter ); + static int StringHeight( const TQString& string, const TQFont& font, TQPainter* painter ); }; #endif // KALZIUMUTILS_H diff --git a/kalzium/src/molcalcwidget.cpp b/kalzium/src/molcalcwidget.cpp index c9947eda..60eb5108 100644 --- a/kalzium/src/molcalcwidget.cpp +++ b/kalzium/src/molcalcwidget.cpp @@ -36,12 +36,12 @@ #include <klineedit.h> #include <ktoolbar.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qtooltip.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqtooltip.h> -MolcalcWidget::MolcalcWidget( QWidget *parent, const char *name ) +MolcalcWidget::MolcalcWidget( TQWidget *parent, const char *name ) : MolcalcWidgetBase( parent, name ) { clear(); @@ -60,9 +60,9 @@ void MolcalcWidget::clear() resultComposition->setText( i18n("To start, enter\na formula in the\nwidget above and\nclick on 'Calc'.") ); - QToolTip::remove( resultMass ); - QToolTip::remove( resultComposition ); - QToolTip::remove( resultLabel ); + TQToolTip::remove( resultMass ); + TQToolTip::remove( resultComposition ); + TQToolTip::remove( resultLabel ); } @@ -70,11 +70,11 @@ void MolcalcWidget::updateUI() { if ( m_validInput ){ - QString str; + TQString str; // The complexString stores the whole molecule like this: // 1 Seaborgium. Cumulative Mass: 263.119 u (39.2564 %) - QString complexString; + TQString complexString; // Create the list of elements making up the molecule ElementCountMap::Iterator it = m_elementMap.begin(); @@ -102,25 +102,25 @@ void MolcalcWidget::updateUI() // The mass resultMass->setText( i18n( "Molecular mass: %1 u" ).arg( m_mass ) ); - QToolTip::add( resultMass, complexString ); - QToolTip::add( resultComposition, complexString ); - QToolTip::add( resultLabel, complexString ); + TQToolTip::add( resultMass, complexString ); + TQToolTip::add( resultComposition, complexString ); + TQToolTip::add( resultLabel, complexString ); } else{//the input was invalid, so tell this the user resultComposition->setText( i18n( "Invalid input" ) ); - resultLabel->setText( QString() ); - resultMass->setText( QString() ); + resultLabel->setText( TQString() ); + resultMass->setText( TQString() ); - QToolTip::add( resultMass, i18n( "Invalid input" ) ); - QToolTip::add( resultComposition, i18n( "Invalid input" ) ); - QToolTip::add( resultLabel, i18n( "Invalid input" ) ); + TQToolTip::add( resultMass, i18n( "Invalid input" ) ); + TQToolTip::add( resultComposition, i18n( "Invalid input" ) ); + TQToolTip::add( resultLabel, i18n( "Invalid input" ) ); } } -QString MolcalcWidget::compositionString( ElementCountMap &_map ) +TQString MolcalcWidget::compositionString( ElementCountMap &_map ) { - QString str; + TQString str; ElementCountMap::Iterator it = _map.begin(); ElementCountMap::Iterator itEnd = _map.end(); @@ -140,7 +140,7 @@ QString MolcalcWidget::compositionString( ElementCountMap &_map ) void MolcalcWidget::slotCalcButtonClicked() { - QString molecule = formulaEdit->text(); + TQString molecule = formulaEdit->text(); // Parse the molecule, and at the same time calculate the total // mass, and the composition of it. diff --git a/kalzium/src/molcalcwidget.h b/kalzium/src/molcalcwidget.h index f09157e6..c86d41d3 100644 --- a/kalzium/src/molcalcwidget.h +++ b/kalzium/src/molcalcwidget.h @@ -47,7 +47,7 @@ class MolcalcWidget : public MolcalcWidgetBase * @param parent parent widget * @param name name of this widget */ - MolcalcWidget( QWidget *parent = 0, const char *name = 0 ); + MolcalcWidget( TQWidget *parent = 0, const char *name = 0 ); protected slots: void slotCalcButtonClicked(); @@ -60,7 +60,7 @@ class MolcalcWidget : public MolcalcWidgetBase * @return the HTML code of an element symbol and its * subscripted amount. Eg: Mg<sub>2</sub> */ - QString compositionString( ElementCountMap &_map ); + TQString compositionString( ElementCountMap &_map ); /** * This methods gathers all the data and updates the diff --git a/kalzium/src/moleculeparser.cpp b/kalzium/src/moleculeparser.cpp index 183f9769..6780e65e 100644 --- a/kalzium/src/moleculeparser.cpp +++ b/kalzium/src/moleculeparser.cpp @@ -39,8 +39,8 @@ ElementCountMap::~ElementCountMap() ElementCount * ElementCountMap::search(Element *_element) { - QValueList<ElementCount *>::ConstIterator it = m_map.constBegin(); - const QValueList<ElementCount *>::ConstIterator itEnd = m_map.constEnd(); + TQValueList<ElementCount *>::ConstIterator it = m_map.constBegin(); + const TQValueList<ElementCount *>::ConstIterator itEnd = m_map.constEnd(); for (; it != itEnd; ++it) { if ((*it)->element() == _element) @@ -54,8 +54,8 @@ ElementCountMap::search(Element *_element) void ElementCountMap::add(ElementCountMap &_map) { - QValueList<ElementCount *>::ConstIterator it = _map.m_map.constBegin(); - const QValueList<ElementCount *>::ConstIterator itEnd = _map.m_map.constEnd(); + TQValueList<ElementCount *>::ConstIterator it = _map.m_map.constBegin(); + const TQValueList<ElementCount *>::ConstIterator itEnd = _map.m_map.constEnd(); // Step throught _map and for each element, add it to the current one. for (; it != itEnd; ++it) { @@ -99,7 +99,7 @@ MoleculeParser::MoleculeParser() } -MoleculeParser::MoleculeParser(const QString& _str) +MoleculeParser::MoleculeParser(const TQString& _str) : Parser(_str) { } @@ -120,7 +120,7 @@ MoleculeParser::~MoleculeParser() // This method also acts as the main loop. bool -MoleculeParser::weight(QString _moleculeString, +MoleculeParser::weight(TQString _moleculeString, double *_resultMass, ElementCountMap *_resultMap) { @@ -242,7 +242,7 @@ MoleculeParser::parseTerm(double *_resultMass, int MoleculeParser::getNextToken() { - QString elementName; + TQString elementName; #if 0 kdDebug() << "getNextToken(): Next character = " @@ -280,7 +280,7 @@ MoleculeParser::getNextToken() Element * -MoleculeParser::lookupElement( const QString& _name ) +MoleculeParser::lookupElement( const TQString& _name ) { EList elementList = KalziumDataObject::instance()->ElementList; diff --git a/kalzium/src/moleculeparser.h b/kalzium/src/moleculeparser.h index c35c71be..45b27436 100644 --- a/kalzium/src/moleculeparser.h +++ b/kalzium/src/moleculeparser.h @@ -17,8 +17,8 @@ #include "element.h" #include "parser.h" -#include <qmap.h> -#include <qvaluelist.h> +#include <tqmap.h> +#include <tqvaluelist.h> /** @@ -64,12 +64,12 @@ class ElementCountMap { void add(Element *_element, int _count); void multiply(int _factor); - typedef QValueList<ElementCount*>::Iterator Iterator; + typedef TQValueList<ElementCount*>::Iterator Iterator; Iterator begin() { return m_map.begin(); } Iterator end() { return m_map.end(); } private: - QValueList<ElementCount*> m_map; + TQValueList<ElementCount*> m_map; }; @@ -80,7 +80,7 @@ class ElementCountMap { * Usage: * @code * MoleculeParser parser; - * QString chemical_formula = "C2H5OH"; + * TQString chemical_formula = "C2H5OH"; * double weight; * * if (parser.weight(chemical_formula, &weight)) @@ -97,7 +97,7 @@ public: static const int ELEMENT_TOKEN = 300; MoleculeParser(); - MoleculeParser( const QString& _str); + MoleculeParser( const TQString& _str); ~MoleculeParser(); /** @@ -106,7 +106,7 @@ public: * * @return whether the parsing was successful or not */ - bool weight(QString _moleculeString, + bool weight(TQString _moleculeString, double *_resultMass, ElementCountMap *_resultMap); @@ -117,9 +117,9 @@ public: bool parseTerm(double *_resultMass, ElementCountMap *_resultMap); - Element *lookupElement( const QString& _name ); + Element *lookupElement( const TQString& _name ); - QMap<Element*, int> m_elementMap; + TQMap<Element*, int> m_elementMap; //if this booloean is "true" the parser found an error bool m_error; diff --git a/kalzium/src/orbitswidget.cpp b/kalzium/src/orbitswidget.cpp index f79381f0..06824c0f 100644 --- a/kalzium/src/orbitswidget.cpp +++ b/kalzium/src/orbitswidget.cpp @@ -18,13 +18,13 @@ #include <kdebug.h> //QT-Includes -#include <qpainter.h> -#include <qregexp.h> -#include <qpixmap.h> +#include <tqpainter.h> +#include <tqregexp.h> +#include <tqpixmap.h> -static QStringList hulllist; +static TQStringList hulllist; -OrbitsWidget::OrbitsWidget( QWidget *parent, const char *name) : QWidget( parent, name ) +OrbitsWidget::OrbitsWidget( TQWidget *parent, const char *name) : TQWidget( parent, name ) { if ( hulllist.count() == 0 ) { @@ -154,8 +154,8 @@ void OrbitsWidget::setElementNumber( const int num ) void OrbitsWidget::getNumberOfOrbits() { numOfElectrons.clear(); - QRegExp rxb( "\\s" ); //space - QString o = getNumber(); + TQRegExp rxb( "\\s" ); //space + TQString o = getNumber(); num = 1; int pos = 0; @@ -184,15 +184,15 @@ void OrbitsWidget::getNumberOfOrbits() } } -const QString& OrbitsWidget::getNumber() const +const TQString& OrbitsWidget::getNumber() const { return *hulllist.at( Elemno-1 ); } -void OrbitsWidget::paintEvent( QPaintEvent* ) +void OrbitsWidget::paintEvent( TQPaintEvent* ) { - QPainter DC; + TQPainter DC; DC.begin( this ); int h=height(); @@ -213,7 +213,7 @@ void OrbitsWidget::paintEvent( QPaintEvent* ) r_electron = r/20; //diameter of an electron-circle - QBrush brush( yellow ); + TQBrush brush( yellow ); int d = 2*r; //Diameter int ddx = d/(2*num);//difference to the previous circle diff --git a/kalzium/src/orbitswidget.h b/kalzium/src/orbitswidget.h index 831684d0..cd7279bf 100644 --- a/kalzium/src/orbitswidget.h +++ b/kalzium/src/orbitswidget.h @@ -19,7 +19,7 @@ ***************************************************************************/ -#include <qwidget.h> +#include <tqwidget.h> #include <math.h> /** @@ -31,7 +31,7 @@ class OrbitsWidget : public QWidget Q_OBJECT public: - OrbitsWidget( QWidget *parent=0 , const char *name =0 ); + OrbitsWidget( TQWidget *parent=0 , const char *name =0 ); void setElementNumber( const int num ); @@ -46,10 +46,10 @@ class OrbitsWidget : public QWidget */ int num; - typedef QValueList<int> intList; + typedef TQValueList<int> intList; intList numOfElectrons; - const QString& getNumber() const; + const TQString& getNumber() const; /** * @return the delta of the x-coordinate @@ -79,7 +79,7 @@ class OrbitsWidget : public QWidget void getNumberOfOrbits(); protected slots: - virtual void paintEvent( QPaintEvent* ); + virtual void paintEvent( TQPaintEvent* ); }; #endif // ORBITSWIDGET_H diff --git a/kalzium/src/parser.cpp b/kalzium/src/parser.cpp index 19364c73..d678885f 100644 --- a/kalzium/src/parser.cpp +++ b/kalzium/src/parser.cpp @@ -21,11 +21,11 @@ Parser::Parser() { - start(QString::null); + start(TQString::null); } -Parser::Parser(const QString& _str) +Parser::Parser(const TQString& _str) { start(_str); } @@ -37,7 +37,7 @@ Parser::~Parser() void -Parser::start(const QString& _str) +Parser::start(const TQString& _str) { m_str = _str; @@ -165,7 +165,7 @@ Parser::getNextChar() int Parser::skipWhitespace() { - while (QChar(m_nextChar).isSpace()) + while (TQChar(m_nextChar).isSpace()) getNextChar(); return m_nextChar; diff --git a/kalzium/src/parser.h b/kalzium/src/parser.h index f4ec68e7..84007a7c 100644 --- a/kalzium/src/parser.h +++ b/kalzium/src/parser.h @@ -14,7 +14,7 @@ #ifndef PARSER_H #define PARSER_H -#include <qstring.h> +#include <tqstring.h> /** * This is a general purpose parser originally written by Inge Wallin. @@ -31,13 +31,13 @@ public: // Extend this list in your subclass to make a more advanced parser. Parser(); - Parser(const QString& _str); + Parser(const TQString& _str); ~Parser(); /** * Start a new parse. */ - void start(const QString& _str); + void start(const TQString& _str); /** * Peek at the next character; @@ -79,7 +79,7 @@ protected: virtual int getNextToken(); private: - QString m_str; + TQString m_str; int m_index; int m_nextChar; diff --git a/kalzium/src/periodictableview.cpp b/kalzium/src/periodictableview.cpp index b466cffa..a09dcf34 100644 --- a/kalzium/src/periodictableview.cpp +++ b/kalzium/src/periodictableview.cpp @@ -29,20 +29,20 @@ #include <kpixmapeffect.h> #include <kimageeffect.h> -#include <qimage.h> -#include <qstring.h> -#include <qtooltip.h> -#include <qwhatsthis.h> -#include <qlabel.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qcursor.h> -#include <qpainter.h> -#include <qcolor.h> -#include <qrect.h> - -PerodicTableView::PerodicTableView(QWidget *parent, const char *name) - : QWidget(parent, name), m_kalziumTip(0), table(0), table2(0) +#include <tqimage.h> +#include <tqstring.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqcursor.h> +#include <tqpainter.h> +#include <tqcolor.h> +#include <tqrect.h> + +PerodicTableView::PerodicTableView(TQWidget *parent, const char *name) + : TQWidget(parent, name), m_kalziumTip(0), table(0), table2(0) { d = KalziumDataObject::instance(); @@ -51,22 +51,22 @@ PerodicTableView::PerodicTableView(QWidget *parent, const char *name) unSelect(); #if 0 - connect( this, SIGNAL( tableClicked( QPoint ) ), - this, SLOT( selectPoint( QPoint ) ) ); + connect( this, TQT_SIGNAL( tableClicked( TQPoint ) ), + this, TQT_SLOT( selectPoint( TQPoint ) ) ); #endif - connect( this, SIGNAL( ToolTip( int ) ), - this, SLOT( slotToolTip( int ) ) ); + connect( this, TQT_SIGNAL( ToolTip( int ) ), + this, TQT_SLOT( slotToolTip( int ) ) ); - connect( &HoverTimer, SIGNAL( timeout() ), - this, SLOT( slotTransientLabel() ) ); + connect( &HoverTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( slotTransientLabel() ) ); - connect( &MouseoverTimer, SIGNAL( timeout() ), - this, SLOT( slotMouseover() ) ); + connect( &MouseoverTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( slotMouseover() ) ); setMouseTracking( true ); //JH: eliminates flicker on redraw - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( TQWidget::NoBackground ); m_molcalcIsActive = false; m_showTooltip = true; @@ -119,8 +119,8 @@ PerodicTableView::PerodicTableView(QWidget *parent, const char *name) m_IUPACOLDlist.append( "7B"); m_IUPACOLDlist.append( "0"); - table = new QPixmap(); - table2 = new QPixmap(); + table = new TQPixmap(); + table2 = new TQPixmap(); m_kalziumTip = new KalziumTip( this ); @@ -170,12 +170,12 @@ void PerodicTableView::slotToolTip( int number ) m_tooltipElementNumber = number; - QWidget *p = 0; - if ( dynamic_cast<QWidget*>( parent() ) ) - p = static_cast<QWidget*>( parent() ); + TQWidget *p = 0; + if ( dynamic_cast<TQWidget*>( parent() ) ) + p = static_cast<TQWidget*>( parent() ); if( p ) - m_kalziumTip->showTip( mapFromGlobal(QCursor::pos()), + m_kalziumTip->showTip( mapFromGlobal(TQCursor::pos()), d->element(number), p->width(), p->height() ); @@ -192,7 +192,7 @@ void PerodicTableView::activateColorScheme( const int nr ) if ( m_currentScheme == PerodicTableView::NOCOLOUR ) //normal view, no colors { - const QColor color = Prefs::noscheme(); + const TQColor color = Prefs::noscheme(); while ( it != itEnd ) { ( *it )->setElementColor( color ); @@ -202,34 +202,34 @@ void PerodicTableView::activateColorScheme( const int nr ) else if ( m_currentScheme == PerodicTableView::GROUPS ) //groups view { - static QString group; + static TQString group; while ( it != itEnd ) { group = ( *it )->group(); - if (group == QString("1")) { + if (group == TQString("1")) { ( *it )->setElementColor( color_1 ); } - if (group == QString("2")){ + if (group == TQString("2")){ ( *it )->setElementColor( color_2 ); } - if (group == QString("3")){ + if (group == TQString("3")){ ( *it )->setElementColor( color_3 ); } - if (group == QString("4")){ + if (group == TQString("4")){ ( *it )->setElementColor( color_4 ); } - if (group == QString("5")){ + if (group == TQString("5")){ ( *it )->setElementColor( color_5 ); } - if (group == QString("6")){ + if (group == TQString("6")){ ( *it )->setElementColor( color_6 ); } - if (group == QString("7")){ + if (group == TQString("7")){ ( *it )->setElementColor( color_7 ); } - if (group == QString("8")){ + if (group == TQString("8")){ ( *it )->setElementColor( color_8 ); } @@ -238,21 +238,21 @@ void PerodicTableView::activateColorScheme( const int nr ) } else if ( m_currentScheme == PerodicTableView::BLOCK ) //block view { - static QString block; + static TQString block; while ( it != itEnd ) { block = (*it)->block(); - if (block == QString("s")) { + if (block == TQString("s")) { (*it)->setElementColor( color_s ); } - if (block == QString("p")) { + if (block == TQString("p")) { (*it)->setElementColor( color_p ); } - if (block == QString("d")) { + if (block == TQString("d")) { (*it)->setElementColor( color_d ); } - if (block == QString("f")) { + if (block == TQString("f")) { (*it)->setElementColor( color_f ); } ++it; @@ -260,22 +260,22 @@ void PerodicTableView::activateColorScheme( const int nr ) } else if ( m_currentScheme == PerodicTableView::ACIDIC ) //acidic beh { - static QString acidicbeh; + static TQString acidicbeh; while ( it != itEnd ) { acidicbeh = ( *it )->acidicbeh(); - if (acidicbeh == QString("0")) { + if (acidicbeh == TQString("0")) { (*it)->setElementColor( color_ac ); } - if (acidicbeh == QString("1")){ + if (acidicbeh == TQString("1")){ (*it)->setElementColor( color_ba ); } - if (acidicbeh == QString("2")){ + if (acidicbeh == TQString("2")){ (*it)->setElementColor( color_neu ); } - if (acidicbeh == QString("3")){ + if (acidicbeh == TQString("3")){ (*it)->setElementColor( color_amp ); } ++it; @@ -283,7 +283,7 @@ void PerodicTableView::activateColorScheme( const int nr ) } else if ( m_currentScheme == PerodicTableView::FAMILY ) //familiy of the element { - static QString family; + static TQString family; while ( it != itEnd ) { @@ -323,7 +323,7 @@ void PerodicTableView::activateColorScheme( const int nr ) } -void PerodicTableView::resizeEvent( QResizeEvent * /*e*/ ) +void PerodicTableView::resizeEvent( TQResizeEvent * /*e*/ ) { table->resize( width(), height() ); table2->resize( width(), height() ); @@ -334,9 +334,9 @@ void PerodicTableView::resizeEvent( QResizeEvent * /*e*/ ) update(); } -void PerodicTableView::paintEvent( QPaintEvent * /*e*/ ) +void PerodicTableView::paintEvent( TQPaintEvent * /*e*/ ) { - QPainter p; + TQPainter p; //JH: I have split the drawing into two pixmaps: table and table2. //table contains the "static" PerodicTableView table, and does not change very often. @@ -413,10 +413,10 @@ void PerodicTableView::paintCurrentSelection() // make a small gap (ELEMENTSIZE/3) over the rare earths if (m_currentPoint.y() > 7) y += ELEMENTSIZE/3; - QPainter p; + TQPainter p; p.begin(table); - QPen pen; + TQPen pen; pen.setStyle( DotLine ); pen.setWidth( 4 ); pen.setColor( Qt::blue ); @@ -431,12 +431,12 @@ void PerodicTableView::paintCurrentSelection() p.end(); } -void PerodicTableView::drawLegendToolTip( QPainter* p ) +void PerodicTableView::drawLegendToolTip( TQPainter* p ) { kdDebug() << "PerodicTableView::drawLegendToolTip()" << endl; if(!m_showLegendTooltip || !m_showLegend) return; - QString text; + TQString text; switch ( m_currentScheme ) { //No Legend drawn as only one colour is used @@ -456,19 +456,19 @@ void PerodicTableView::drawLegendToolTip( QPainter* p ) break; } - const int x1 = mapFromGlobal( QCursor::pos() ).x(); - const int y1 = mapFromGlobal( QCursor::pos() ).y(); + const int x1 = mapFromGlobal( TQCursor::pos() ).x(); + const int y1 = mapFromGlobal( TQCursor::pos() ).y(); static const int padding = 3; - QFont fB = KGlobalSettings::generalFont(); + TQFont fB = KGlobalSettings::generalFont(); fB.setPointSize( fB.pointSize() + 4 ); p->setFont( fB ); - QRect bRect( 0, 0, 1000, 1000 ); + TQRect bRect( 0, 0, 1000, 1000 ); bRect = p->boundingRect( bRect, AlignLeft|AlignTop, text ); bRect.moveBy( x1, y1 ); - QRect bRectExt = bRect; + TQRect bRectExt = bRect; bRect.moveBy( padding, padding ); bRectExt.setWidth( bRectExt.width() + 2 * padding ); bRectExt.setHeight( bRectExt.height() + 2 * padding ); @@ -492,7 +492,7 @@ void PerodicTableView::drawLegendToolTip( QPainter* p ) } p->setBrush(Qt::SolidPattern); - p->setBrush( QColor( 255, 255, 220 ) ); + p->setBrush( TQColor( 255, 255, 220 ) ); p->drawRect( bRectExt ); p->setBrush( Qt::black ); @@ -501,7 +501,7 @@ void PerodicTableView::drawLegendToolTip( QPainter* p ) p->drawText( bRect, AlignLeft|AlignTop, text ); } -void PerodicTableView::drawTimeLine( QPainter* p ) +void PerodicTableView::drawTimeLine( TQPainter* p ) { if ( !p ) return; kdDebug() << "PerodicTableView::drawTimeLine: " << m_date << endl; @@ -528,7 +528,7 @@ void PerodicTableView::drawTimeLine( QPainter* p ) } } -void PerodicTableView::drawLegend( QPainter* p ) +void PerodicTableView::drawLegend( TQPainter* p ) { if ( !p ) return; @@ -545,7 +545,7 @@ void PerodicTableView::drawLegend( QPainter* p ) * does not collide with the elements */ - QFont legendFont = KGlobalSettings::generalFont(); + TQFont legendFont = KGlobalSettings::generalFont(); legendFont.setPointSize( legendFont.pointSize() + 1 ); p->setFont( legendFont ); @@ -574,7 +574,7 @@ void PerodicTableView::drawLegend( QPainter* p ) if ( !m_currentScheme == PerodicTableView::NOCOLOUR ) p->fillRect(legendLeft, legendTop, legendWidth, legendHeight, - QColor(200, 200, 200)); + TQColor(200, 200, 200)); if ( som() ) { @@ -669,7 +669,7 @@ void PerodicTableView::drawLegend( QPainter* p ) } } -void PerodicTableView::drawNumeration( QPainter* p ) +void PerodicTableView::drawNumeration( TQPainter* p ) { if ( !p ) return; @@ -679,7 +679,7 @@ void PerodicTableView::drawNumeration( QPainter* p ) case PerodicTableView::CAS: for(int i = 0; i < 18 ; ++i ) { - p->drawText( i*ELEMENTSIZE,0 ,ELEMENTSIZE,ELEMENTSIZE, Qt::AlignCenter, QString::number(i+1)); + p->drawText( i*ELEMENTSIZE,0 ,ELEMENTSIZE,ELEMENTSIZE, Qt::AlignCenter, TQString::number(i+1)); } break; case PerodicTableView::IUPAC: @@ -698,7 +698,7 @@ void PerodicTableView::drawNumeration( QPainter* p ) } -void PerodicTableView::drawSOMPerodicTableView( QPainter* p ) +void PerodicTableView::drawSOMPerodicTableView( TQPainter* p ) { EList::ConstIterator it = d->ElementList.begin(); const EList::ConstIterator itEnd = d->ElementList.end(); @@ -713,7 +713,7 @@ void PerodicTableView::drawSOMPerodicTableView( QPainter* p ) void PerodicTableView::slotTransientLabel() { - QPoint point = ElementUnderMouse(); + TQPoint point = ElementUnderMouse(); int X = point.x(); int Y = point.y(); @@ -730,13 +730,13 @@ void PerodicTableView::slotTransientLabel() m_showLegendTooltip = false; } -void PerodicTableView::mousePressEvent( QMouseEvent *) +void PerodicTableView::mousePressEvent( TQMouseEvent *) { if( m_kalziumTip->isVisible() ) m_kalziumTip->hide(); } -void PerodicTableView::mouseMoveEvent( QMouseEvent * /*mouse*/ ) +void PerodicTableView::mouseMoveEvent( TQMouseEvent * /*mouse*/ ) { //JH: only update() if we were showing a tooltip if ( m_tooltipElementNumber || m_showLegendTooltip ) @@ -751,7 +751,7 @@ void PerodicTableView::mouseMoveEvent( QMouseEvent * /*mouse*/ ) if( m_kalziumTip->isVisible() ) { // kdDebug()<< "visible" << endl; - QPoint point = ElementUnderMouse(); + TQPoint point = ElementUnderMouse(); int X = point.x(); int Y = point.y(); @@ -781,7 +781,7 @@ bool PerodicTableView::pointerOnLegend(int X, int Y) return false; } -void PerodicTableView::mouseReleaseEvent( QMouseEvent *mouse ) +void PerodicTableView::mouseReleaseEvent( TQMouseEvent *mouse ) { ///first: find out the position int X = mouse->x()/ELEMENTSIZE; @@ -800,7 +800,7 @@ void PerodicTableView::mouseReleaseEvent( QMouseEvent *mouse ) X += 1; Y += 1; - QPoint point( X,Y ); + TQPoint point( X,Y ); emit tableClicked( point ); const int num = ElementNumber( X, Y ); @@ -846,14 +846,14 @@ int PerodicTableView::ElementNumber( int X, int Y ) void PerodicTableView::unSelect() { - m_currentPoint = QPoint(-1, -1); + m_currentPoint = TQPoint(-1, -1); // Full draw needed to redraw the select mark. setFullDraw(); update(); } -void PerodicTableView::selectPoint( const QPoint& point ) +void PerodicTableView::selectPoint( const TQPoint& point ) { kdDebug() << "PerodicTableView::selectPoint " << point << endl; @@ -871,7 +871,7 @@ void PerodicTableView::selectElement( int num ) selectPoint( d->element( num )->coords() ); } -void PerodicTableView::drawPerodicTableView( QPainter* p, bool isCrystal ) +void PerodicTableView::drawPerodicTableView( TQPainter* p, bool isCrystal ) { EList::ConstIterator it = d->ElementList.begin(); const EList::ConstIterator itEnd = d->ElementList.end(); @@ -891,12 +891,12 @@ void PerodicTableView::drawPerodicTableView( QPainter* p, bool isCrystal ) //CN This is called for *every* drawing of the table. This means //a lot overload... I would be better to chache the values in //member variables an only check if they need an update. -void PerodicTableView::calculateGradient( QPainter *p ) +void PerodicTableView::calculateGradient( TQPainter *p ) { EList::ConstIterator it = d->ElementList.begin(); const EList::ConstIterator itEnd = d->ElementList.end(); - QValueList<double> tmpList; + TQValueList<double> tmpList; switch ( m_gradientType ) { case Element::ATOMICRADIUS: @@ -955,8 +955,8 @@ void PerodicTableView::calculateGradient( QPainter *p ) break; } - QValueList<double>::iterator dit = tmpList.begin(); - const QValueList<double>::iterator ditEnd = tmpList.end(); + TQValueList<double>::iterator dit = tmpList.begin(); + const TQValueList<double>::iterator ditEnd = tmpList.end(); double tmpMin = *dit; double tmpMax = *dit; @@ -975,9 +975,9 @@ void PerodicTableView::calculateGradient( QPainter *p ) -void PerodicTableView::drawGradientPerodicTableView( QPainter *p, const double min, const double max ) +void PerodicTableView::drawGradientPerodicTableView( TQPainter *p, const double min, const double max ) { - QString title = QString::null; + TQString title = TQString::null; const double var = max-min; EList::ConstIterator it = d->ElementList.begin(); @@ -1102,10 +1102,10 @@ void PerodicTableView::drawGradientPerodicTableView( QPainter *p, const double m //int h = ELEMENTSIZE*4-5; // Create the gradient image. - QSize s( ELEMENTSIZE*7+20, 20 ); - QImage img = KImageEffect::gradient ( s, Qt::white, Qt::red, + TQSize s( ELEMENTSIZE*7+20, 20 ); + TQImage img = KImageEffect::gradient ( s, Qt::white, Qt::red, KImageEffect::HorizontalGradient ); - QPixmap pm( img ); + TQPixmap pm( img ); /** * now find the optimum stringsize for the caption @@ -1114,9 +1114,9 @@ void PerodicTableView::drawGradientPerodicTableView( QPainter *p, const double m * is a name it should be the same in all languages and be * probably always the longest string */ - QString tmp = i18n( "Gradient: van der Waals Radius" ); - QRect rect(x+5, y+50, ELEMENTSIZE*10,20); - QFont font = p->font(); + TQString tmp = i18n( "Gradient: van der Waals Radius" ); + TQRect rect(x+5, y+50, ELEMENTSIZE*10,20); + TQFont font = p->font(); int maxSize = KalziumUtils::maxSize( tmp, rect, p->font(), p, 8, 24 ); kdDebug() << "maxSize: " << maxSize << endl; font.setPointSize(maxSize); @@ -1130,24 +1130,24 @@ void PerodicTableView::drawGradientPerodicTableView( QPainter *p, const double m // FIXME: In the lines below, "30" is the max allowed text // height. This should be calculated from the font // metrics, not hard coded. - p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignRight, QString::number( min ) ); - p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignLeft, QString::number( max ) ); + p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignRight, TQString::number( min ) ); + p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignLeft, TQString::number( max ) ); } else { - p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignRight, QString::number( max ) ); - p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignLeft, QString::number( min ) ); + p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignRight, TQString::number( max ) ); + p->drawText( x+50,y+100,ELEMENTSIZE*7+20,30, Qt::AlignLeft, TQString::number( min ) ); } } -QPoint PerodicTableView::ElementUnderMouse() +TQPoint PerodicTableView::ElementUnderMouse() { - int X = mapFromGlobal( QCursor::pos() ).x()/ELEMENTSIZE; - int Y = mapFromGlobal( QCursor::pos() ).y( )-ELEMENTSIZE; + int X = mapFromGlobal( TQCursor::pos() ).x()/ELEMENTSIZE; + int Y = mapFromGlobal( TQCursor::pos() ).y( )-ELEMENTSIZE; // mind the gap over rare earth! - if (Y >= (ELEMENTSIZE*7) && Y < (ELEMENTSIZE*7+ELEMENTSIZE/3+1)) return QPoint( 0, 0 ); + if (Y >= (ELEMENTSIZE*7) && Y < (ELEMENTSIZE*7+ELEMENTSIZE/3+1)) return TQPoint( 0, 0 ); if (Y > (ELEMENTSIZE*7)) Y -= ELEMENTSIZE/3; @@ -1156,41 +1156,41 @@ QPoint PerodicTableView::ElementUnderMouse() X += 1; Y += 1; - return QPoint( X,Y ); + return TQPoint( X,Y ); } void PerodicTableView::slotMouseover() { - QPoint point = ElementUnderMouse(); + TQPoint point = ElementUnderMouse(); int num = ElementNumber( point.x(), point.y() ); if ( num ) emit MouseOver( num ); } -void PerodicTableView::drawGradientButton( QPainter *p, Element* e, double coeff, double value, double minValue ) +void PerodicTableView::drawGradientButton( TQPainter *p, Element* e, double coeff, double value, double minValue ) { if ( value >= minValue && coeff != -1.0) { - QColor c = calculateColor( coeff ); - QString v = KalziumUtils::localizedValue( KalziumUtils::strippedValue( value ), 6 ); + TQColor c = calculateColor( coeff ); + TQString v = KalziumUtils::localizedValue( KalziumUtils::strippedValue( value ), 6 ); e->drawGradient( p, v, c ); } else e->drawGradient( p, i18n("It means: Not Available. Translators: keep it as short as you can!", "N/A"), Qt::lightGray ); } -QColor PerodicTableView::calculateColor( const double coeff ) +TQColor PerodicTableView::calculateColor( const double coeff ) { - const QColor color2 = Qt::white; - const QColor color1 = Qt::red; + const TQColor color2 = Qt::white; + const TQColor color1 = Qt::red; int red = (int)( (color1.red() - color2.red()) * coeff + color2.red() ); int green = (int)( (color1.green() - color2.green()) * coeff + color2.green() ); int blue = (int)( (color1.blue() - color2.blue()) * coeff + color2.blue() ); - return QColor( red, green, blue ); + return TQColor( red, green, blue ); } void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) @@ -1204,7 +1204,7 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) { case NOCOLOUR: { - const QColor color = Prefs::noscheme(); + const TQColor color = Prefs::noscheme(); while ( it != itEnd ) { ( *it )->setElementColor( color ); @@ -1215,34 +1215,34 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) } case PerodicTableView::GROUPS: // group view { - QString group; + TQString group; while ( it != itEnd ) { group = ( *it )->group(); - if (group == QString("1")) { + if (group == TQString("1")) { ( *it )->setElementColor( color_1 ); } - if (group == QString("2")){ + if (group == TQString("2")){ ( *it )->setElementColor( color_2 ); } - if (group == QString("3")){ + if (group == TQString("3")){ ( *it )->setElementColor( color_3 ); } - if (group == QString("4")){ + if (group == TQString("4")){ ( *it )->setElementColor( color_4 ); } - if (group == QString("5")){ + if (group == TQString("5")){ ( *it )->setElementColor( color_5 ); } - if (group == QString("6")){ + if (group == TQString("6")){ ( *it )->setElementColor( color_6 ); } - if (group == QString("7")){ + if (group == TQString("7")){ ( *it )->setElementColor( color_7 ); } - if (group == QString("8")){ + if (group == TQString("8")){ ( *it )->setElementColor( color_8 ); } @@ -1253,21 +1253,21 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) } case PerodicTableView::BLOCK: //block view { - static QString block; + static TQString block; while ( it != itEnd ) { block = (*it)->block(); - if (block == QString("s")) { + if (block == TQString("s")) { (*it)->setElementColor( color_s ); } - if (block == QString("p")) { + if (block == TQString("p")) { (*it)->setElementColor( color_p ); } - if (block == QString("d")) { + if (block == TQString("d")) { (*it)->setElementColor( color_d ); } - if (block == QString("f")) { + if (block == TQString("f")) { (*it)->setElementColor( color_f ); } ++it; @@ -1277,21 +1277,21 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) } case PerodicTableView::ACIDIC: //acidic beh { - static QString acidicbeh; + static TQString acidicbeh; while ( it != itEnd ) { acidicbeh = ( *it )->acidicbeh(); - if (acidicbeh == QString("0")) { + if (acidicbeh == TQString("0")) { (*it)->setElementColor( color_ac ); } - if (acidicbeh == QString("1")){ + if (acidicbeh == TQString("1")){ (*it)->setElementColor( color_ba ); } - if (acidicbeh == QString("2")){ + if (acidicbeh == TQString("2")){ (*it)->setElementColor( color_neu ); } - if (acidicbeh == QString("3")){ + if (acidicbeh == TQString("3")){ (*it)->setElementColor( color_amp ); } ++it; @@ -1301,7 +1301,7 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) } case PerodicTableView::FAMILY: //familiy of the element { - static QString family; + static TQString family; while ( it != itEnd ) { @@ -1342,7 +1342,7 @@ void PerodicTableView::setLook( PerodicTableView::SCHEMETYPE type, int which ) } case CRYSTAL: { - QString structure; + TQString structure; while ( it != itEnd ) { structure = ( *it )->crystalstructure(); diff --git a/kalzium/src/periodictableview.h b/kalzium/src/periodictableview.h index 632f5d57..2fe89d12 100644 --- a/kalzium/src/periodictableview.h +++ b/kalzium/src/periodictableview.h @@ -29,9 +29,9 @@ class Element; class KalziumDataObject; class KalziumTip; -#include <qvaluelist.h> -#include <qwidget.h> -#include <qtimer.h> +#include <tqvaluelist.h> +#include <tqwidget.h> +#include <tqtimer.h> // A PerodicTableView is ... /** @@ -48,7 +48,7 @@ class PerodicTableView : public QWidget * @param parent parent widget * @param name name of this widget */ - PerodicTableView( QWidget *parent = 0, const char *name = 0); + PerodicTableView( TQWidget *parent = 0, const char *name = 0); ~PerodicTableView(); enum SCHEMETYPE @@ -123,7 +123,7 @@ class PerodicTableView : public QWidget /** * @return the short and descriptive name of this PerodicTableView */ - QString shortName() const{ + TQString shortName() const{ return m_ShortName; } @@ -249,7 +249,7 @@ class PerodicTableView : public QWidget /** * calculates the min and max values to prepare the painting */ - void calculateGradient( QPainter* ); + void calculateGradient( TQPainter* ); /** * @return true if the mouse is over the legend area @@ -263,14 +263,14 @@ class PerodicTableView : public QWidget * @param value the value * @param minValue the smallest of all the values */ - void drawGradientButton( QPainter* p, Element* e, double coeff, double value, double minValue ); + void drawGradientButton( TQPainter* p, Element* e, double coeff, double value, double minValue ); /** * calculates the color of an element which has a value which * is @p percentage of the maximum value. This will be the * color used in the gradient view for an element. */ - QColor calculateColor( const double percentage ); + TQColor calculateColor( const double percentage ); /** * the date used in the timeline @@ -303,7 +303,7 @@ class PerodicTableView : public QWidget /** * timer used for the tooltop */ - QTimer HoverTimer, + TQTimer HoverTimer, MouseoverTimer; KalziumDataObject *d; @@ -323,19 +323,19 @@ class PerodicTableView : public QWidget * @return the coordinates of the element under the mouseCursor. * For example, H will be 1/1 and Li will be 1/2 */ - QPoint ElementUnderMouse(); + TQPoint ElementUnderMouse(); /** * the currently selected element (the x/y-coordinates) */ - QPoint m_currentPoint; + TQPoint m_currentPoint; - void mouseReleaseEvent( QMouseEvent* ); - void mousePressEvent( QMouseEvent* ); - void mouseMoveEvent( QMouseEvent* ); + void mouseReleaseEvent( TQMouseEvent* ); + void mousePressEvent( TQMouseEvent* ); + void mouseMoveEvent( TQMouseEvent* ); - QStringList m_IUPAClist; - QStringList m_IUPACOLDlist; + TQStringList m_IUPAClist; + TQStringList m_IUPACOLDlist; /** * if the the legend will be displayed @@ -345,7 +345,7 @@ class PerodicTableView : public QWidget /** * this is a short, descriptive name of the PerodicTableView */ - QString m_ShortName; + TQString m_ShortName; /** * true if the molcalc-mode is active @@ -360,8 +360,8 @@ class PerodicTableView : public QWidget /** * implements double buffering of the widget. */ - QPixmap *table; // The basic PerodicTableView - QPixmap *table2; // Basic PerodicTableView + extra data such as tooltip, etc + TQPixmap *table; // The basic PerodicTableView + TQPixmap *table2; // Basic PerodicTableView + extra data such as tooltip, etc /** * used for bitBlit. If true the complete table will be drawn @@ -371,74 +371,74 @@ class PerodicTableView : public QWidget //I am holding all colours as member so that they don't need to //be reloaded on every reload - QColor color_s;//Blocks - QColor color_p; - QColor color_d; - QColor color_f; - QColor color_1;//Groups - QColor color_2; - QColor color_3; - QColor color_4; - QColor color_5; - QColor color_6; - QColor color_7; - QColor color_8; - QColor color_ba;//Acidic - QColor color_ac; - QColor color_neu; - QColor color_amp; - QColor c_alkalie;//Family - QColor c_rare; - QColor c_nonmetal; - QColor c_alkaline; - QColor c_other_metal; - QColor c_halogene; - QColor c_transition; - QColor c_noble_gas; - QColor c_metalloid; - QColor c_liquid; - QColor c_solid; - QColor c_vapor; + TQColor color_s;//Blocks + TQColor color_p; + TQColor color_d; + TQColor color_f; + TQColor color_1;//Groups + TQColor color_2; + TQColor color_3; + TQColor color_4; + TQColor color_5; + TQColor color_6; + TQColor color_7; + TQColor color_8; + TQColor color_ba;//Acidic + TQColor color_ac; + TQColor color_neu; + TQColor color_amp; + TQColor c_alkalie;//Family + TQColor c_rare; + TQColor c_nonmetal; + TQColor c_alkaline; + TQColor c_other_metal; + TQColor c_halogene; + TQColor c_transition; + TQColor c_noble_gas; + TQColor c_metalloid; + TQColor c_liquid; + TQColor c_solid; + TQColor c_vapor; protected: - virtual void paintEvent( QPaintEvent *e ); + virtual void paintEvent( TQPaintEvent *e ); /** * draw the tooltip for the legend */ - virtual void drawLegendToolTip( QPainter *p ); + virtual void drawLegendToolTip( TQPainter *p ); - virtual void drawTimeLine( QPainter *p ); + virtual void drawTimeLine( TQPainter *p ); /** * called if the user resized the table */ - virtual void resizeEvent( QResizeEvent *e ); + virtual void resizeEvent( TQResizeEvent *e ); /** * the central place for the drawing of the table */ - virtual void drawPerodicTableView( QPainter* p, bool isCrystal ); + virtual void drawPerodicTableView( TQPainter* p, bool isCrystal ); /** * draw a gradient of the type @p type */ - virtual void drawGradientPerodicTableView( QPainter* p, const double min, const double max ); + virtual void drawGradientPerodicTableView( TQPainter* p, const double min, const double max ); /** * draw the state of matter */ - virtual void drawSOMPerodicTableView( QPainter* p ); + virtual void drawSOMPerodicTableView( TQPainter* p ); /** * draw the legend */ - virtual void drawLegend( QPainter* p ); + virtual void drawLegend( TQPainter* p ); /** * draw the numeration */ - virtual void drawNumeration( QPainter* p ); + virtual void drawNumeration( TQPainter* p ); public slots: /** @@ -481,7 +481,7 @@ class PerodicTableView : public QWidget /** * this slot updates the currently selected point */ - void selectPoint( const QPoint& point ); + void selectPoint( const TQPoint& point ); /** * this slot updates the element given in the @p num @@ -499,7 +499,7 @@ class PerodicTableView : public QWidget /** * this signal is emitted when the table is clicked */ - void tableClicked(QPoint); + void tableClicked(TQPoint); /** * this signal is emitted when an element is clicked diff --git a/kalzium/src/plotwidget.cpp b/kalzium/src/plotwidget.cpp index 3a6f8530..2619b504 100644 --- a/kalzium/src/plotwidget.cpp +++ b/kalzium/src/plotwidget.cpp @@ -19,27 +19,27 @@ #include <kdebug.h> //QT-Includes -#include <qpainter.h> +#include <tqpainter.h> PlotWidget::PlotWidget( double x1, double x2, double y1, double y2, - QWidget *parent, + TQWidget *parent, const char* name) : KPlotWidget( x1, x2, y1, y2, parent, name ) { m_connectPoints = false; } -void PlotWidget::drawObjects( QPainter *p ) +void PlotWidget::drawObjects( TQPainter *p ) { // let the KPlotWidget draw the default stuff first KPlotWidget::drawObjects(p); // then draw the connecting lines if (!m_connectPoints) return; // bail out if connect points is not enabled - QPoint old; // used to remember last coordinates + TQPoint old; // used to remember last coordinates bool first = true; for ( KPlotObject *po = ObjectList.first(); po; po = ObjectList.next() ) { @@ -49,11 +49,11 @@ void PlotWidget::drawObjects( QPainter *p ) if (po->type() != KPlotObject::POINTS) continue; // draw the connecting lines - p->setPen( QColor( po->color() ) ); - p->setBrush( QColor( po->color() ) ); + p->setPen( TQColor( po->color() ) ); + p->setBrush( TQColor( po->color() ) ); for ( DPoint *dp = po->points()->first(); dp; dp = po->points()->next() ) { - QPoint q = dp->qpoint( PixRect, DataRect ); + TQPoint q = dp->qpoint( PixRect, DataRect ); if ( first ) first = false; diff --git a/kalzium/src/plotwidget.h b/kalzium/src/plotwidget.h index 5a0ccd61..44591f39 100644 --- a/kalzium/src/plotwidget.h +++ b/kalzium/src/plotwidget.h @@ -26,7 +26,7 @@ class PlotWidget : public KPlotWidget Q_OBJECT public: - PlotWidget( double x1 = 0.0, double x2 = 0.0, double y1 = 0.0, double y2 = 0.0, QWidget *parent=0 , const char *name =0 ); + PlotWidget( double x1 = 0.0, double x2 = 0.0, double y1 = 0.0, double y2 = 0.0, TQWidget *parent=0 , const char *name =0 ); /** * toggles if the points will be connected with @@ -47,7 +47,7 @@ class PlotWidget : public KPlotWidget /** * draws the objects */ - virtual void drawObjects( QPainter *p); + virtual void drawObjects( TQPainter *p); }; diff --git a/kalzium/src/somwidget_impl.cpp b/kalzium/src/somwidget_impl.cpp index ae1c19d8..6e3f4b71 100644 --- a/kalzium/src/somwidget_impl.cpp +++ b/kalzium/src/somwidget_impl.cpp @@ -13,11 +13,11 @@ #include "somwidget_impl.h" -#include <qlabel.h> -#include <qpair.h> -#include <qslider.h> -#include <qtextedit.h> -#include <qvaluelist.h> +#include <tqlabel.h> +#include <tqpair.h> +#include <tqslider.h> +#include <tqtextedit.h> +#include <tqvaluelist.h> #include <kdebug.h> #include <knuminput.h> @@ -30,7 +30,7 @@ #include "prefs.h" #include "tempunit.h" -SOMWidgetIMPL::SOMWidgetIMPL( QWidget *parent, const char* name ) +SOMWidgetIMPL::SOMWidgetIMPL( TQWidget *parent, const char* name ) : SOMWidget( parent,name ) { m_list = KalziumDataObject::instance()->ElementList; @@ -39,18 +39,18 @@ SOMWidgetIMPL::SOMWidgetIMPL( QWidget *parent, const char* name ) text->setTextFormat( Qt::RichText ); text->setReadOnly( true ); text->setPaletteBackgroundColor( paletteBackgroundColor() ); - text->setFrameStyle( QFrame::NoFrame ); + text->setFrameStyle( TQFrame::NoFrame ); m_htmlBegin = "<qt>"; m_htmlEnd = "</qt>"; m_prevUnit = Prefs::temperature(); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( spinValueChanged( double ) ) ); - connect( temp_slider, SIGNAL( valueChanged( int ) ), - this, SLOT( sliderValueChanged( int ) ) ); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( setNewTemp( double ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( spinValueChanged( double ) ) ); + connect( temp_slider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( sliderValueChanged( int ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( setNewTemp( double ) ) ); reloadUnits(); } @@ -71,40 +71,40 @@ kdDebug() << "min: " << Number1->minValue() << " - max: " << Number1->maxValue() void SOMWidgetIMPL::sliderValueChanged( int temp ) { // TODO check if in Qt4 the RangeControl emits the signal again - disconnect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( spinValueChanged( double ) ) ); - disconnect( temp_slider, SIGNAL( valueChanged( int ) ), - this, SLOT( sliderValueChanged( int ) ) ); - disconnect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( setNewTemp( double ) ) ); + disconnect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( spinValueChanged( double ) ) ); + disconnect( temp_slider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( sliderValueChanged( int ) ) ); + disconnect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( setNewTemp( double ) ) ); double newvalue = TempUnit::convert( (double)temp, (int)TempUnit::Kelvin, Prefs::temperature() ); Number1->setValue( newvalue ); setNewTemp( newvalue ); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( spinValueChanged( double ) ) ); - connect( temp_slider, SIGNAL( valueChanged( int ) ), - this, SLOT( sliderValueChanged( int ) ) ); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( setNewTemp( double ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( spinValueChanged( double ) ) ); + connect( temp_slider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( sliderValueChanged( int ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( setNewTemp( double ) ) ); } void SOMWidgetIMPL::spinValueChanged( double temp ) { - disconnect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( spinValueChanged( double ) ) ); - disconnect( temp_slider, SIGNAL( valueChanged( int ) ), - this, SLOT( sliderValueChanged( int ) ) ); - disconnect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( setNewTemp( double ) ) ); + disconnect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( spinValueChanged( double ) ) ); + disconnect( temp_slider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( sliderValueChanged( int ) ) ); + disconnect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( setNewTemp( double ) ) ); int newvalue = (int)TempUnit::convert( temp, Prefs::temperature(), (int)TempUnit::Kelvin ); temp_slider->setValue( newvalue ); setNewTemp( temp ); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( spinValueChanged( double ) ) ); - connect( temp_slider, SIGNAL( valueChanged( int ) ), - this, SLOT( sliderValueChanged( int ) ) ); - connect( Number1, SIGNAL( valueChanged( double ) ), - this, SLOT( setNewTemp( double ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( spinValueChanged( double ) ) ); + connect( temp_slider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( sliderValueChanged( int ) ) ); + connect( Number1, TQT_SIGNAL( valueChanged( double ) ), + this, TQT_SLOT( setNewTemp( double ) ) ); } void SOMWidgetIMPL::setNewTemp( double newtemp ) @@ -113,13 +113,13 @@ void SOMWidgetIMPL::setNewTemp( double newtemp ) double temp = TempUnit::convert( newtemp, Prefs::temperature(), (int)TempUnit::Kelvin ); - QValueList<Element*>::ConstIterator it = m_list.begin(); - const QValueList<Element*>::ConstIterator itEnd = m_list.end(); + TQValueList<Element*>::ConstIterator it = m_list.begin(); + const TQValueList<Element*>::ConstIterator itEnd = m_list.end(); - QStringList listMeltingPoint; - QStringList listBoilingPoint; - QStringList listBoilingPointValue; - QStringList listMeltingPointValue; + TQStringList listMeltingPoint; + TQStringList listBoilingPoint; + TQStringList listBoilingPointValue; + TQStringList listMeltingPointValue; for ( ; it != itEnd; ++it ) { if ( ( ( *it )->melting() > 0.0 ) && fabs( ( *it )->melting() - temp ) <= threshold ) @@ -133,7 +133,7 @@ void SOMWidgetIMPL::setNewTemp( double newtemp ) listBoilingPointValue << ( *it )->adjustUnits( Element::BOILINGPOINT ); } } - QString htmlcode; + TQString htmlcode; if ( listMeltingPoint.count() > 0 ) { htmlcode += i18n( "Elements with melting point around this temperature:" ) + "<br>"; diff --git a/kalzium/src/somwidget_impl.h b/kalzium/src/somwidget_impl.h index 0c61c355..ab616f54 100644 --- a/kalzium/src/somwidget_impl.h +++ b/kalzium/src/somwidget_impl.h @@ -22,7 +22,7 @@ class Element; * @author Carsten Niehaus * @author Pino Toscano * - * The SOMWidgetIMPL provides a QSlider. When this slider is moved, + * The SOMWidgetIMPL provides a TQSlider. When this slider is moved, * this widget will display which elements have a boiling or melting * point near the temperature the user entered using the slider. */ @@ -35,7 +35,7 @@ class SOMWidgetIMPL : public SOMWidget * @param parent The parent of this widget * @param name The name of this widget */ - SOMWidgetIMPL( QWidget *parent = 0, const char* name = 0 ); + SOMWidgetIMPL( TQWidget *parent = 0, const char* name = 0 ); public slots: /** @@ -44,9 +44,9 @@ class SOMWidgetIMPL : public SOMWidget void reloadUnits(); private: - QValueList<Element*> m_list; - QString m_htmlBegin; - QString m_htmlEnd; + TQValueList<Element*> m_list; + TQString m_htmlBegin; + TQString m_htmlEnd; int m_prevUnit; private slots: diff --git a/kalzium/src/spectrum.cpp b/kalzium/src/spectrum.cpp index 4b74eadb..dc8abb01 100644 --- a/kalzium/src/spectrum.cpp +++ b/kalzium/src/spectrum.cpp @@ -28,8 +28,8 @@ double Spectrum::minBand() { double value = ( *m_bandlist.begin() ).wavelength; - QValueList<band>::const_iterator it = m_bandlist.begin(); - const QValueList<band>::const_iterator itEnd = m_bandlist.end(); + TQValueList<band>::const_iterator it = m_bandlist.begin(); + const TQValueList<band>::const_iterator itEnd = m_bandlist.end(); for (;it!=itEnd;++it) { if ( value > ( *it ).wavelength ) @@ -41,8 +41,8 @@ double Spectrum::minBand() double Spectrum::maxBand() { double value = ( *m_bandlist.begin() ).wavelength; - QValueList<band>::const_iterator it = m_bandlist.begin(); - const QValueList<band>::const_iterator itEnd = m_bandlist.end(); + TQValueList<band>::const_iterator it = m_bandlist.begin(); + const TQValueList<band>::const_iterator itEnd = m_bandlist.end(); for (;it!=itEnd;++it) { if ( value < ( *it ).wavelength ) @@ -56,8 +56,8 @@ Spectrum* Spectrum::adjustToWavelength( double min, double max ) { Spectrum *spec = new Spectrum(); - QValueList<band>::const_iterator it = m_bandlist.begin(); - const QValueList<band>::const_iterator itEnd = m_bandlist.end(); + TQValueList<band>::const_iterator it = m_bandlist.begin(); + const TQValueList<band>::const_iterator itEnd = m_bandlist.end(); for ( ; it != itEnd; ++it ) { @@ -75,8 +75,8 @@ Spectrum* Spectrum::adjustToWavelength( double min, double max ) void Spectrum::adjustIntensities() { int maxInt = 0; - QValueList<band>::Iterator it = m_bandlist.begin(); - const QValueList<band>::Iterator itEnd = m_bandlist.end(); + TQValueList<band>::Iterator it = m_bandlist.begin(); + const TQValueList<band>::Iterator itEnd = m_bandlist.end(); //find the highest intensity for ( ; it != itEnd; ++it ) @@ -101,12 +101,12 @@ void Spectrum::adjustIntensities() } } -QValueList<double> Spectrum::wavelengths( double min, double max ) +TQValueList<double> Spectrum::wavelengths( double min, double max ) { - QValueList<double> list; + TQValueList<double> list; - QValueList<band>::const_iterator it = m_bandlist.begin(); - const QValueList<band>::const_iterator itEnd = m_bandlist.end(); + TQValueList<band>::const_iterator it = m_bandlist.begin(); + const TQValueList<band>::const_iterator itEnd = m_bandlist.end(); for ( ; it != itEnd; ++it ) { @@ -119,17 +119,17 @@ QValueList<double> Spectrum::wavelengths( double min, double max ) return list; } -QString Spectrum::bandsAsHtml() +TQString Spectrum::bandsAsHtml() { - QString html = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head><title>Chemical data</title>i<body>"; + TQString html = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html><head><title>Chemical data</title>i<body>"; html += "<table>"; - QValueList<band>::const_iterator it = m_bandlist.begin(); - const QValueList<band>::const_iterator itEnd = m_bandlist.end(); + TQValueList<band>::const_iterator it = m_bandlist.begin(); + const TQValueList<band>::const_iterator itEnd = m_bandlist.end(); for (;it!=itEnd;++it) { - html += QString( "<tr>" ) + html += TQString( "<tr>" ) + "<td>" + i18n( "Wavelength: %1 nm" ).arg( ( *it ).wavelength ) + "</td>" + "<td>" + i18n( "Intensity: %1" ).arg( ( *it ).intensity ) + "</td>" + "<td>" + i18n( "Probability: %1 10<sup>8</sup>s<sup>-1</sup>" ).arg( ( *it ).aki ) + "</td>" diff --git a/kalzium/src/spectrum.h b/kalzium/src/spectrum.h index 7578973d..ca6bcdac 100644 --- a/kalzium/src/spectrum.h +++ b/kalzium/src/spectrum.h @@ -21,8 +21,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> class QPixmap; class Element; @@ -66,12 +66,12 @@ class Spectrum ///relative. The highest is per definition 1000 int intensity; - QString electronconfig1; - QString electronconfig2; - QString term1; - QString term2; - QString J1; - QString J2; + TQString electronconfig1; + TQString electronconfig2; + TQString term1; + TQString term2; + TQString J1; + TQString J2; }; /** @@ -103,9 +103,9 @@ class Spectrum * @param min the lowest allowed wavalength in nanometer * @param max the highest allowed wavalength in nanometer * - * @return the wavelength in a QValueList<double> + * @return the wavelength in a TQValueList<double> */ - QValueList<double> wavelengths( double min, double max ); + TQValueList<double> wavelengths( double min, double max ); /** * @return the smallest wavelength @@ -124,7 +124,7 @@ class Spectrum /** * @return the list of bands of the spectrum */ - QValueList<band>* bandlist(){ + TQValueList<band>* bandlist(){ return &m_bandlist; } @@ -140,7 +140,7 @@ class Spectrum /** * @return the data of a spectrum as HTML code */ - QString bandsAsHtml(); + TQString bandsAsHtml(); /** * @return the parent element of this spectrum @@ -162,7 +162,7 @@ class Spectrum /** * the internal dataset */ - QValueList<band> m_bandlist; + TQValueList<band> m_bandlist; /** * the cached values of the highest and lowest wavelength diff --git a/kalzium/src/spectrumviewimpl.cpp b/kalzium/src/spectrumviewimpl.cpp index b7a3b479..89bc36ac 100644 --- a/kalzium/src/spectrumviewimpl.cpp +++ b/kalzium/src/spectrumviewimpl.cpp @@ -12,7 +12,7 @@ ***************************************************************************/ #include "spectrumviewimpl.h" -#include <qspinbox.h> +#include <tqspinbox.h> #include <kfiledialog.h> #include <kguiitem.h> @@ -22,7 +22,7 @@ #include "exporter.h" -SpectrumViewImpl::SpectrumViewImpl( QWidget *parent, const char* name ) +SpectrumViewImpl::SpectrumViewImpl( TQWidget *parent, const char* name ) : SpectrumView( parent, name ) { resize( minimumSizeHint() ); @@ -34,8 +34,8 @@ SpectrumViewImpl::SpectrumViewImpl( QWidget *parent, const char* name ) void SpectrumViewImpl::slotExportAsImage() { Exporter* exporter = new Exporter(); - QString fileName = KFileDialog::getSaveFileName( - QString::null, exporter->supportedImageFormats(), + TQString fileName = KFileDialog::getSaveFileName( + TQString::null, exporter->supportedImageFormats(), this, i18n( "Save Spectrum" ) ); if( !fileName.isEmpty() ) { diff --git a/kalzium/src/spectrumviewimpl.h b/kalzium/src/spectrumviewimpl.h index 131a602c..ed02db85 100644 --- a/kalzium/src/spectrumviewimpl.h +++ b/kalzium/src/spectrumviewimpl.h @@ -29,7 +29,7 @@ class SpectrumViewImpl : public SpectrumView * @param parent the parent widget * @param name the name used internally */ - SpectrumViewImpl( QWidget* parent, const char* name ); + SpectrumViewImpl( TQWidget* parent, const char* name ); /** * sets the spectrum to @p spec diff --git a/kalzium/src/spectrumwidget.cpp b/kalzium/src/spectrumwidget.cpp index 5531163c..54f70972 100644 --- a/kalzium/src/spectrumwidget.cpp +++ b/kalzium/src/spectrumwidget.cpp @@ -28,18 +28,18 @@ #include <klocale.h> #include <math.h> -#include <qcursor.h> -#include <qsizepolicy.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qtooltip.h> +#include <tqcursor.h> +#include <tqsizepolicy.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqtooltip.h> -#include <qglobal.h> +#include <tqglobal.h> #if defined(Q_OS_SOLARIS) #include <ieeefp.h> #endif -SpectrumWidget::SpectrumWidget( QWidget *parent, const char* name ) : QWidget( parent, name ) +SpectrumWidget::SpectrumWidget( TQWidget *parent, const char* name ) : TQWidget( parent, name ) { startValue = 0; endValue = 0; @@ -57,11 +57,11 @@ SpectrumWidget::SpectrumWidget( QWidget *parent, const char* name ) : QWidget( p setType( EmissionSpectrum ); setMinimumSize( 400, 230 ); - setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); + setSizePolicy( TQSizePolicy::Expanding, TQSizePolicy::Expanding ); setBackgroundMode( NoBackground ); } -void SpectrumWidget::paintEvent( QPaintEvent * /*e*/ ) +void SpectrumWidget::paintEvent( TQPaintEvent * /*e*/ ) { if ( !m_spectrum ) return; @@ -69,7 +69,7 @@ void SpectrumWidget::paintEvent( QPaintEvent * /*e*/ ) m_pixmap.resize( width(), height() ); m_pixmap.fill( this, width(), height() ); - QPainter p; + TQPainter p; p.begin( &m_pixmap, this ); p.fillRect( 0, 0, width(), m_realHeight, Qt::black ); @@ -87,7 +87,7 @@ void SpectrumWidget::paintEvent( QPaintEvent * /*e*/ ) bitBlt( this, 0, 0, &m_pixmap ); } -void SpectrumWidget::drawZoomLine( QPainter* p ) +void SpectrumWidget::drawZoomLine( TQPainter* p ) { p->setPen( Qt::white ); p->drawLine( m_LMBPointPress.x(), m_LMBPointPress.y(), m_LMBPointCurrent.x(), m_LMBPointPress.y() ); @@ -96,7 +96,7 @@ void SpectrumWidget::drawZoomLine( QPainter* p ) } -void SpectrumWidget::paintBands( QPainter* p ) +void SpectrumWidget::paintBands( TQPainter* p ) { if ( m_type == AbsorptionSpectrum ) { @@ -114,7 +114,7 @@ void SpectrumWidget::paintBands( QPainter* p ) int x = 0; int temp = 0; - for ( QValueList<Spectrum::band>::Iterator it = m_spectrum->bandlist()->begin(); + for ( TQValueList<Spectrum::band>::Iterator it = m_spectrum->bandlist()->begin(); it != m_spectrum->bandlist()->end(); ++it ) { @@ -145,12 +145,12 @@ void SpectrumWidget::paintBands( QPainter* p ) } } -QColor SpectrumWidget::linecolor( double spectrum ) +TQColor SpectrumWidget::linecolor( double spectrum ) { int r,g,b; wavelengthToRGB( spectrum, r,g,b ); - QColor c( r,g,b ); + TQColor c( r,g,b ); return c; } @@ -226,7 +226,7 @@ int SpectrumWidget::Adjust( double color, double factor ) return qRound( IntensityMax * pow( color*factor, Gamma ) ); } -void SpectrumWidget::drawTickmarks( QPainter* p ) +void SpectrumWidget::drawTickmarks( TQPainter* p ) { //the size of the text on the tickmarks const int space = 20; @@ -259,7 +259,7 @@ void SpectrumWidget::drawTickmarks( QPainter* p ) } } -void SpectrumWidget::keyPressEvent( QKeyEvent *e ) +void SpectrumWidget::keyPressEvent( TQKeyEvent *e ) { kdDebug() << "SpectrumWidget::keyPressEvent()" << endl; switch ( e->key() ) @@ -312,17 +312,17 @@ void SpectrumWidget::slotZoomIn() kdDebug() << "SpectrumWidget::slotZoomIn() "<< startValue << ":: "<< endValue << endl; } -void SpectrumWidget::mouseMoveEvent( QMouseEvent *e ) +void SpectrumWidget::mouseMoveEvent( TQMouseEvent *e ) { m_LMBPointCurrent = e->pos(); update(); } -void SpectrumWidget::mousePressEvent( QMouseEvent *e ) +void SpectrumWidget::mousePressEvent( TQMouseEvent *e ) { - if ( e->button() == QMouseEvent::LeftButton ) + if ( e->button() == TQMouseEvent::LeftButton ) m_LMBPointPress = e->pos(); - if ( e->button() == QMouseEvent::RightButton ) + if ( e->button() == TQMouseEvent::RightButton ) slotZoomOut(); //FIXME //the tooltip is not really working. Better to not have it @@ -334,8 +334,8 @@ void SpectrumWidget::PrepareTooltip( double wavelength ) { Spectrum::band band; - QValueList<Spectrum::band>::const_iterator it = m_spectrum->bandlist()->begin(); - const QValueList<Spectrum::band>::const_iterator itEnd = m_spectrum->bandlist()->end(); + TQValueList<Spectrum::band>::const_iterator it = m_spectrum->bandlist()->begin(); + const TQValueList<Spectrum::band>::const_iterator itEnd = m_spectrum->bandlist()->end(); //find the difference in percent (1.0 is 100%, 0.1 is 10%) double dif = 0.0; @@ -374,10 +374,10 @@ void SpectrumWidget::PrepareTooltip( double wavelength ) update(); } -void SpectrumWidget::drawTooltip( QPainter *p ) +void SpectrumWidget::drawTooltip( TQPainter *p ) { p->setPen( Qt::white ); - QPoint pt = mapFromGlobal( QCursor::pos() ); + TQPoint pt = mapFromGlobal( TQCursor::pos() ); p->drawText( pt, i18n("Wavelength: %1").arg(m_band.wavelength) ); pt.setY( pt.y() + 15 ); p->drawText( pt, i18n("Intensity: %1").arg(m_band.intensity) ); @@ -389,9 +389,9 @@ void SpectrumWidget::drawTooltip( QPainter *p ) p->drawText( pt, i18n("J 1, J 2: %1, %2").arg(m_band.J1).arg( m_band.J2 )); } -void SpectrumWidget::mouseReleaseEvent( QMouseEvent *e ) +void SpectrumWidget::mouseReleaseEvent( TQMouseEvent *e ) { - if ( e->button() == QMouseEvent::LeftButton ) + if ( e->button() == TQMouseEvent::LeftButton ) { int left = (int)Wavelength( ( double )m_LMBPointPress.x()/width() ); int right = (int)Wavelength( ( double )e->pos().x()/width() ); @@ -409,17 +409,17 @@ void SpectrumWidget::mouseReleaseEvent( QMouseEvent *e ) m_LMBPointCurrent.setX( -1 ); } -QPixmap SpectrumWidget::pixmap() +TQPixmap SpectrumWidget::pixmap() { - QPixmap tmp( m_pixmap ); - QString text; + TQPixmap tmp( m_pixmap ); + TQString text; if( m_type == EmissionSpectrum ) text = i18n( "Emission spectrum of %1" ).arg( m_spectrum->parentElement()->elname() ); else text = i18n( "Absorption spectrum of %1" ).arg( m_spectrum->parentElement()->elname() ); - QPainter p( &tmp ); + TQPainter p( &tmp ); p.setPen( Qt::black ); p.drawText( 30, m_realHeight + 70, text ); diff --git a/kalzium/src/spectrumwidget.h b/kalzium/src/spectrumwidget.h index 84a6fd80..c29e433c 100644 --- a/kalzium/src/spectrumwidget.h +++ b/kalzium/src/spectrumwidget.h @@ -21,9 +21,9 @@ #ifndef SPECTRUMWIDGET_H #define SPECTRUMWIDGET_H -#include <qwidget.h> +#include <tqwidget.h> -#include <qpixmap.h> +#include <tqpixmap.h> #include "spectrum.h" @@ -36,7 +36,7 @@ class SpectrumWidget : public QWidget Q_OBJECT public: - SpectrumWidget( QWidget *parent, const char* name = 0 ); + SpectrumWidget( TQWidget *parent, const char* name = 0 ); ~SpectrumWidget(){} @@ -76,7 +76,7 @@ class SpectrumWidget : public QWidget * find the nearest band. The returned value is the number * of pixel the next band is away */ - int findNearestBand( QValueList<double>::iterator it ); + int findNearestBand( TQValueList<double>::iterator it ); /** * there are several possible types. @@ -107,7 +107,7 @@ class SpectrumWidget : public QWidget * @returns the color of a line * @param spectrum the value of the spectrum */ - QColor linecolor( double spectrum ); + TQColor linecolor( double spectrum ); double Gamma; int IntensityMax; @@ -152,29 +152,29 @@ class SpectrumWidget : public QWidget */ void wavelengthToRGB( double wavelength, int& r, int& g, int& b ); - QPixmap pixmap(); + TQPixmap pixmap(); private: - QValueList<double> m_spectra; + TQValueList<double> m_spectra; SpectrumType m_type; Spectrum *m_spectrum; - QPixmap m_pixmap; + TQPixmap m_pixmap; bool m_showtooltip; Spectrum::band m_band; - void paintBands( QPainter* p ); - void drawZoomLine( QPainter* p ); - void drawTooltip( QPainter *p ); + void paintBands( TQPainter* p ); + void drawZoomLine( TQPainter* p ); + void drawTooltip( TQPainter *p ); /** * Draw the scale */ - void drawTickmarks( QPainter *p ); + void drawTickmarks( TQPainter *p ); double startValue; double endValue; @@ -182,13 +182,13 @@ class SpectrumWidget : public QWidget int m_realHeight; /** - * this QPoint stores the information where + * this TQPoint stores the information where * the left mouse button has been pressed. This * is used for the mouse zooming */ - QPoint m_LMBPointPress; + TQPoint m_LMBPointPress; - QPoint m_LMBPointCurrent; + TQPoint m_LMBPointCurrent; public slots: /** @@ -224,11 +224,11 @@ class SpectrumWidget : public QWidget void slotZoomOut(); protected: - virtual void paintEvent( QPaintEvent *e ); - virtual void keyPressEvent(QKeyEvent *e); - virtual void mouseMoveEvent( QMouseEvent *e ); - virtual void mousePressEvent( QMouseEvent *e ); - virtual void mouseReleaseEvent( QMouseEvent *e ); + virtual void paintEvent( TQPaintEvent *e ); + virtual void keyPressEvent(TQKeyEvent *e); + virtual void mouseMoveEvent( TQMouseEvent *e ); + virtual void mousePressEvent( TQMouseEvent *e ); + virtual void mouseReleaseEvent( TQMouseEvent *e ); }; #endif // SPECTRUMWIDGET_H diff --git a/kalzium/src/tempunit.cpp b/kalzium/src/tempunit.cpp index 55d3630f..a4e18ef7 100644 --- a/kalzium/src/tempunit.cpp +++ b/kalzium/src/tempunit.cpp @@ -75,20 +75,20 @@ double TempUnit::convert( const double value, int from, int to ) return convert( value, (TempUnit::Unit)from, (TempUnit::Unit)to ); } -QStringList TempUnit::unitListSymbols() +TQStringList TempUnit::unitListSymbols() { - QStringList list; + TQStringList list; list << "K"; - list << QString::fromUtf8("°C"); - list << QString::fromUtf8("°F"); - list << QString::fromUtf8("°Ra"); - list << QString::fromUtf8("°R"); + list << TQString::fromUtf8("°C"); + list << TQString::fromUtf8("°F"); + list << TQString::fromUtf8("°Ra"); + list << TQString::fromUtf8("°R"); return list; } -QString TempUnit::unitListSymbol( int i ) +TQString TempUnit::unitListSymbol( int i ) { - QStringList l = unitListSymbols(); + TQStringList l = unitListSymbols(); if ( ( i < 0 ) || ( i >= (int)l.count() ) ) return l[0]; return l[i]; diff --git a/kalzium/src/tempunit.h b/kalzium/src/tempunit.h index db4c366e..23629bb2 100644 --- a/kalzium/src/tempunit.h +++ b/kalzium/src/tempunit.h @@ -20,8 +20,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include <qpair.h> -#include <qstringlist.h> +#include <tqpair.h> +#include <tqstringlist.h> /** * This class obtains all the info needed to work with the units of measure @@ -74,12 +74,12 @@ class TempUnit * @return a list with the symbols of the temperature units * we support */ - static QStringList unitListSymbols(); + static TQStringList unitListSymbols(); /** * @return the symbol of the @p i -th unit */ - static QString unitListSymbol( int i ); + static TQString unitListSymbol( int i ); static QPair<double, double> rangeForUnit( TempUnit::Unit u ); diff --git a/kalzium/src/timewidget_impl.cpp b/kalzium/src/timewidget_impl.cpp index 5f460f4a..a5f186bc 100644 --- a/kalzium/src/timewidget_impl.cpp +++ b/kalzium/src/timewidget_impl.cpp @@ -13,28 +13,28 @@ ***************************************************************************/ #include "timewidget_impl.h" -#include <qlayout.h> -#include <qsizepolicy.h> -#include <qslider.h> -#include <qtextedit.h> +#include <tqlayout.h> +#include <tqsizepolicy.h> +#include <tqslider.h> +#include <tqtextedit.h> #include <knuminput.h> -TimeWidgetIMPL::TimeWidgetIMPL( QWidget *parent, const char* name ) +TimeWidgetIMPL::TimeWidgetIMPL( TQWidget *parent, const char* name ) : TimeWidget( parent, name ) { text->setAlignment( text->alignment() | Qt::WordBreak ); text->setTextFormat( Qt::RichText ); text->setReadOnly( true ); text->setPaletteBackgroundColor( paletteBackgroundColor() ); - text->setFrameStyle( QFrame::NoFrame ); + text->setFrameStyle( TQFrame::NoFrame ); } void TimeWidgetIMPL::slotChanged( int value ) { ( void )value; text->hide(); - verticalSpacer->changeSize( 21, 5, QSizePolicy::Fixed, QSizePolicy::Expanding ); + verticalSpacer->changeSize( 21, 5, TQSizePolicy::Fixed, TQSizePolicy::Expanding ); } #include "timewidget_impl.moc" diff --git a/kalzium/src/timewidget_impl.h b/kalzium/src/timewidget_impl.h index 6664ca15..65030da1 100644 --- a/kalzium/src/timewidget_impl.h +++ b/kalzium/src/timewidget_impl.h @@ -28,7 +28,7 @@ class TimeWidgetIMPL : public TimeWidget * @param parent The parent of this widget * @param name The name of this widget */ - TimeWidgetIMPL( QWidget *parent = 0, const char* name = 0 ); + TimeWidgetIMPL( TQWidget *parent = 0, const char* name = 0 ); public slots: /** |