summaryrefslogtreecommitdiffstats
path: root/src/qalculateperiodictabledialog.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2016-04-09 20:52:09 +0200
committerSlávek Banko <slavek.banko@axis.cz>2016-04-09 20:52:09 +0200
commit91d2d7482c36e67cb36df9d1dcdbd989911e4ceb (patch)
treec842adfbb1a172d9b61241d7dde70354e821bb75 /src/qalculateperiodictabledialog.cpp
parent4870c0c8c53d3df6ba954b2b4d8ebd87a8c43060 (diff)
downloadqalculate-tde-91d2d7482c36e67cb36df9d1dcdbd989911e4ceb.tar.gz
qalculate-tde-91d2d7482c36e67cb36df9d1dcdbd989911e4ceb.zip
Initial TQt conversion
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'src/qalculateperiodictabledialog.cpp')
-rw-r--r--src/qalculateperiodictabledialog.cpp162
1 files changed, 81 insertions, 81 deletions
diff --git a/src/qalculateperiodictabledialog.cpp b/src/qalculateperiodictabledialog.cpp
index a49101f..28611d6 100644
--- a/src/qalculateperiodictabledialog.cpp
+++ b/src/qalculateperiodictabledialog.cpp
@@ -20,62 +20,62 @@
#include "qalculateperiodictabledialog.h"
#include "qalculate_tde_utils.h"
#include <klocale.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qtooltip.h>
-#include <qcolor.h>
-#include <qpushbutton.h>
-#include <qvbox.h>
-#include <qgrid.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqtooltip.h>
+#include <tqcolor.h>
+#include <tqpushbutton.h>
+#include <tqvbox.h>
+#include <tqgrid.h>
#include "qalculatebuttonwithdata.h"
#include <kiconloader.h>
-#include <qfontmetrics.h>
+#include <tqfontmetrics.h>
#include <kactivelabel.h>
-#include <qlineedit.h>
+#include <tqlineedit.h>
extern PrintOptions printops;
-extern QWidget *expressionWidget;
+extern TQWidget *expressionWidget;
-QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(QWidget *parent, const char *name)
+QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(TQWidget *parent, const char *name)
: KDialogBase(parent, name, false, i18n("Periodic Table"), Close, Close, true) {
actionButton(Close)->setAutoDefault(false);
actionButton(Close)->setDefault(false);
- grid = new QGridLayout(makeMainWidget(), 11, 20, 0, 1);
+ grid = new TQGridLayout(makeMainWidget(), 11, 20, 0, 1);
- grid->addWidget(new QLabel("1", mainWidget()), 0, 1, Qt::AlignHCenter);
- grid->addWidget(new QLabel("2", mainWidget()), 0, 2, Qt::AlignHCenter);
- grid->addWidget(new QLabel("3", mainWidget()), 0, 4, Qt::AlignHCenter);
- grid->addWidget(new QLabel("4", mainWidget()), 0, 5, Qt::AlignHCenter);
- grid->addWidget(new QLabel("5", mainWidget()), 0, 6, Qt::AlignHCenter);
- grid->addWidget(new QLabel("6", mainWidget()), 0, 7, Qt::AlignHCenter);
- grid->addWidget(new QLabel("7", mainWidget()), 0, 8, Qt::AlignHCenter);
- grid->addWidget(new QLabel("8", mainWidget()), 0, 9, Qt::AlignHCenter);
- grid->addWidget(new QLabel("9", mainWidget()), 0, 10, Qt::AlignHCenter);
- grid->addWidget(new QLabel("10", mainWidget()), 0, 11, Qt::AlignHCenter);
- grid->addWidget(new QLabel("11", mainWidget()), 0, 12, Qt::AlignHCenter);
- grid->addWidget(new QLabel("12", mainWidget()), 0, 13, Qt::AlignHCenter);
- grid->addWidget(new QLabel("13", mainWidget()), 0, 14, Qt::AlignHCenter);
- grid->addWidget(new QLabel("14", mainWidget()), 0, 15, Qt::AlignHCenter);
- grid->addWidget(new QLabel("15", mainWidget()), 0, 16, Qt::AlignHCenter);
- grid->addWidget(new QLabel("16", mainWidget()), 0, 17, Qt::AlignHCenter);
- grid->addWidget(new QLabel("17", mainWidget()), 0, 18, Qt::AlignHCenter);
- grid->addWidget(new QLabel("18", mainWidget()), 0, 19, Qt::AlignHCenter);
+ grid->addWidget(new TQLabel("1", mainWidget()), 0, 1, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("2", mainWidget()), 0, 2, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("3", mainWidget()), 0, 4, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("4", mainWidget()), 0, 5, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("5", mainWidget()), 0, 6, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("6", mainWidget()), 0, 7, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("7", mainWidget()), 0, 8, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("8", mainWidget()), 0, 9, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("9", mainWidget()), 0, 10, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("10", mainWidget()), 0, 11, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("11", mainWidget()), 0, 12, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("12", mainWidget()), 0, 13, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("13", mainWidget()), 0, 14, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("14", mainWidget()), 0, 15, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("15", mainWidget()), 0, 16, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("16", mainWidget()), 0, 17, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("17", mainWidget()), 0, 18, TQt::AlignHCenter);
+ grid->addWidget(new TQLabel("18", mainWidget()), 0, 19, TQt::AlignHCenter);
- grid->addWidget(new QLabel("1 ", mainWidget()), 1, 0, Qt::AlignRight);
- grid->addWidget(new QLabel("2 ", mainWidget()), 2, 0, Qt::AlignRight);
- grid->addWidget(new QLabel("3 ", mainWidget()), 3, 0, Qt::AlignRight);
- grid->addWidget(new QLabel("4 ", mainWidget()), 4, 0, Qt::AlignRight);
- grid->addWidget(new QLabel("5 ", mainWidget()), 5, 0, Qt::AlignRight);
- grid->addWidget(new QLabel("6 ", mainWidget()), 6, 0, Qt::AlignRight);
- grid->addWidget(new QLabel("7 ", mainWidget()), 7, 0, Qt::AlignRight);
+ grid->addWidget(new TQLabel("1 ", mainWidget()), 1, 0, TQt::AlignRight);
+ grid->addWidget(new TQLabel("2 ", mainWidget()), 2, 0, TQt::AlignRight);
+ grid->addWidget(new TQLabel("3 ", mainWidget()), 3, 0, TQt::AlignRight);
+ grid->addWidget(new TQLabel("4 ", mainWidget()), 4, 0, TQt::AlignRight);
+ grid->addWidget(new TQLabel("5 ", mainWidget()), 5, 0, TQt::AlignRight);
+ grid->addWidget(new TQLabel("6 ", mainWidget()), 6, 0, TQt::AlignRight);
+ grid->addWidget(new TQLabel("7 ", mainWidget()), 7, 0, TQt::AlignRight);
- grid->addWidget(new QLabel("*", mainWidget()), 6, 3, Qt::AlignRight);
- grid->addWidget(new QLabel("**", mainWidget()), 7, 3, Qt::AlignRight);
- grid->addWidget(new QLabel("*", mainWidget()), 9, 3, Qt::AlignRight);
- grid->addWidget(new QLabel("**", mainWidget()), 10, 3, Qt::AlignRight);
- grid->addWidget(new QLabel(" ", mainWidget()), 8, 0);
+ grid->addWidget(new TQLabel("*", mainWidget()), 6, 3, TQt::AlignRight);
+ grid->addWidget(new TQLabel("**", mainWidget()), 7, 3, TQt::AlignRight);
+ grid->addWidget(new TQLabel("*", mainWidget()), 9, 3, TQt::AlignRight);
+ grid->addWidget(new TQLabel("**", mainWidget()), 10, 3, TQt::AlignRight);
+ grid->addWidget(new TQLabel(" ", mainWidget()), 8, 0);
DataSet *dc = CALCULATOR->getDataSet("atom");
if(!dc) {
@@ -83,7 +83,7 @@ QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(QWidget *parent, cons
}
DataObject *e;
QalculateButtonWithData *e_button;
- QString tip;
+ TQString tip;
DataProperty *p_xpos = dc->getProperty("x_pos");
DataProperty *p_ypos = dc->getProperty("y_pos");
DataProperty *p_weight = dc->getProperty("weight");
@@ -92,7 +92,7 @@ QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(QWidget *parent, cons
DataProperty *p_class = dc->getProperty("class");
DataProperty *p_name = dc->getProperty("name");
int x_pos = 0, y_pos = 0, group = 0;
- QString weight;
+ TQString weight;
int w = -1;
for(size_t i = 1; i < 120; i++) {
e = dc->getObject(i2s(i));
@@ -106,58 +106,58 @@ QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(QWidget *parent, cons
group = s2i(e->getProperty(p_class));
switch(group) {
case 1: {
- e_button->setPaletteBackgroundColor(QColor(0xee, 0xcc, 0xee));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xee, 0xcc, 0xee));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 2: {
- e_button->setPaletteBackgroundColor(QColor(0xdd, 0xcc, 0xee));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xdd, 0xcc, 0xee));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 3: {
- e_button->setPaletteBackgroundColor(QColor(0xdd, 0xdd, 0xff));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xdd, 0xdd, 0xff));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 4: {
- e_button->setPaletteBackgroundColor(QColor(0xdd, 0xee, 0xff));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xdd, 0xee, 0xff));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 5: {
- e_button->setPaletteBackgroundColor(QColor(0xcc, 0xee, 0xee));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xcc, 0xee, 0xee));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 6: {
- e_button->setPaletteBackgroundColor(QColor(0xbb, 0xff, 0xbb));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xbb, 0xff, 0xbb));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 7: {
- e_button->setPaletteBackgroundColor(QColor(0xee, 0xff, 0xdd));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xee, 0xff, 0xdd));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 8: {
- e_button->setPaletteBackgroundColor(QColor(0xff, 0xff, 0xaa));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xff, 0xff, 0xaa));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 9: {
- e_button->setPaletteBackgroundColor(QColor(0xff, 0xdd, 0xaa));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xff, 0xdd, 0xaa));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 10: {
- e_button->setPaletteBackgroundColor(QColor(0xff, 0xcc, 0xdd));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xff, 0xcc, 0xdd));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
case 11: {
- e_button->setPaletteBackgroundColor(QColor(0xaa, 0xee, 0xdd));
- e_button->setPaletteForegroundColor(QColor(0, 0, 0));
+ e_button->setPaletteBackgroundColor(TQColor(0xaa, 0xee, 0xdd));
+ e_button->setPaletteForegroundColor(TQColor(0, 0, 0));
break;
}
}
@@ -179,8 +179,8 @@ QalculatePeriodicTableDialog::QalculatePeriodicTableDialog(QWidget *parent, cons
tip += "\n";
tip += weight;
}
- QToolTip::add(e_button, tip);
- QObject::connect(e_button, SIGNAL(clickedWithData(void*)), this, SLOT(showElementInfo(void*)));
+ TQToolTip::add(e_button, tip);
+ TQObject::connect(e_button, SIGNAL(clickedWithData(void*)), this, SLOT(showElementInfo(void*)));
}
}
@@ -192,22 +192,22 @@ void QalculatePeriodicTableDialog::showElementInfo(void *e) {
dialog->show();
}
-QalculateElementInfoDialog::QalculateElementInfoDialog(DataObject *element, QWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Element Data"), Close, Close, true) {
+QalculateElementInfoDialog::QalculateElementInfoDialog(DataObject *element, TQWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Element Data"), Close, Close, true) {
- setWFlags(getWFlags() | Qt::WDestructiveClose);
+ setWFlags(getWFlags() | TQt::WDestructiveClose);
e = element;
DataSet *ds = e->parentSet();
if(!ds) {
close();
return;
}
- QVBox *vbox = makeVBoxMainWidget();
- QVBox *vbox2 = new QVBox(vbox);
+ TQVBox *vbox = makeVBoxMainWidget();
+ TQVBox *vbox2 = new TQVBox(vbox);
DataProperty *p_number = ds->getProperty("number");
DataProperty *p_symbol = ds->getProperty("symbol");
DataProperty *p_class = ds->getProperty("class");
DataProperty *p_name = ds->getProperty("name");
- QString str = "<div align=\"right\"><font size=4>"; str += e->getProperty(p_number).c_str(); str += "</font></div>";
+ TQString str = "<div align=\"right\"><font size=4>"; str += e->getProperty(p_number).c_str(); str += "</font></div>";
new KActiveLabel(str, vbox2);
str = "<font size=6>"; str += e->getProperty(p_symbol).c_str(); str += "</font>";
new KActiveLabel(str, vbox2);
@@ -215,11 +215,11 @@ QalculateElementInfoDialog::QalculateElementInfoDialog(DataObject *element, QWid
new KActiveLabel(str, vbox2);
QalculateButtonWithData *button;
- QGrid *grid = new QGrid(3, Qt::Horizontal, vbox);
+ TQGrid *grid = new TQGrid(3, TQt::Horizontal, vbox);
int group = s2i(e->getProperty(p_class));
if(group > 0) {
str = "<b>"; str += i18n("Classification"); str += ":"; str += "</b>";
- new QLabel(str, grid);
+ new TQLabel(str, grid);
switch(group) {
case ALKALI_METALS: {str = i18n("Alkali Metal"); break;}
case ALKALI_EARTH_METALS: {str = i18n("Alkaline-Earth Metal"); break;}
@@ -235,21 +235,21 @@ QalculateElementInfoDialog::QalculateElementInfoDialog(DataObject *element, QWid
default: {str = i18n("Unknown"); break;}
}
new KActiveLabel(str, grid);
- new QFrame(grid);
+ new TQFrame(grid);
}
DataPropertyIter it;
DataProperty *dp = ds->getFirstProperty(&it);
- QString sval;
+ TQString sval;
while(dp) {
if(!dp->isHidden() && dp != p_number && dp != p_class && dp != p_symbol && dp != p_name) {
sval = e->getPropertyDisplayString(dp).c_str();
if(!sval.isEmpty()) {
str = "<b>"; str += dp->title().c_str(); str += ":"; str += "</b>";
- new QLabel(str, grid);
+ new TQLabel(str, grid);
new KActiveLabel(sval, grid);
- button = new QalculateButtonWithData((void*) dp, QIconSet(SmallIcon("editpaste")), "", grid);
- QObject::connect(button, SIGNAL(clickedWithData(void*)), SLOT(insertElementData(void*)));
+ button = new QalculateButtonWithData((void*) dp, TQIconSet(SmallIcon("editpaste")), "", grid);
+ TQObject::connect(button, SIGNAL(clickedWithData(void*)), SLOT(insertElementData(void*)));
}
}
dp = ds->getNextProperty(&it);
@@ -261,7 +261,7 @@ void QalculateElementInfoDialog::insertElementData(void *data) {
DataProperty *dp = (DataProperty*) data;
DataSet *ds = dp->parentSet();
if(ds) {
- QString str = ds->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) expressionWidget).name.c_str();
+ TQString str = ds->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) expressionWidget).name.c_str();
str += "(";
str += e->getProperty(ds->getPrimaryKeyProperty()).c_str();
str += CALCULATOR->getComma().c_str();