summaryrefslogtreecommitdiffstats
path: root/src/qalculatedatasetsdialog.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/qalculatedatasetsdialog.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/qalculatedatasetsdialog.cpp')
-rw-r--r--src/qalculatedatasetsdialog.cpp134
1 files changed, 67 insertions, 67 deletions
diff --git a/src/qalculatedatasetsdialog.cpp b/src/qalculatedatasetsdialog.cpp
index 3059ebd..5505805 100644
--- a/src/qalculatedatasetsdialog.cpp
+++ b/src/qalculatedatasetsdialog.cpp
@@ -24,100 +24,100 @@
#include "qalculate_tde_utils.h"
#include "qalculatebuttonwithdata.h"
#include <kpushbutton.h>
-#include <qsplitter.h>
-#include <qvbox.h>
-#include <qhbox.h>
-#include <qgrid.h>
+#include <tqsplitter.h>
+#include <tqvbox.h>
+#include <tqhbox.h>
+#include <tqgrid.h>
#include <klistview.h>
#include <kmessagebox.h>
#include <klocale.h>
-#include <qlayout.h>
-#include <qgroupbox.h>
-#include <qscrollview.h>
+#include <tqlayout.h>
+#include <tqgroupbox.h>
+#include <tqscrollview.h>
#include <ktextbrowser.h>
-#include <qlabel.h>
+#include <tqlabel.h>
#include <kactivelabel.h>
#include <kiconloader.h>
#include <klineedit.h>
extern PrintOptions printops;
-extern QWidget *expressionWidget;
+extern TQWidget *expressionWidget;
-QalculateDataSetsDialog::QalculateDataSetsDialog(QWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Data Sets"), Close, Close, false) {
+QalculateDataSetsDialog::QalculateDataSetsDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, false, i18n("Data Sets"), Close, Close, false) {
dataset_edit_dialog = NULL;
object_edit_dialog = NULL;
- QVBox *box = makeVBoxMainWidget();
- QSplitter *splitter = new QSplitter(Qt::Vertical, box);
+ TQVBox *box = makeVBoxMainWidget();
+ TQSplitter *splitter = new TQSplitter(TQt::Vertical, box);
- QVBox *group1 = new QVBox(splitter);
- QVBox *group2 = new QVBox(splitter);
+ TQVBox *group1 = new TQVBox(splitter);
+ TQVBox *group2 = new TQVBox(splitter);
- splitter = new QSplitter(Qt::Horizontal, group1);
- QWidget *widget = new QWidget(splitter);
- widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
- QVBoxLayout *vbox = new QVBoxLayout(widget, spacingHint(), spacingHint());
- vbox->addWidget(new QLabel(i18n("Data Sets:"), widget));
+ splitter = new TQSplitter(TQt::Horizontal, group1);
+ TQWidget *widget = new TQWidget(splitter);
+ widget->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Expanding);
+ TQVBoxLayout *vbox = new TQVBoxLayout(widget, spacingHint(), spacingHint());
+ vbox->addWidget(new TQLabel(i18n("Data Sets:"), widget));
dataSetsView = new KListView(widget);
vbox->addWidget(dataSetsView);
dataSetsView->addColumn(i18n("Data Set"));
dataSetsView->setRootIsDecorated(false);
- QHBoxLayout *hbox = new QHBoxLayout(vbox);
- hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
- newDataSetButton = new QPushButton(i18n("New"), widget);
+ TQHBoxLayout *hbox = new TQHBoxLayout(vbox);
+ hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
+ newDataSetButton = new TQPushButton(i18n("New"), widget);
hbox->addWidget(newDataSetButton);
- editDataSetButton = new QPushButton(i18n("Edit"), widget);
+ editDataSetButton = new TQPushButton(i18n("Edit"), widget);
hbox->addWidget(editDataSetButton);
- deleteDataSetButton = new QPushButton(i18n("Delete"), widget);
+ deleteDataSetButton = new TQPushButton(i18n("Delete"), widget);
hbox->addWidget(deleteDataSetButton);
- QVBox *vbox2 = new QVBox(splitter);
+ TQVBox *vbox2 = new TQVBox(splitter);
vbox2->setMargin(spacingHint());
vbox2->setSpacing(spacingHint());
- new QLabel(i18n("Description:"), vbox2);
+ new TQLabel(i18n("Description:"), vbox2);
descriptionBrowser = new KTextBrowser(vbox2);
- splitter = new QSplitter(Qt::Horizontal, group2);
- widget = new QWidget(splitter);
- widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
- vbox = new QVBoxLayout(widget, spacingHint(), spacingHint());
- vbox->addWidget(new QLabel(i18n("Objects:"), widget));
+ splitter = new TQSplitter(TQt::Horizontal, group2);
+ widget = new TQWidget(splitter);
+ widget->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Expanding);
+ vbox = new TQVBoxLayout(widget, spacingHint(), spacingHint());
+ vbox->addWidget(new TQLabel(i18n("Objects:"), widget));
objectsView = new KListView(widget);
vbox->addWidget(objectsView);
objectsView->addColumn(i18n("Object"));
objectsView->setRootIsDecorated(false);
- hbox = new QHBoxLayout(vbox);
- hbox->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
- newObjectButton = new QPushButton(i18n("New"), widget);
+ hbox = new TQHBoxLayout(vbox);
+ hbox->addItem(new TQSpacerItem(0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum));
+ newObjectButton = new TQPushButton(i18n("New"), widget);
hbox->addWidget(newObjectButton);
- editObjectButton = new QPushButton(i18n("Edit"), widget);
+ editObjectButton = new TQPushButton(i18n("Edit"), widget);
hbox->addWidget(editObjectButton);
- deleteObjectButton = new QPushButton(i18n("Delete"), widget);
+ deleteObjectButton = new TQPushButton(i18n("Delete"), widget);
hbox->addWidget(deleteObjectButton);
- vbox2 = new QVBox(splitter);
+ vbox2 = new TQVBox(splitter);
vbox2->setMargin(spacingHint());
vbox2->setSpacing(spacingHint());
- new QLabel(i18n("Attributes:"), vbox2);
- attributesView = new QScrollView(vbox2);
- attributesView->setResizePolicy(QScrollView::AutoOneFit);
- attributesView->setFrameStyle(QFrame::NoFrame);
- attributesGrid = new QGrid(3, Qt::Horizontal, attributesView->viewport());
+ new TQLabel(i18n("Attributes:"), vbox2);
+ attributesView = new TQScrollView(vbox2);
+ attributesView->setResizePolicy(TQScrollView::AutoOneFit);
+ attributesView->setFrameStyle(TQFrame::NoFrame);
+ attributesGrid = new TQGrid(3, TQt::Horizontal, attributesView->viewport());
attributesGrid->setSpacing(spacingHint());
attributesView->addChild(attributesGrid);
- resize(QSize(675, 525).expandedTo(size()));
+ resize(TQSize(675, 525).expandedTo(size()));
connect(newDataSetButton, SIGNAL(clicked()), this, SLOT(newDataSet()));
connect(editDataSetButton, SIGNAL(clicked()), this, SLOT(editDataSet()));
connect(deleteDataSetButton, SIGNAL(clicked()), this, SLOT(deleteDataSet()));
connect(dataSetsView, SIGNAL(selectionChanged()), this, SLOT(dataSetSelected()));
- connect(dataSetsView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(dataSetDoubleClicked(QListViewItem*)));
+ connect(dataSetsView, SIGNAL(doubleClicked(TQListViewItem*)), this, SLOT(dataSetDoubleClicked(TQListViewItem*)));
connect(newObjectButton, SIGNAL(clicked()), this, SLOT(newObject()));
connect(editObjectButton, SIGNAL(clicked()), this, SLOT(editObject()));
connect(deleteObjectButton, SIGNAL(clicked()), this, SLOT(deleteObject()));
connect(objectsView, SIGNAL(selectionChanged()), this, SLOT(objectSelected()));
- connect(objectsView, SIGNAL(doubleClicked(QListViewItem*)), this, SLOT(objectDoubleClicked(QListViewItem*)));
+ connect(objectsView, SIGNAL(doubleClicked(TQListViewItem*)), this, SLOT(objectDoubleClicked(TQListViewItem*)));
}
@@ -129,7 +129,7 @@ void QalculateDataSetsDialog::updateDataSetTree() {
objectItems.clear();
dataSetsView->clear();
DataSet *ds;
- QListViewItem *i;
+ TQListViewItem *i;
bool b = false;
dataSetsView->blockSignals(true);
for(size_t index = 1; ; index++) {
@@ -152,8 +152,8 @@ void QalculateDataSetsDialog::updateDataSetTree() {
}
-#define UPDATE_SELECTED_DATASET QListViewItem *i3 = dataSetsView->selectedItem(); if(!i3) return; selected_dataset = dataSetItems[i3]; if(!selected_dataset) return;
-#define UPDATE_SELECTED_OBJECT QListViewItem *i2 = objectsView->selectedItem(); if(!i2) return; selected_object = objectItems[i2]; if(!selected_object) return;
+#define UPDATE_SELECTED_DATASET TQListViewItem *i3 = dataSetsView->selectedItem(); if(!i3) return; selected_dataset = dataSetItems[i3]; if(!selected_dataset) return;
+#define UPDATE_SELECTED_OBJECT TQListViewItem *i2 = objectsView->selectedItem(); if(!i2) return; selected_object = objectItems[i2]; if(!selected_object) return;
#define CHECK_IF_DATASET_STILL_THERE if(!CALCULATOR->stillHasFunction(selected_dataset)) {KMessageBox::error(this, i18n("Data set does not exist anymore.")); emit dataSetsChanged(); return;}
void QalculateDataSetsDialog::deleteDataSet() {
@@ -193,7 +193,7 @@ void QalculateDataSetsDialog::newDataSet() {
}
}
-void QalculateDataSetsDialog::dataSetDoubleClicked(QListViewItem*i) {
+void QalculateDataSetsDialog::dataSetDoubleClicked(TQListViewItem*i) {
selected_dataset = dataSetItems[i];
if(!selected_dataset)
return;
@@ -210,7 +210,7 @@ void QalculateDataSetsDialog::dataSetDoubleClicked(QListViewItem*i) {
void QalculateDataSetsDialog::dataSetSelected() {
- QListViewItem *selected = dataSetsView->selectedItem();
+ TQListViewItem *selected = dataSetsView->selectedItem();
objectsView->clear();
if(selected) {
DataSet *ds = dataSetItems[selected];
@@ -232,7 +232,7 @@ void QalculateDataSetsDialog::dataSetSelected() {
DataProperty *dp;
DataObject *o = ds->getFirstObject(&it);
bool b = false, b2 = false;
- QListViewItem *i;
+ TQListViewItem *i;
while(o) {
i = new KListViewItem(objectsView);
objectItems[i] = o;
@@ -257,7 +257,7 @@ void QalculateDataSetsDialog::dataSetSelected() {
o = ds->getNextObject(&it);
}
if(!b) {
- QListViewItemIterator qit(objectsView);
+ TQListViewItemIterator qit(objectsView);
if(qit.current()) {
objectsView->setSelected(qit.current(), true);
}
@@ -268,7 +268,7 @@ void QalculateDataSetsDialog::dataSetSelected() {
deleteDataSetButton->setEnabled(ds->isLocal());
newObjectButton->setEnabled(true);
- QString str, str2;
+ TQString str, str2;
if(!ds->description().empty()) {
str2 = ds->description().c_str();
@@ -341,7 +341,7 @@ void QalculateDataSetsDialog::dataSetSelected() {
} else {
str += i18n("argument");
str += " ";
- str += QString::number(i2);
+ str += TQString::number(i2);
}
if(i2 > ds->minargs()) {
str += "]";
@@ -387,7 +387,7 @@ void QalculateDataSetsDialog::insertObjectData(void *data) {
DataProperty *dp = (DataProperty*) data;
DataSet *ds = dp->parentSet();
if(ds && selected_object) {
- 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 += selected_object->getProperty(ds->getPrimaryKeyProperty()).c_str();
str += CALCULATOR->getComma().c_str();
@@ -400,7 +400,7 @@ void QalculateDataSetsDialog::insertObjectData(void *data) {
void QalculateDataSetsDialog::objectSelected() {
- QListViewItem *selected = objectsView->selectedItem();
+ TQListViewItem *selected = objectsView->selectedItem();
DataObject *o = NULL;
if(selected) o = objectItems[selected];
@@ -412,10 +412,10 @@ void QalculateDataSetsDialog::objectSelected() {
if(!ds) return;
DataPropertyIter it;
DataProperty *dp = ds->getFirstProperty(&it);
- QString sval;
- QString str;
+ TQString sval;
+ TQString str;
delete attributesGrid;
- attributesGrid = new QGrid(3, Qt::Horizontal, attributesView->viewport());
+ attributesGrid = new TQGrid(3, TQt::Horizontal, attributesView->viewport());
attributesGrid->setSpacing(spacingHint());
attributesView->addChild(attributesGrid);
while(dp) {
@@ -423,22 +423,22 @@ void QalculateDataSetsDialog::objectSelected() {
sval = o->getPropertyDisplayString(dp).c_str();
if(!sval.isEmpty()) {
str = "<b>"; str += dp->title().c_str(); str += ":"; str += "</b>";
- new QLabel(str, attributesGrid);
+ new TQLabel(str, attributesGrid);
KLineEdit *le = new KLineEdit(sval, attributesGrid);
le->setReadOnly(true);
- le->setFrameStyle(QFrame::NoFrame | QFrame::Plain);
- QalculateButtonWithData *button = new QalculateButtonWithData((void*) dp, QIconSet(SmallIcon("editpaste")), "", attributesGrid);
- QObject::connect(button, SIGNAL(clickedWithData(void*)), SLOT(insertObjectData(void*)));
+ le->setFrameStyle(TQFrame::NoFrame | TQFrame::Plain);
+ QalculateButtonWithData *button = new QalculateButtonWithData((void*) dp, TQIconSet(SmallIcon("editpaste")), "", attributesGrid);
+ TQObject::connect(button, SIGNAL(clickedWithData(void*)), SLOT(insertObjectData(void*)));
}
}
dp = ds->getNextProperty(&it);
}
- QWidget *widget = new QWidget(attributesGrid);
- widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding);
+ TQWidget *widget = new TQWidget(attributesGrid);
+ widget->setSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Expanding);
attributesGrid->show();
} else {
delete attributesGrid;
- attributesGrid = new QGrid(3, Qt::Horizontal, attributesView->viewport());
+ attributesGrid = new TQGrid(3, TQt::Horizontal, attributesView->viewport());
attributesGrid->setSpacing(spacingHint());
attributesView->addChild(attributesGrid);
attributesGrid->show();
@@ -486,7 +486,7 @@ void QalculateDataSetsDialog::newObject() {
}
}
-void QalculateDataSetsDialog::objectDoubleClicked(QListViewItem*i) {
+void QalculateDataSetsDialog::objectDoubleClicked(TQListViewItem*i) {
UPDATE_SELECTED_DATASET
selected_object = objectItems[i];
if(!selected_object)