From 91d2d7482c36e67cb36df9d1dcdbd989911e4ceb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 9 Apr 2016 20:52:09 +0200 Subject: Initial TQt conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- src/qalculateinsertfunctiondialog.cpp | 90 +++++++++++++++++------------------ 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'src/qalculateinsertfunctiondialog.cpp') diff --git a/src/qalculateinsertfunctiondialog.cpp b/src/qalculateinsertfunctiondialog.cpp index c7fecda..0260b2a 100644 --- a/src/qalculateinsertfunctiondialog.cpp +++ b/src/qalculateinsertfunctiondialog.cpp @@ -19,19 +19,19 @@ ***************************************************************************/ #include "qalculateinsertfunctiondialog.h" #include "qalculate_tde_utils.h" -#include +#include #include #include -#include -#include -#include +#include +#include +#include #include -#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include @@ -39,11 +39,11 @@ #include "buttonwithindexsignal.h" #include "qalculateinsertmatrixvectordialog.h" -extern QWidget *expressionWidget; +extern TQWidget *expressionWidget; extern PrintOptions printops; extern EvaluationOptions evalops; -QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QWidget *parent, const QString &selected_text, const char *name) : KDialogBase(parent, name, true, f->title(true).c_str(), Ok|Apply|Cancel, Ok) { +QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, TQWidget *parent, const TQString &selected_text, const char *name) : KDialogBase(parent, name, true, f->title(true).c_str(), Ok|Apply|Cancel, Ok) { #if KDE_VERSION_MAJOR < 4 && KDE_VERSION_MINOR < 2 setButtonOKText(i18n("Insert")); @@ -57,12 +57,12 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW setButtonApply(KGuiItem(i18n("Execute"))); #endif mathFunction = f; - QVBox *box = makeVBoxMainWidget(); + TQVBox *box = makeVBoxMainWidget(); box->setSpacing(12); - QString titlestr = ""; + TQString titlestr = ""; titlestr += mathFunction->title(true).c_str(); titlestr += ""; - new QLabel(titlestr, box); + new TQLabel(titlestr, box); int args = 0; bool has_vector = false; if(mathFunction->args() > 0) { @@ -74,14 +74,14 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW args = 1; has_vector = true; } - QGrid *table = new QGrid(3, box); + TQGrid *table = new TQGrid(3, box); table->setSpacing(6); table->setMargin(12); - table->setFrameStyle(QFrame::Sunken | QFrame::GroupBoxPanel); + table->setFrameStyle(TQFrame::Sunken | TQFrame::GroupBoxPanel); label.resize(args); entry.resize(args); type_label.resize(args); - QString argstr, typestr, defstr, argtype; + TQString argstr, typestr, defstr, argtype; //create argument entries Argument *arg; for(int i = 0; i < args; i++) { @@ -92,7 +92,7 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW } else { argstr = i18n("Argument"); argstr += " "; - argstr += QString::number(i + 1); + argstr += TQString::number(i + 1); argstr += ":"; } } else { @@ -106,7 +106,7 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW defstr.remove(0, 1); defstr.truncate(defstr.length() - 1); } - label[i] = new QLabel(argstr, table); + label[i] = new TQLabel(argstr, table); if(arg) { switch(arg->type()) { case ARGUMENT_TYPE_INTEGER: { @@ -118,9 +118,9 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW if(iarg->max()) { max = iarg->max()->intValue(); } - QSpinBox *qsp = new QSpinBox(min, max, 1, table); + TQSpinBox *qsp = new TQSpinBox(min, max, 1, table); entry[i] = qsp; - qsp->setButtonSymbols(QSpinBox::PlusMinus); + qsp->setButtonSymbols(TQSpinBox::PlusMinus); int selected_value = 0; bool convok = false; if(i == 0 && !selected_text.isEmpty()) { @@ -129,7 +129,7 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW if(convok && selected_value >= min && selected_value <= max) { qsp->setValue(selected_value); } else if(!mathFunction->getDefaultValue(i + 1).empty()) { - qsp->setValue(QString(mathFunction->getDefaultValue(i + 1).c_str()).toInt()); + qsp->setValue(TQString(mathFunction->getDefaultValue(i + 1).c_str()).toInt()); } else if(!arg->zeroForbidden() && min <= 0 && max >= 0) { qsp->setValue(0); } else { @@ -144,14 +144,14 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW break; } case ARGUMENT_TYPE_BOOLEAN: { - QHButtonGroup *bg = new QHButtonGroup(table); + TQHButtonGroup *bg = new TQHButtonGroup(table); entry[i] = bg; - bg->setFrameStyle(QFrame::Plain | QFrame::NoFrame); + bg->setFrameStyle(TQFrame::Plain | TQFrame::NoFrame); bg->setMargin(0); bg->setRadioButtonExclusive(TRUE); - bg->insert(new QRadioButton(i18n("True"), bg), 1); - bg->insert(new QRadioButton(i18n("False"), bg), 0); - QString str = selected_text.stripWhiteSpace(); + bg->insert(new TQRadioButton(i18n("True"), bg), 1); + bg->insert(new TQRadioButton(i18n("False"), bg), 0); + TQString str = selected_text.stripWhiteSpace(); if(i == 0 && str == "1") { bg->setButton(1); } else if(i == 0 && str == "0") { @@ -233,47 +233,47 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW typestr.remove(0, 1); typestr.remove(typestr.length() - 1, 1); type_label[i] = new ButtonWithIndexSignal(typestr, i, table); - QObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(selectDate(int))); + TQObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(selectDate(int))); break; } case ARGUMENT_TYPE_MATRIX: { typestr.remove(0, 1); typestr.remove(typestr.length() - 1, 1); type_label[i] = new ButtonWithIndexSignal(typestr, i, table); - QObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(insertMatrix(int))); + TQObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(insertMatrix(int))); break; } case ARGUMENT_TYPE_VECTOR: { typestr.remove(0, 1); typestr.remove(typestr.length() - 1, 1); type_label[i] = new ButtonWithIndexSignal(typestr, i, table); - QObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(insertVector(int))); + TQObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(insertVector(int))); break; } case ARGUMENT_TYPE_FILE: { typestr.remove(0, 1); typestr.remove(typestr.length() - 1, 1); type_label[i] = new ButtonWithIndexSignal(typestr, i, table); - QObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(selectFile(int))); + TQObject::connect(type_label[i], SIGNAL(clickedWithIndex(int)), this, SLOT(selectFile(int))); break; } default: { - type_label[i] = new QLabel(typestr, table); + type_label[i] = new TQLabel(typestr, table); } } } else { - type_label[i] = new QLabel(typestr, table); + type_label[i] = new TQLabel(typestr, table); } if(i == 0) entry[0]->setFocus(); } //display function description if(!mathFunction->description().empty()) { - QString str = mathFunction->description().c_str(); + TQString str = mathFunction->description().c_str(); str.replace("<", "<"); str.replace(">", ">"); str.replace("\n", "
"); KActiveLabel *descrLabel = new KActiveLabel(str, box); - descrLabel->setAlignment(Qt::AlignJustify); + descrLabel->setAlignment(TQt::AlignJustify); enableButtonSeparator(true); } } @@ -281,8 +281,8 @@ QalculateInsertFunctionDialog::QalculateInsertFunctionDialog(MathFunction *f, QW QalculateInsertFunctionDialog::~QalculateInsertFunctionDialog() { } -QString QalculateInsertFunctionDialog::functionExpression() { - QString str = mathFunction->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) expressionWidget).name.c_str(), str2; +TQString QalculateInsertFunctionDialog::functionExpression() { + TQString str = mathFunction->preferredInputName(printops.abbreviate_names, printops.use_unicode_signs, false, false, &can_display_unicode_string_function, (void*) expressionWidget).name.c_str(), str2; str += "("; int args = 0; if(mathFunction->args() > 0) { @@ -294,13 +294,13 @@ QString QalculateInsertFunctionDialog::functionExpression() { } for(int i = 0; i < args; i++) { if(mathFunction->getArgumentDefinition(i + 1) && mathFunction->getArgumentDefinition(i + 1)->type() == ARGUMENT_TYPE_BOOLEAN) { - if(((QButtonGroup*) entry[i])->id(((QButtonGroup*) entry[i])->selected()) == 1) { + if(((TQButtonGroup*) entry[i])->id(((TQButtonGroup*) entry[i])->selected()) == 1) { str2 = "1"; } else { str2 = "0"; } } else if(mathFunction->getArgumentDefinition(i + 1) && mathFunction->getArgumentDefinition(i + 1)->type() == ARGUMENT_TYPE_INTEGER) { - str2 = ((QSpinBox*) entry[i])->text(); + str2 = ((TQSpinBox*) entry[i])->text(); } else if(mathFunction->subtype() == SUBTYPE_DATA_SET && mathFunction->getArgumentDefinition(i + 1) && mathFunction->getArgumentDefinition(i + 1)->type() == ARGUMENT_TYPE_DATA_PROPERTY) { int index = ((KComboBox*) entry[i])->currentItem(); DataPropertyIter it; @@ -352,23 +352,23 @@ void QalculateInsertFunctionDialog::slotApply() { void QalculateInsertFunctionDialog::selectDate(int index) { KDialogBase *dialog = new KDialogBase(this, 0, true, i18n("Date"), Ok|Cancel); KDatePicker *datePicker; - QDate date(QDate::fromString(((KLineEdit*) entry[index])->text(), Qt::ISODate)); + TQDate date(TQDate::fromString(((KLineEdit*) entry[index])->text(), TQt::ISODate)); if(date.isValid()) datePicker = new KDatePicker(dialog->makeVBoxMainWidget(), date); else datePicker = new KDatePicker(dialog->makeVBoxMainWidget()); - if(dialog->exec() == QDialog::Accepted) { - ((KLineEdit*) entry[index])->setText(datePicker->date().toString(Qt::ISODate)); + if(dialog->exec() == TQDialog::Accepted) { + ((KLineEdit*) entry[index])->setText(datePicker->date().toString(TQt::ISODate)); } dialog->deleteLater(); } void QalculateInsertFunctionDialog::selectFile(int index) { - QString filename = KFileDialog::getSaveFileName(((KLineEdit*) entry[index])->text(), QString::null, this, i18n("File")); + TQString filename = KFileDialog::getSaveFileName(((KLineEdit*) entry[index])->text(), TQString::null, this, i18n("File")); if(!filename.isEmpty()) { ((KLineEdit*) entry[index])->setText(filename); } } void QalculateInsertFunctionDialog::insertMatrix(int index) { QalculateInsertMatrixVectorDialog *d = new QalculateInsertMatrixVectorDialog(this); - QString str = ((KLineEdit*) entry[index])->text(); + TQString str = ((KLineEdit*) entry[index])->text(); MathStructure mstruct; if(!str.isEmpty()) { CALCULATOR->parse(&mstruct, CALCULATOR->unlocalizeExpression(str.ascii(), evalops.parse_options)); @@ -385,7 +385,7 @@ void QalculateInsertFunctionDialog::insertMatrix(int index) { } void QalculateInsertFunctionDialog::insertVector(int index) { QalculateInsertMatrixVectorDialog *d = new QalculateInsertMatrixVectorDialog(this); - QString str = ((KLineEdit*) entry[index])->text(); + TQString str = ((KLineEdit*) entry[index])->text(); MathStructure mstruct; if(!str.isEmpty()) { CALCULATOR->parse(&mstruct, CALCULATOR->unlocalizeExpression(str.ascii(), evalops.parse_options)); -- cgit v1.2.1