summaryrefslogtreecommitdiffstats
path: root/src/qalculateeditunitdialog.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/qalculateeditunitdialog.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/qalculateeditunitdialog.cpp')
-rw-r--r--src/qalculateeditunitdialog.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/src/qalculateeditunitdialog.cpp b/src/qalculateeditunitdialog.cpp
index f40a377..b5a8000 100644
--- a/src/qalculateeditunitdialog.cpp
+++ b/src/qalculateeditunitdialog.cpp
@@ -21,75 +21,75 @@
#include "qalculate_tde_utils.h"
#include "qalculateeditnamesdialog.h"
-#include <qgrid.h>
+#include <tqgrid.h>
#include <klineedit.h>
-#include <qpushbutton.h>
+#include <tqpushbutton.h>
#include <kcombobox.h>
-#include <qlabel.h>
+#include <tqlabel.h>
#include <klocale.h>
-#include <qvbox.h>
-#include <qhbox.h>
-#include <qcheckbox.h>
+#include <tqvbox.h>
+#include <tqhbox.h>
+#include <tqcheckbox.h>
#include <kmessagebox.h>
-#include <qgroupbox.h>
-#include <qspinbox.h>
-#include <qlayout.h>
+#include <tqgroupbox.h>
+#include <tqspinbox.h>
+#include <tqlayout.h>
#include <kapplication.h>
extern PrintOptions printops;
extern EvaluationOptions evalops;
extern tree_struct unit_cats;
-QalculateEditUnitDialog::QalculateEditUnitDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Unit"), Ok | Cancel | Help, Ok, true) {
+QalculateEditUnitDialog::QalculateEditUnitDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, i18n("Edit Unit"), Ok | Cancel | Help, Ok, true) {
names_edit_dialog = NULL;
edited_unit = NULL;
- QVBox *box = makeVBoxMainWidget();
+ TQVBox *box = makeVBoxMainWidget();
- grid1 = new QGroupBox(1, Qt::Horizontal, i18n("Name"), box);
+ grid1 = new TQGroupBox(1, TQt::Horizontal, i18n("Name"), box);
grid1->setInsideMargin(spacingHint());
grid1->setInsideSpacing(spacingHint());
- QWidget *widget = new QWidget(grid1);
- QGridLayout *grid = new QGridLayout(widget, 1, 1, 0, spacingHint());
- grid->addWidget(new QLabel(i18n("Name:"), widget), 0, 0);
+ TQWidget *widget = new TQWidget(grid1);
+ TQGridLayout *grid = new TQGridLayout(widget, 1, 1, 0, spacingHint());
+ grid->addWidget(new TQLabel(i18n("Name:"), widget), 0, 0);
nameEdit = new KLineEdit(widget);
grid->addWidget(nameEdit, 0, 1);
- QHBoxLayout *hbox = new QHBoxLayout(0, 0, spacingHint());
+ TQHBoxLayout *hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 1, 1, 0, 1);
- namesLabel = new QLabel(widget);
- namesLabel->setAlignment(Qt::AlignRight);
- namesLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
+ namesLabel = new TQLabel(widget);
+ namesLabel->setAlignment(TQt::AlignRight);
+ namesLabel->setSizePolicy(TQSizePolicy::Expanding, TQSizePolicy::Preferred);
hbox->addWidget(namesLabel);
- namesButton = new QPushButton(i18n("Names Details"), widget);
+ namesButton = new TQPushButton(i18n("Names Details"), widget);
hbox->addWidget(namesButton);
- grid->addWidget(new QLabel(i18n("Descriptive name:"), widget), 2, 0);
+ grid->addWidget(new TQLabel(i18n("Descriptive name:"), widget), 2, 0);
titleEdit = new KLineEdit(widget);
grid->addWidget(titleEdit, 2, 1);
- hbox = new QHBoxLayout(0, 0, spacingHint());
+ hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 3, 3, 0, 1);
- hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
- hideButton = new QCheckBox(i18n("Hide unit"), widget);
+ hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
+ hideButton = new TQCheckBox(i18n("Hide unit"), widget);
hbox->addWidget(hideButton);
- grid2 = new QGroupBox(1, Qt::Horizontal, i18n("Type"), box);
+ grid2 = new TQGroupBox(1, TQt::Horizontal, i18n("Type"), box);
grid2->setInsideMargin(spacingHint());
grid2->setInsideSpacing(spacingHint());
- widget = new QWidget(grid2);
- grid = new QGridLayout(widget, 1, 1, 0, spacingHint());
- grid->addWidget(new QLabel(i18n("Class:"), widget), 0, 0);
+ widget = new TQWidget(grid2);
+ grid = new TQGridLayout(widget, 1, 1, 0, spacingHint());
+ grid->addWidget(new TQLabel(i18n("Class:"), widget), 0, 0);
classCombo = new KComboBox(widget);
grid->addWidget(classCombo, 0, 1);
classCombo->insertItem(i18n("Base Unit"));
classCombo->insertItem(i18n("Alias"));
classCombo->insertItem(i18n("Composite Unit"));
classCombo->setMaximumWidth(250);
- grid->addWidget(new QLabel(i18n("Category:"), widget), 1, 0);
+ grid->addWidget(new TQLabel(i18n("Category:"), widget), 1, 0);
categoryCombo = new KComboBox(widget);
grid->addWidget(categoryCombo, 1, 1);
categoryCombo->setMaximumWidth(250);
categoryCombo->setEditable(true);
- grid->addWidget(new QLabel(i18n("System:"), widget), 2, 0);
+ grid->addWidget(new TQLabel(i18n("System:"), widget), 2, 0);
systemCombo = new KComboBox(widget);
grid->addWidget(systemCombo, 2, 1);
systemCombo->insertItem(i18n("SI"));
@@ -99,35 +99,35 @@ QalculateEditUnitDialog::QalculateEditUnitDialog(QWidget *parent, const char *na
systemCombo->setMaximumWidth(250);
systemCombo->setEditable(true);
- grid3 = new QGroupBox(1, Qt::Horizontal, i18n("Relation"), box);
+ grid3 = new TQGroupBox(1, TQt::Horizontal, i18n("Relation"), box);
grid3->setInsideMargin(spacingHint());
grid3->setInsideSpacing(spacingHint());
- widget = new QWidget(grid3);
- grid = new QGridLayout(widget, 1, 1, 0, spacingHint());
- grid->addWidget(new QLabel(i18n("Base unit:"), widget), 0, 0);
+ widget = new TQWidget(grid3);
+ grid = new TQGridLayout(widget, 1, 1, 0, spacingHint());
+ grid->addWidget(new TQLabel(i18n("Base unit:"), widget), 0, 0);
baseEdit = new KLineEdit(widget);
grid->addWidget(baseEdit, 0, 1);
- exponentLabel = new QLabel(i18n("Exponent:"), widget);
+ exponentLabel = new TQLabel(i18n("Exponent:"), widget);
grid->addWidget(exponentLabel, 1, 0);
- exponentBox = new QSpinBox(-9, 9, 1, widget);
+ exponentBox = new TQSpinBox(-9, 9, 1, widget);
grid->addWidget(exponentBox, 1, 1);
- relationLabel = new QLabel(i18n("Relation:"), widget);
+ relationLabel = new TQLabel(i18n("Relation:"), widget);
grid->addWidget(relationLabel, 2, 0);
relationEdit = new KLineEdit(widget);
grid->addWidget(relationEdit, 2, 1);
- hbox = new QHBoxLayout(0, 0, spacingHint());
+ hbox = new TQHBoxLayout(0, 0, spacingHint());
grid->addMultiCellLayout(hbox, 3, 3, 0, 1);
- hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
- relationExactButton = new QCheckBox(i18n("Relation is exact"), widget);
+ hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
+ relationExactButton = new TQCheckBox(i18n("Relation is exact"), widget);
hbox->addWidget(relationExactButton);
- inverseRelationLabel = new QLabel(i18n("Inverse relation:"), widget);
+ inverseRelationLabel = new TQLabel(i18n("Inverse relation:"), widget);
grid->addWidget(inverseRelationLabel, 4, 0);
inverseRelationEdit = new KLineEdit(widget);
grid->addWidget(inverseRelationEdit, 4, 1);
connect(namesButton, SIGNAL(clicked()), this, SLOT(editNames()));
connect(classCombo, SIGNAL(activated(int)), this, SLOT(classChanged(int)));
- connect(nameEdit, SIGNAL(textChanged(const QString&)), this, SLOT(nameChanged(const QString&)));
+ connect(nameEdit, SIGNAL(textChanged(const TQString&)), this, SLOT(nameChanged(const TQString&)));
}
@@ -273,7 +273,7 @@ void QalculateEditUnitDialog::classChanged(int i) {
grid3->setEnabled(i != 0);
}
-Unit *QalculateEditUnitDialog::editUnit(QString category, Unit *u) {
+Unit *QalculateEditUnitDialog::editUnit(TQString category, Unit *u) {
nameEdit->setFocus();
@@ -291,8 +291,8 @@ Unit *QalculateEditUnitDialog::editUnit(QString category, Unit *u) {
setCaption(i18n("New Unit"));
}
- //QStringList cats;
- QString catstr;
+ //TQStringList cats;
+ TQString catstr;
categoryCombo->clear();
tree_struct *item, *item2;
unit_cats.it = unit_cats.items.begin();
@@ -391,7 +391,7 @@ Unit *QalculateEditUnitDialog::editUnit(QString category, Unit *u) {
classChanged(1);
}
- if(exec() == QDialog::Accepted) {
+ if(exec() == TQDialog::Accepted) {
u = edited_unit;
edited_unit = NULL;
return u;
@@ -411,7 +411,7 @@ void QalculateEditUnitDialog::editNames() {
names_edit_dialog->setNamesLE(nameEdit, namesLabel);
}
-void QalculateEditUnitDialog::nameChanged(const QString &name) {
+void QalculateEditUnitDialog::nameChanged(const TQString &name) {
if(name.isNull()) return;
if(!CALCULATOR->unitNameIsValid(name.ascii())) {
nameEdit->blockSignals(true);