summaryrefslogtreecommitdiffstats
path: root/kexi/plugins/queries
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/plugins/queries
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/plugins/queries')
-rw-r--r--kexi/plugins/queries/kexiaddparamdialog.cpp8
-rw-r--r--kexi/plugins/queries/kexiaddparamdialog.h5
-rw-r--r--kexi/plugins/queries/kexiaddparamwidget.ui36
-rw-r--r--kexi/plugins/queries/kexidynamicqueryparameterdialog.cpp24
-rw-r--r--kexi/plugins/queries/kexidynamicqueryparameterdialog.h11
-rw-r--r--kexi/plugins/queries/kexiparameterlisteditor.ui10
-rw-r--r--kexi/plugins/queries/kexiquerydesignerguieditor.cpp446
-rw-r--r--kexi/plugins/queries/kexiquerydesignerguieditor.h43
-rw-r--r--kexi/plugins/queries/kexiquerydesignersql.cpp146
-rw-r--r--kexi/plugins/queries/kexiquerydesignersql.h17
-rw-r--r--kexi/plugins/queries/kexiquerydesignersqlhistory.cpp166
-rw-r--r--kexi/plugins/queries/kexiquerydesignersqlhistory.h59
-rw-r--r--kexi/plugins/queries/kexiquerypart.cpp50
-rw-r--r--kexi/plugins/queries/kexiquerypart.h21
-rw-r--r--kexi/plugins/queries/kexiqueryview.cpp18
-rw-r--r--kexi/plugins/queries/kexiqueryview.h7
16 files changed, 537 insertions, 530 deletions
diff --git a/kexi/plugins/queries/kexiaddparamdialog.cpp b/kexi/plugins/queries/kexiaddparamdialog.cpp
index fb40f9a2..4b1141be 100644
--- a/kexi/plugins/queries/kexiaddparamdialog.cpp
+++ b/kexi/plugins/queries/kexiaddparamdialog.cpp
@@ -20,14 +20,14 @@
#include <klocale.h>
#include <kcombobox.h>
#include <klineedit.h>
-#include <qvbox.h>
+#include <tqvbox.h>
#include <kexidataprovider.h>
#include "kexiaddparamdialog.h"
#include "kexiaddparamdialog.moc"
#include "kexiaddparamwidget.h"
-KexiAddParamDialog::KexiAddParamDialog(QWidget *parent)
- : KDialogBase(parent, "kexiaddparamdialog", true, i18n("Add Parameter"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true)
+KexiAddParamDialog::KexiAddParamDialog(TQWidget *tqparent)
+ : KDialogBase(tqparent, "kexiaddparamdialog", true, i18n("Add Parameter"), KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true)
{
m_wid=new KexiAddParamWidget(makeVBoxMainWidget());
for (int i=1;i<=KexiDataProvider::Parameter::maxType;i++)
@@ -38,7 +38,7 @@ KexiAddParamDialog::~KexiAddParamDialog()
{
}
-QString KexiAddParamDialog::parameterName() {
+TQString KexiAddParamDialog::parameterName() {
return m_wid->paramname->text();
}
diff --git a/kexi/plugins/queries/kexiaddparamdialog.h b/kexi/plugins/queries/kexiaddparamdialog.h
index 79558a7c..2aa27bf7 100644
--- a/kexi/plugins/queries/kexiaddparamdialog.h
+++ b/kexi/plugins/queries/kexiaddparamdialog.h
@@ -27,11 +27,12 @@ class KexiAddParamWidget;
class KexiAddParamDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiAddParamDialog(QWidget *parent);
+ KexiAddParamDialog(TQWidget *tqparent);
virtual ~KexiAddParamDialog();
- QString parameterName();
+ TQString parameterName();
int parameterType();
private:
KexiAddParamWidget *m_wid;
diff --git a/kexi/plugins/queries/kexiaddparamwidget.ui b/kexi/plugins/queries/kexiaddparamwidget.ui
index 43ec25f1..cddfa20e 100644
--- a/kexi/plugins/queries/kexiaddparamwidget.ui
+++ b/kexi/plugins/queries/kexiaddparamwidget.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>KexiAddParamWidget</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>KexiAddParamWidget</cstring>
</property>
@@ -19,15 +19,15 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLayoutWidget" row="0" column="0">
+ <widget class="TQLayoutWidget" row="0" column="0">
<property name="name">
- <cstring>layout3</cstring>
+ <cstring>tqlayout3</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@@ -35,22 +35,22 @@
<string>Name:</string>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout1</cstring>
+ <cstring>tqlayout1</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>textLabel1_2</cstring>
</property>
<property name="text">
<string>kexi_</string>
</property>
- <property name="alignment">
+ <property name="tqalignment">
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
@@ -73,22 +73,22 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
- <widget class="QLayoutWidget" row="2" column="0">
+ <widget class="TQLayoutWidget" row="2" column="0">
<property name="name">
- <cstring>layout4</cstring>
+ <cstring>tqlayout4</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>textLabel1_4</cstring>
</property>
@@ -96,22 +96,22 @@
<string>Message:</string>
</property>
</widget>
- <widget class="QLineEdit">
+ <widget class="TQLineEdit">
<property name="name">
<cstring>message</cstring>
</property>
</widget>
</vbox>
</widget>
- <widget class="QLayoutWidget" row="1" column="0">
+ <widget class="TQLayoutWidget" row="1" column="0">
<property name="name">
- <cstring>layout5</cstring>
+ <cstring>tqlayout5</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>textLabel1_3</cstring>
</property>
@@ -119,7 +119,7 @@
<string>Type:</string>
</property>
</widget>
- <widget class="QComboBox">
+ <widget class="TQComboBox">
<property name="name">
<cstring>typecombo</cstring>
</property>
@@ -128,7 +128,7 @@
</widget>
</grid>
</widget>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>klineedit.h</includehint>
</includehints>
diff --git a/kexi/plugins/queries/kexidynamicqueryparameterdialog.cpp b/kexi/plugins/queries/kexidynamicqueryparameterdialog.cpp
index 4a77f37c..938d407f 100644
--- a/kexi/plugins/queries/kexidynamicqueryparameterdialog.cpp
+++ b/kexi/plugins/queries/kexidynamicqueryparameterdialog.cpp
@@ -21,24 +21,24 @@
#include "kexidynamicqueryparameterdialog.h"
#include "kexidynamicqueryparameterdialog.moc"
-#include <qvbox.h>
+#include <tqvbox.h>
#include <klocale.h>
#include <kdebug.h>
-#include <qlineedit.h>
-#include <qobjectlist.h>
+#include <tqlineedit.h>
+#include <tqobjectlist.h>
-KexiDynamicQueryParameterDialog::KexiDynamicQueryParameterDialog(QWidget *parent,
+KexiDynamicQueryParameterDialog::KexiDynamicQueryParameterDialog(TQWidget *tqparent,
KexiDataProvider::Parameters *values, const KexiDataProvider::ParameterList &list):
- KDialogBase(parent, "paramddialog", true, i18n("Query Parameters"),
+ KDialogBase(tqparent, "paramddialog", true, i18n("Query Parameters"),
KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true )
{
m_values=values;
int y;
- m_mainView=new QVBox(this);
+ m_mainView=new TQVBox(this);
for (KexiDataProvider::ParameterList::const_iterator it=list.begin();
it!=list.end();++it) {
- QLineEdit *le=new QLineEdit(m_mainView,(*it).name.utf8());
+ TQLineEdit *le=new TQLineEdit(m_mainView,(*it).name.utf8());
le->setText((*values)[(*it).name]);
}
@@ -48,14 +48,14 @@ KexiDynamicQueryParameterDialog::KexiDynamicQueryParameterDialog(QWidget *parent
KexiDynamicQueryParameterDialog::~KexiDynamicQueryParameterDialog() {}
void KexiDynamicQueryParameterDialog::slotOk() {
- QObjectList *l=queryList(0,"kexi_.*",true,true);
- QObjectListIt it(*l);
- QObject *obj;
+ TQObjectList *l=queryList(0,"kexi_.*",true,true);
+ TQObjectListIt it(*l);
+ TQObject *obj;
kdDebug()<<"KexiDynamicQueryParameterDialog::slotOk()"<<endl;
while ((obj=it.current())!=0) {
kdDebug()<<"KexiDynamicQueryParameterDialog::slotOk()::loop"<<endl;
- (*m_values)[QString().fromUtf8(obj->name())]=
- (dynamic_cast<QLineEdit*>(obj))->text();
+ (*m_values)[TQString().fromUtf8(obj->name())]=
+ (dynamic_cast<TQLineEdit*>(obj))->text();
++it;
}
delete l;
diff --git a/kexi/plugins/queries/kexidynamicqueryparameterdialog.h b/kexi/plugins/queries/kexidynamicqueryparameterdialog.h
index b315e4f9..60137c1f 100644
--- a/kexi/plugins/queries/kexidynamicqueryparameterdialog.h
+++ b/kexi/plugins/queries/kexidynamicqueryparameterdialog.h
@@ -17,27 +17,28 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef _KEXI_DYNAMIC_QUERY_PARAMETER_DIALOG_H_
-#define _KEXI_DYNAMIC_QUERY_PARAMETER_DIALOG_H_
+#ifndef _KEXI_DYNAMIC_TQUERY_PARAMETER_DIALOG_H_
+#define _KEXI_DYNAMIC_TQUERY_PARAMETER_DIALOG_H_
#include <kdialogbase.h>
#include <kexidataprovider.h>
-class QVBox;
+class TQVBox;
class KexiDynamicQueryParameterDialog : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiDynamicQueryParameterDialog(QWidget *parent,KexiDataProvider::Parameters *, const KexiDataProvider::ParameterList &);
+ KexiDynamicQueryParameterDialog(TQWidget *tqparent,KexiDataProvider::Parameters *, const KexiDataProvider::ParameterList &);
virtual ~KexiDynamicQueryParameterDialog();
protected:
virtual void slotOk();
private:
//temporary only. Later a different widget will be used
- QVBox *m_mainView;
+ TQVBox *m_mainView;
KexiDataProvider::Parameters *m_values;
};
diff --git a/kexi/plugins/queries/kexiparameterlisteditor.ui b/kexi/plugins/queries/kexiparameterlisteditor.ui
index ac4a3230..dd5a00d8 100644
--- a/kexi/plugins/queries/kexiparameterlisteditor.ui
+++ b/kexi/plugins/queries/kexiparameterlisteditor.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
<class>KexiParameterListEditor</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>KexiParameterListEditor</cstring>
</property>
@@ -16,7 +16,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
- <widget class="QLabel">
+ <widget class="TQLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@@ -51,9 +51,9 @@
<cstring>list</cstring>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout1</cstring>
+ <cstring>tqlayout1</cstring>
</property>
<hbox>
<property name="name">
@@ -79,7 +79,7 @@
</widget>
</vbox>
</widget>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>klistview.h</includehint>
<includehint>kpushbutton.h</includehint>
diff --git a/kexi/plugins/queries/kexiquerydesignerguieditor.cpp b/kexi/plugins/queries/kexiquerydesignerguieditor.cpp
index d67573e8..a6205222 100644
--- a/kexi/plugins/queries/kexiquerydesignerguieditor.cpp
+++ b/kexi/plugins/queries/kexiquerydesignerguieditor.cpp
@@ -20,10 +20,10 @@
#include "kexiquerydesignerguieditor.h"
-#include <qlayout.h>
-#include <qpainter.h>
-#include <qdom.h>
-#include <qregexp.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
+#include <tqdom.h>
+#include <tqregexp.h>
#include <kdebug.h>
#include <klocale.h>
@@ -56,14 +56,14 @@
#include "kexiquerypart.h"
-//! @todo remove KEXI_NO_QUERY_TOTALS later
-#define KEXI_NO_QUERY_TOTALS
+//! @todo remove KEXI_NO_TQUERY_TOTALS later
+#define KEXI_NO_TQUERY_TOTALS
//! indices for table columns
#define COLUMN_ID_COLUMN 0
#define COLUMN_ID_TABLE 1
#define COLUMN_ID_VISIBLE 2
-#ifdef KEXI_NO_QUERY_TOTALS
+#ifdef KEXI_NO_TQUERY_TOTALS
# define COLUMN_ID_SORTING 3
# define COLUMN_ID_CRITERIA 4
#else
@@ -84,7 +84,7 @@ public:
}
bool changeSingleCellValue(KexiTableItem &item, int columnNumber,
- const QVariant& value, KexiDB::ResultInfo* result)
+ const TQVariant& value, KexiDB::ResultInfo* result)
{
data->clearRowEditBuffer();
if (!data->updateRowEditBuffer(&item, columnNumber, value)
@@ -99,11 +99,11 @@ public:
KexiTableViewData *data;
KexiDataTable *dataTable;
- QGuardedPtr<KexiDB::Connection> conn;
+ TQGuardedPtr<KexiDB::Connection> conn;
KexiRelationWidget *relations;
KexiSectionHeader *head;
- QSplitter *spl;
+ TQSplitter *spl;
/*! Used to remember in slotDroppedAtRow() what data was dropped,
so we can create appropriate prop. set in slotRowInserted()
@@ -116,46 +116,46 @@ public:
This information is cached and entirely refreshed on updateColumnsData().
The dict is filled with (char*)1 values (doesn't matter what it is);
*/
- QDict<char> fieldColumnIdentifiers;
+ TQDict<char> fieldColumnIdentifiers;
KexiDataAwarePropertySet* sets;
KexiTableItem *droppedNewItem;
- QString droppedNewTable, droppedNewField;
+ TQString droppedNewTable, droppedNewField;
bool slotTableAdded_enabled : 1;
};
-static bool isAsterisk(const QString& tableName, const QString& fieldName)
+static bool isAsterisk(const TQString& tableName, const TQString& fieldName)
{
return tableName=="*" || fieldName.endsWith("*");
}
//! @internal \return true if sorting is allowed for \a fieldName and \a tableName
-static bool sortingAllowed(const QString& fieldName, const QString& tableName) {
+static bool sortingAllowed(const TQString& fieldName, const TQString& tableName) {
return ! (fieldName=="*" || (fieldName.isEmpty() && tableName=="*"));
}
//=========================================================
KexiQueryDesignerGuiEditor::KexiQueryDesignerGuiEditor(
- KexiMainWindow *mainWin, QWidget *parent, const char *name)
- : KexiViewBase(mainWin, parent, name)
+ KexiMainWindow *mainWin, TQWidget *tqparent, const char *name)
+ : KexiViewBase(mainWin, tqparent, name)
, d( new Private() )
{
d->conn = mainWin->project()->dbConnection();
- d->spl = new QSplitter(Vertical, this);
+ d->spl = new TQSplitter(Qt::Vertical, this);
d->spl->setChildrenCollapsible(false);
d->relations = new KexiRelationWidget(mainWin, d->spl, "relations");
- connect(d->relations, SIGNAL(tableAdded(KexiDB::TableSchema&)),
- this, SLOT(slotTableAdded(KexiDB::TableSchema&)));
- connect(d->relations, SIGNAL(tableHidden(KexiDB::TableSchema&)),
- this, SLOT(slotTableHidden(KexiDB::TableSchema&)));
- connect(d->relations, SIGNAL(tableFieldDoubleClicked(KexiDB::TableSchema*,const QString&)),
- this, SLOT(slotTableFieldDoubleClicked(KexiDB::TableSchema*,const QString&)));
-
- d->head = new KexiSectionHeader(i18n("Query Columns"), Vertical, d->spl);
+ connect(d->relations, TQT_SIGNAL(tableAdded(KexiDB::TableSchema&)),
+ this, TQT_SLOT(slotTableAdded(KexiDB::TableSchema&)));
+ connect(d->relations, TQT_SIGNAL(tableHidden(KexiDB::TableSchema&)),
+ this, TQT_SLOT(slotTableHidden(KexiDB::TableSchema&)));
+ connect(d->relations, TQT_SIGNAL(tableFieldDoubleClicked(KexiDB::TableSchema*,const TQString&)),
+ this, TQT_SLOT(slotTableFieldDoubleClicked(KexiDB::TableSchema*,const TQString&)));
+
+ d->head = new KexiSectionHeader(i18n("Query Columns"),Qt::Vertical, d->spl);
d->dataTable = new KexiDataTable(mainWin, d->head, "guieditor_dataTable", false);
d->dataTable->dataAwareObject()->setSpreadSheetMode();
@@ -164,39 +164,39 @@ KexiQueryDesignerGuiEditor::KexiQueryDesignerGuiEditor(
initTableColumns();
initTableRows();
- QValueList<int> c;
+ TQValueList<int> c;
c << COLUMN_ID_COLUMN << COLUMN_ID_TABLE << COLUMN_ID_CRITERIA;
if (d->dataTable->tableView()/*sanity*/) {
d->dataTable->tableView()->adjustColumnWidthToContents(COLUMN_ID_VISIBLE);
d->dataTable->tableView()->adjustColumnWidthToContents(COLUMN_ID_SORTING);
d->dataTable->tableView()->maximizeColumnsWidth( c );
d->dataTable->tableView()->setDropsAtRowEnabled(true);
- connect(d->dataTable->tableView(), SIGNAL(dragOverRow(KexiTableItem*,int,QDragMoveEvent*)),
- this, SLOT(slotDragOverTableRow(KexiTableItem*,int,QDragMoveEvent*)));
- connect(d->dataTable->tableView(), SIGNAL(droppedAtRow(KexiTableItem*,int,QDropEvent*,KexiTableItem*&)),
- this, SLOT(slotDroppedAtRow(KexiTableItem*,int,QDropEvent*,KexiTableItem*&)));
- connect(d->dataTable->tableView(), SIGNAL(newItemAppendedForAfterDeletingInSpreadSheetMode()),
- this, SLOT(slotNewItemAppendedForAfterDeletingInSpreadSheetMode()));
+ connect(d->dataTable->tableView(), TQT_SIGNAL(dragOverRow(KexiTableItem*,int,TQDragMoveEvent*)),
+ this, TQT_SLOT(slotDragOverTableRow(KexiTableItem*,int,TQDragMoveEvent*)));
+ connect(d->dataTable->tableView(), TQT_SIGNAL(droppedAtRow(KexiTableItem*,int,TQDropEvent*,KexiTableItem*&)),
+ this, TQT_SLOT(slotDroppedAtRow(KexiTableItem*,int,TQDropEvent*,KexiTableItem*&)));
+ connect(d->dataTable->tableView(), TQT_SIGNAL(newItemAppendedForAfterDeletingInSpreadSheetMode()),
+ this, TQT_SLOT(slotNewItemAppendedForAfterDeletingInSpreadSheetMode()));
}
- connect(d->data, SIGNAL(aboutToChangeCell(KexiTableItem*,int,QVariant&,KexiDB::ResultInfo*)),
- this, SLOT(slotBeforeCellChanged(KexiTableItem*,int,QVariant&,KexiDB::ResultInfo*)));
- connect(d->data, SIGNAL(rowInserted(KexiTableItem*,uint,bool)),
- this, SLOT(slotRowInserted(KexiTableItem*,uint,bool)));
- connect(d->relations, SIGNAL(tablePositionChanged(KexiRelationViewTableContainer*)),
- this, SLOT(slotTablePositionChanged(KexiRelationViewTableContainer*)));
- connect(d->relations, SIGNAL(aboutConnectionRemove(KexiRelationViewConnection*)),
- this, SLOT(slotAboutConnectionRemove(KexiRelationViewConnection*)));
-
- QVBoxLayout *l = new QVBoxLayout(this);
+ connect(d->data, TQT_SIGNAL(aboutToChangeCell(KexiTableItem*,int,TQVariant&,KexiDB::ResultInfo*)),
+ this, TQT_SLOT(slotBeforeCellChanged(KexiTableItem*,int,TQVariant&,KexiDB::ResultInfo*)));
+ connect(d->data, TQT_SIGNAL(rowInserted(KexiTableItem*,uint,bool)),
+ this, TQT_SLOT(slotRowInserted(KexiTableItem*,uint,bool)));
+ connect(d->relations, TQT_SIGNAL(tablePositionChanged(KexiRelationViewTableContainer*)),
+ this, TQT_SLOT(slotTablePositionChanged(KexiRelationViewTableContainer*)));
+ connect(d->relations, TQT_SIGNAL(aboutConnectionRemove(KexiRelationViewConnection*)),
+ this, TQT_SLOT(slotAboutConnectionRemove(KexiRelationViewConnection*)));
+
+ TQVBoxLayout *l = new TQVBoxLayout(this);
l->addWidget(d->spl);
addChildView(d->relations);
addChildView(d->dataTable);
setViewWidget(d->dataTable, true);
- d->relations->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
- d->head->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
+ d->relations->tqsetSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Expanding);
+ d->head->tqsetSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Expanding);
updateGeometry();
- d->spl->setSizes(QValueList<int>()<< 800<<400);
+ d->spl->setSizes(TQValueList<int>()<< 800<<400);
}
KexiQueryDesignerGuiEditor::~KexiQueryDesignerGuiEditor()
@@ -222,14 +222,14 @@ KexiQueryDesignerGuiEditor::initTableColumns()
KexiTableViewColumn *col3 = new KexiTableViewColumn("visible", KexiDB::Field::Boolean, i18n("Visible"),
i18n("Describes visibility for a given field or expression."));
- col3->field()->setDefaultValue( QVariant(false, 0) );
+ col3->field()->setDefaultValue( TQVariant(false, 0) );
col3->field()->setNotNull( true );
d->data->addColumn(col3);
-#ifndef KEXI_NO_QUERY_TOTALS
+#ifndef KEXI_NO_TQUERY_TOTALS
KexiTableViewColumn *col4 = new KexiTableViewColumn("totals", KexiDB::Field::Enum, i18n("Totals"),
i18n("Describes a way of computing totals for a given field or expression."));
- QValueVector<QString> totalsTypes;
+ TQValueVector<TQString> totalsTypes;
totalsTypes.append( i18n("Group by") );
totalsTypes.append( i18n("Sum") );
totalsTypes.append( i18n("Average") );
@@ -242,7 +242,7 @@ KexiQueryDesignerGuiEditor::initTableColumns()
KexiTableViewColumn *col5 = new KexiTableViewColumn("sort", KexiDB::Field::Enum, i18n("Sorting"),
i18n("Describes a way of sorting for a given field."));
- QValueVector<QString> sortTypes;
+ TQValueVector<TQString> sortTypes;
sortTypes.append( "" );
sortTypes.append( i18n("Ascending") );
sortTypes.append( i18n("Descending") );
@@ -264,7 +264,7 @@ void KexiQueryDesignerGuiEditor::initTableRows()
for (int i=0; i<(int)d->sets->size(); i++) {
KexiTableItem* item;
d->data->append(item = d->data->createItem());
- item->at(COLUMN_ID_VISIBLE) = QVariant(false, 0);
+ item->at(COLUMN_ID_VISIBLE) = TQVariant(false, 0);
}
d->dataTable->dataAwareObject()->setData(d->data);
@@ -275,22 +275,22 @@ void KexiQueryDesignerGuiEditor::updateColumnsData()
{
d->dataTable->dataAwareObject()->acceptRowEdit();
- QStringList sortedTableNames;
+ TQStringList sortedTableNames;
for (TablesDictIterator it(*d->relations->tables());it.current();++it)
sortedTableNames += it.current()->schema()->name();
qHeapSort( sortedTableNames );
//several tables can be hidden now, so remove rows for these tables
- QValueList<int> rowsToDelete;
+ TQValueList<int> rowsToDelete;
for (int r = 0; r<(int)d->sets->size(); r++) {
KoProperty::Set *set = d->sets->at(r);
if (set) {
- QString tableName = (*set)["table"].value().toString();
- QString fieldName = (*set)["field"].value().toString();
+ TQString tableName = (*set)["table"].value().toString();
+ TQString fieldName = (*set)["field"].value().toString();
const bool allTablesAsterisk = tableName=="*" && d->relations->tables()->isEmpty();
const bool fieldNotFound = tableName!="*"
&& !(*set)["isExpression"].value().toBool()
- && sortedTableNames.end() == qFind( sortedTableNames.begin(), sortedTableNames.end(), tableName );
+ && sortedTableNames.end() == tqFind( sortedTableNames.begin(), sortedTableNames.end(), tableName );
if (allTablesAsterisk || fieldNotFound) {
//table not found: mark this line for later removal
@@ -313,12 +313,12 @@ void KexiQueryDesignerGuiEditor::updateColumnsData()
// tempData()->clearQuery();
tempData()->unregisterForTablesSchemaChanges();
- for (QStringList::const_iterator it = sortedTableNames.constBegin();
+ for (TQStringList::const_iterator it = sortedTableNames.constBegin();
it!=sortedTableNames.constEnd(); ++it)
{
//table
/*! @todo what about query? */
- KexiDB::TableSchema *table = d->relations->tables()->find(*it)->schema()->table();
+ KexiDB::TableSchema *table = d->relations->tables()->tqfind(*it)->schema()->table();
d->conn->registerForTableSchemaChanges(*tempData(), *table); //this table will be used
item = d->tablesColumnData->createItem(); //new KexiTableItem(2);
(*item)[COLUMN_ID_COLUMN]=table->name();
@@ -333,7 +333,7 @@ void KexiQueryDesignerGuiEditor::updateColumnsData()
for (KexiDB::Field::ListIterator t_it = table->fieldsIterator();t_it.current();++t_it) {
item = d->fieldColumnData->createItem(); // new KexiTableItem(2);
(*item)[COLUMN_ID_COLUMN]=table->name()+"."+t_it.current()->name();
- (*item)[COLUMN_ID_TABLE]=QString(" ") + t_it.current()->name();
+ (*item)[COLUMN_ID_TABLE]=TQString(" ") + t_it.current()->name();
d->fieldColumnData->append( item );
d->fieldColumnIdentifiers.insert((*item)[COLUMN_ID_COLUMN].toString(), (char*)1); //cache
}
@@ -349,16 +349,16 @@ KexiRelationWidget *KexiQueryDesignerGuiEditor::relationView() const
KexiQueryPart::TempData *
KexiQueryDesignerGuiEditor::tempData() const
{
- return static_cast<KexiQueryPart::TempData*>(parentDialog()->tempData());
+ return static_cast<KexiQueryPart::TempData*>(tqparentDialog()->tempData());
}
-static QString msgCannotSwitch_EmptyDesign() {
+static TQString msgCannotSwitch_EmptyDesign() {
return i18n("Cannot switch to data view, because query design is empty.\n"
"First, please create your design.");
}
bool
-KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg)
+KexiQueryDesignerGuiEditor::buildSchema(TQString *errMsg)
{
//build query schema
KexiQueryPart::TempData * temp = tempData();
@@ -378,7 +378,7 @@ KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg)
// -WHERE expression
// -ORDER BY list
KexiDB::BaseExpr *whereExpr = 0;
- const uint count = QMIN(d->data->count(), d->sets->size());
+ const uint count = TQMIN(d->data->count(), d->sets->size());
bool fieldsFound = false;
KexiTableViewData::Iterator it(d->data->iterator());
for (uint i=0; i<count && it.current(); ++it, i++) {
@@ -388,29 +388,29 @@ KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg)
d->dataTable->dataAwareObject()->setCursorPosition(i,0);
if (errMsg)
*errMsg = i18n("Select column for table \"%1\"")
- .arg(it.current()->at(COLUMN_ID_TABLE).toString());
+ .tqarg(it.current()->at(COLUMN_ID_TABLE).toString());
return false;
}
KoProperty::Set *set = d->sets->at(i);
if (set) {
- QString tableName = (*set)["table"].value().toString().stripWhiteSpace();
- QString fieldName = (*set)["field"].value().toString();
- QString fieldAndTableName = fieldName;
+ TQString tableName = (*set)["table"].value().toString().stripWhiteSpace();
+ TQString fieldName = (*set)["field"].value().toString();
+ TQString fieldAndTableName = fieldName;
KexiDB::Field *currentField = 0; // will be set if this column is a single field
KexiDB::QueryColumnInfo* currentColumn = 0;
if (!tableName.isEmpty())
fieldAndTableName.prepend(tableName+".");
const bool fieldVisible = (*set)["visible"].value().toBool();
- QString criteriaStr = (*set)["criteria"].value().toString();
- QCString alias = (*set)["alias"].value().toCString();
+ TQString criteriaStr = (*set)["criteria"].value().toString();
+ TQCString alias = (*set)["alias"].value().toCString();
if (!criteriaStr.isEmpty()) {
int token;
KexiDB::BaseExpr *criteriaExpr = parseExpressionString(criteriaStr, token,
true/*allowRelationalOperator*/);
if (!criteriaExpr) {//for sanity
if (errMsg)
- *errMsg = i18n("Invalid criteria \"%1\"").arg(criteriaStr);
+ *errMsg = i18n("Invalid criteria \"%1\"").tqarg(criteriaStr);
delete whereExpr;
return false;
}
@@ -431,7 +431,7 @@ KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg)
false/*!allowRelationalOperator*/);
if (!columnExpr) {
if (errMsg)
- *errMsg = i18n("Invalid expression \"%1\"").arg(fieldName);
+ *errMsg = i18n("Invalid expression \"%1\"").tqarg(fieldName);
return false;
}
temp->query()->addExpression(columnExpr, fieldVisible);
@@ -523,7 +523,7 @@ KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg)
fieldNumber++;
KexiDB::Field *currentField = 0;
KexiDB::QueryColumnInfo *currentColumn = 0;
- QString sortingString( (*set)["sorting"].value().toString() );
+ TQString sortingString( (*set)["sorting"].value().toString() );
if (sortingString!="ascending" && sortingString!="descending")
continue;
if (!(*set)["visible"].value().toBool()) {
@@ -547,7 +547,7 @@ KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg)
//! @todo support expressions here
continue;
//! @todo ok, but not for expressions
- QString aliasString( (*set)["alias"].value().toString() );
+ TQString aliasString( (*set)["alias"].value().toString() );
currentColumn = temp->query()->columnInfo(
(*set)["table"].value().toString() + "."
+ (aliasString.isEmpty() ? currentField->name() : aliasString) );
@@ -581,14 +581,14 @@ KexiQueryDesignerGuiEditor::beforeSwitchTo(int mode, bool &dontStore)
// if (!d->dataTable->dataAwareObject()->acceptRowEdit())
// return cancelled;
- if (!dirty() && parentDialog()->neverSaved()) {
+ if (!dirty() && tqparentDialog()->neverSaved()) {
KMessageBox::information(this, msgCannotSwitch_EmptyDesign());
return cancelled;
}
if (dirty() || !tempData()->query()) {
//remember current design in a temporary structure
dontStore=true;
- QString errMsg;
+ TQString errMsg;
//build schema; problems are not allowed
if (!buildSchema(&errMsg)) {
KMessageBox::sorry(this, errMsg);
@@ -618,13 +618,13 @@ tristate
KexiQueryDesignerGuiEditor::afterSwitchFrom(int mode)
{
const bool was_dirty = dirty();
- KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection();
+ KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection();
if (mode==Kexi::NoViewMode || (mode==Kexi::DataViewMode && !tempData()->query())) {
//this is not a SWITCH but a fresh opening in this view mode
if (!m_dialog->neverSaved()) {
if (!loadLayout()) {
//err msg
- parentDialog()->setStatus(conn,
+ tqparentDialog()->settqStatus(conn,
i18n("Query definition loading failed."),
i18n("Query design may be corrupted so it could not be opened even in text view.\n"
"You can delete the query and create it again."));
@@ -633,13 +633,13 @@ KexiQueryDesignerGuiEditor::afterSwitchFrom(int mode)
// Invalid queries case:
// KexiDialogBase::switchToViewMode() first opens DesignViewMode,
// and then KexiQueryPart::loadSchemaData() doesn't allocate QuerySchema object
- // do we're carefully looking at parentDialog()->schemaData()
- KexiDB::QuerySchema * q = dynamic_cast<KexiDB::QuerySchema *>(parentDialog()->schemaData());
+ // do we're carefully looking at tqparentDialog()->schemaData()
+ KexiDB::QuerySchema * q = dynamic_cast<KexiDB::QuerySchema *>(tqparentDialog()->schemaData());
if (q) {
KexiDB::ResultInfo result;
showFieldsForQuery( q, result );
if (!result.success) {
- parentDialog()->setStatus(&result, i18n("Query definition loading failed."));
+ tqparentDialog()->settqStatus(&result, i18n("Query definition loading failed."));
tempData()->proposeOpeningInTextViewModeBecauseOfProblems = true;
return false;
}
@@ -662,7 +662,7 @@ KexiQueryDesignerGuiEditor::afterSwitchFrom(int mode)
KexiDB::ResultInfo result;
showFieldsAndRelationsForQuery( tempData()->query(), result );
if (!result.success) {
- parentDialog()->setStatus(&result, i18n("Query definition loading failed."));
+ tqparentDialog()->settqStatus(&result, i18n("Query definition loading failed."));
return false;
}
}
@@ -698,7 +698,7 @@ KexiQueryDesignerGuiEditor::storeNewData(const KexiDB::SchemaData& sdata, bool &
cancel = true;
return 0;
}
- QString errMsg;
+ TQString errMsg;
KexiQueryPart::TempData * temp = tempData();
if (!temp->query() || !(viewMode()==Kexi::DesignViewMode && !temp->queryChangedInPreviousView)) {
//only rebuild schema if it has not been rebuilt previously
@@ -809,11 +809,11 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
//2. Collect information about criterias
// --this must be top level chain of AND's
// --this will also show joins as: [table1.]field1 = [table2.]field2
- QDict<KexiDB::BaseExpr> criterias(101, false);
+ TQDict<KexiDB::BaseExpr> criterias(101, false);
KexiDB::BaseExpr* e = query->whereExpression();
KexiDB::BaseExpr* eItem = 0;
while (e) {
- //eat parentheses because the expression can be (....) AND (... AND ... )
+ //eat tqparentheses because the expression can be (....) AND (... AND ... )
while (e && e->toUnary() && e->token()=='(')
e = e->toUnary()->arg();
@@ -826,7 +826,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
e = 0;
}
- //eat parentheses
+ //eat tqparentheses
while (eItem && eItem->toUnary() && eItem->token()=='(')
eItem = eItem->toUnary()->arg();
@@ -877,14 +877,14 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
//3. show fields (including * and table.*)
uint row_num = 0;
KexiDB::Field *field;
- QPtrDict<char> usedCriterias(101); // <-- used criterias will be saved here
+ TQPtrDict<char> usedCriterias(101); // <-- used criterias will be saved here
// so in step 4. we will be able to add
// remaining invisible columns with criterias
for (KexiDB::Field::ListIterator it(*query->fields());
(field = it.current()); ++it, row_num++)
{
//append a new row
- QString tableName, fieldName, columnAlias, criteriaString;
+ TQString tableName, fieldName, columnAlias, criteriaString;
KexiDB::BinaryExpr *criteriaExpr = 0;
KexiDB::BaseExpr *criteriaArgument = 0;
if (field->isQueryAsterisk()) {
@@ -901,7 +901,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
columnAlias = query->columnAlias(row_num);
if (field->isExpression()) {
// if (columnAlias.isEmpty()) {
-// columnAlias = i18n("expression", "expr%1").arg(row_num); //TODO
+// columnAlias = i18n("expression", "expr%1").tqarg(row_num); //TODO
// }
// if (columnAlias.isEmpty())
//TODO: ok? perhaps do not allow to omit aliases?
@@ -916,8 +916,8 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
if (!criteriaArgument) {//try table.field
criteriaArgument = criterias[tableName+"."+fieldName];
}
- if (criteriaArgument) {//criteria expression is just a parent of argument
- criteriaExpr = criteriaArgument->parent()->toBinary();
+ if (criteriaArgument) {//criteria expression is just a tqparent of argument
+ criteriaExpr = criteriaArgument->tqparent()->toBinary();
usedCriterias.insert(criteriaArgument, (char*)1); //save info. about used criteria
}
}
@@ -942,7 +942,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
if (field->isExpression()) {
// (*newItem)[COLUMN_ID_COLUMN] = ;
if (!d->changeSingleCellValue(*newItem, COLUMN_ID_COLUMN,
- QVariant(columnAlias + ": " + field->expression()->toString()), &result))
+ TQVariant(columnAlias + ": " + field->expression()->toString()), &result))
return; //problems with setting column expression
}
}
@@ -950,7 +950,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
//4. show ORDER BY information
d->data->clearRowEditBuffer();
KexiDB::OrderByColumnList &orderByColumns = query->orderByColumnList();
- QMap<KexiDB::QueryColumnInfo*,int> columnsOrder(
+ TQMap<KexiDB::QueryColumnInfo*,int> columnsOrder(
query->columnsOrder(KexiDB::QuerySchema::UnexpandedListWithoutAsterisks) );
for (KexiDB::OrderByColumn::ListConstIterator orderByColumnsIt( orderByColumns.constBegin() );
orderByColumnsIt!=orderByColumns.constEnd(); ++orderByColumnsIt)
@@ -961,7 +961,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
if (column) {
//sorting for visible column
if (column->visible) {
- if (columnsOrder.contains(column)) {
+ if (columnsOrder.tqcontains(column)) {
const int columnPosition = columnsOrder[ column ];
rowItem = d->data->at( columnPosition );
rowPropertySet = d->sets->at( columnPosition );
@@ -974,7 +974,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
else if ((*orderByColumnsIt).field()) {
//this will be presented as invisible field: create new row
field = (*orderByColumnsIt).field();
- QString tableName( field->table() ? field->table()->name() : QString::null );
+ TQString tableName( field->table() ? field->table()->name() : TQString() );
rowItem = createNewRow( tableName, field->name(), false /* !visible*/);
d->dataTable->dataAwareObject()->insertItem(rowItem, row_num);
rowPropertySet = createPropertySet( row_num, tableName, field->name(), true /*newOne*/ );
@@ -992,17 +992,17 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
d->data->saveRowChanges(*rowItem, true);
(*rowPropertySet)["sorting"].clearModifiedFlag(); // this property should look "fresh"
if (!rowItem->at(COLUMN_ID_VISIBLE).toBool()) //update
- (*rowPropertySet)["visible"].setValue(QVariant(false,0), false/*rememberOldValue*/);
+ (*rowPropertySet)["visible"].setValue(TQVariant(false,0), false/*rememberOldValue*/);
}
}
//5. Show fields for unused criterias (with "Visible" column set to false)
KexiDB::BaseExpr *criteriaArgument; // <-- contains field or table.field
- for (QDictIterator<KexiDB::BaseExpr> it(criterias); (criteriaArgument = it.current()); ++it) {
+ for (TQDictIterator<KexiDB::BaseExpr> it(criterias); (criteriaArgument = it.current()); ++it) {
if (usedCriterias[it.current()])
continue;
//unused: append a new row
- KexiDB::BinaryExpr *criteriaExpr = criteriaArgument->parent()->toBinary();
+ KexiDB::BinaryExpr *criteriaExpr = criteriaArgument->tqparent()->toBinary();
if (!criteriaExpr) {
kexipluginswarn << "KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(): "
"criteriaExpr is not a binary expr" << endl;
@@ -1018,7 +1018,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
}
}
KexiDB::Field* field = 0;
- if (-1 == columnNameArgument->name.find('.') && query->tables()->count()==1) {
+ if (-1 == columnNameArgument->name.tqfind('.') && query->tables()->count()==1) {
//extreme case: only field name provided for one-table query:
field = query->tables()->first()->field(columnNameArgument->name);
}
@@ -1031,7 +1031,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
"no columnInfo found in the query for name \"" << columnNameArgument->name << endl;
continue;
}
- QString tableName, fieldName, columnAlias, criteriaString;
+ TQString tableName, fieldName, columnAlias, criteriaString;
//! @todo what about ALIAS?
tableName = field->table()->name();
fieldName = field->name();
@@ -1052,7 +1052,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
//! @todo set["alias"].setValue(columnAlias, false);
//// if (!criteriaString.isEmpty())
set["criteria"].setValue( criteriaString, false );
- set["visible"].setValue( QVariant(false,1), false );
+ set["visible"].setValue( TQVariant(false,1), false );
}
//current property set has most probably changed
@@ -1067,32 +1067,32 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
bool KexiQueryDesignerGuiEditor::loadLayout()
{
- QString xml;
+ TQString xml;
// if (!loadDataBlock( xml, "query_layout" )) {
loadDataBlock( xml, "query_layout" );
//TODO errmsg
// return false;
// }
if (xml.isEmpty()) {
- //in a case when query layout was not saved, build layout by hand
+ //in a case when query tqlayout was not saved, build tqlayout by hand
// -- dynamic cast because of a need for handling invalid queries
// (as in KexiQueryDesignerGuiEditor::afterSwitchFrom()):
- KexiDB::QuerySchema * q = dynamic_cast<KexiDB::QuerySchema *>(parentDialog()->schemaData());
+ KexiDB::QuerySchema * q = dynamic_cast<KexiDB::QuerySchema *>(tqparentDialog()->schemaData());
if (q) {
showTablesForQuery( q );
KexiDB::ResultInfo result;
showRelationsForQuery( q, result );
if (!result.success) {
- parentDialog()->setStatus(&result, i18n("Query definition loading failed."));
+ tqparentDialog()->settqStatus(&result, i18n("Query definition loading failed."));
return false;
}
}
return true;
}
- QDomDocument doc;
+ TQDomDocument doc;
doc.setContent(xml);
- QDomElement doc_el = doc.documentElement(), el;
+ TQDomElement doc_el = doc.documentElement(), el;
if (doc_el.tagName()!="query_layout") {
//TODO errmsg
return false;
@@ -1108,9 +1108,9 @@ bool KexiQueryDesignerGuiEditor::loadLayout()
int y = el.attribute("y","-1").toInt();
int width = el.attribute("width","-1").toInt();
int height = el.attribute("height","-1").toInt();
- QRect rect;
+ TQRect rect;
if (x!=-1 || y!=-1 || width!=-1 || height!=-1)
- rect = QRect(x,y,width,height);
+ rect = TQRect(x,y,width,height);
d->relations->addTable( t, rect );
}
else if (el.tagName()=="conn") {
@@ -1140,30 +1140,30 @@ bool KexiQueryDesignerGuiEditor::storeLayout()
KexiDB::Connection::SelectStatementOptions options;
options.identifierEscaping = KexiDB::Driver::EscapeKexi|KexiDB::Driver::EscapeAsNecessary;
options.addVisibleLookupColumns = false;
- QString sqlText = dbConn->selectStatement( *temp->query(), options );
+ TQString sqlText = dbConn->selectStatement( *temp->query(), options );
if (!storeDataBlock( sqlText, "sql" )) {
return false;
}
//serialize detailed XML query definition
- QString xml = "<query_layout>", tmp;
+ TQString xml = "<query_layout>", tmp;
for (TablesDictIterator it(*d->relations->tables()); it.current(); ++it) {
KexiRelationViewTableContainer *table_cont = it.current();
/*! @todo what about query? */
- tmp = QString("<table name=\"")+QString(table_cont->schema()->name())+"\" x=\""
- +QString::number(table_cont->x())
- +"\" y=\""+QString::number(table_cont->y())
- +"\" width=\""+QString::number(table_cont->width())
- +"\" height=\""+QString::number(table_cont->height())
+ tmp = TQString("<table name=\"")+TQString(table_cont->schema()->name())+"\" x=\""
+ +TQString::number(table_cont->x())
+ +"\" y=\""+TQString::number(table_cont->y())
+ +"\" width=\""+TQString::number(table_cont->width())
+ +"\" height=\""+TQString::number(table_cont->height())
+"\"/>";
xml += tmp;
}
KexiRelationViewConnection *con;
for (ConnectionListIterator it(*d->relations->connections()); (con = it.current()); ++it) {
- tmp = QString("<conn mtable=\"") + QString(con->masterTable()->schema()->name())
+ tmp = TQString("<conn mtable=\"") + TQString(con->masterTable()->schema()->name())
+ "\" mfield=\"" + con->masterField() + "\" dtable=\""
- + QString(con->detailsTable()->schema()->name())
+ + TQString(con->detailsTable()->schema()->name())
+ "\" dfield=\"" + con->detailsField() + "\"/>";
xml += tmp;
}
@@ -1177,19 +1177,19 @@ bool KexiQueryDesignerGuiEditor::storeLayout()
return true;
}
-QSize KexiQueryDesignerGuiEditor::sizeHint() const
+TQSize KexiQueryDesignerGuiEditor::tqsizeHint() const
{
- QSize s1 = d->relations->sizeHint();
- QSize s2 = d->head->sizeHint();
- return QSize(QMAX(s1.width(),s2.width()), s1.height()+s2.height());
+ TQSize s1 = d->relations->tqsizeHint();
+ TQSize s2 = d->head->tqsizeHint();
+ return TQSize(TQMAX(s1.width(),s2.width()), s1.height()+s2.height());
}
KexiTableItem*
-KexiQueryDesignerGuiEditor::createNewRow(const QString& tableName, const QString& fieldName,
+KexiQueryDesignerGuiEditor::createNewRow(const TQString& tableName, const TQString& fieldName,
bool visible) const
{
KexiTableItem *newItem = d->data->createItem();
- QString key;
+ TQString key;
if (tableName=="*")
key="*";
else {
@@ -1199,15 +1199,15 @@ KexiQueryDesignerGuiEditor::createNewRow(const QString& tableName, const QString
}
(*newItem)[COLUMN_ID_COLUMN]=key;
(*newItem)[COLUMN_ID_TABLE]=tableName;
- (*newItem)[COLUMN_ID_VISIBLE]=QVariant(visible, 1);
-#ifndef KEXI_NO_QUERY_TOTALS
- (*newItem)[COLUMN_ID_TOTALS]=QVariant(0);
+ (*newItem)[COLUMN_ID_VISIBLE]=TQVariant(visible, 1);
+#ifndef KEXI_NO_TQUERY_TOTALS
+ (*newItem)[COLUMN_ID_TOTALS]=TQVariant(0);
#endif
return newItem;
}
void KexiQueryDesignerGuiEditor::slotDragOverTableRow(
- KexiTableItem * /*item*/, int /*row*/, QDragMoveEvent* e)
+ KexiTableItem * /*item*/, int /*row*/, TQDragMoveEvent* e)
{
if (e->provides("kexi/field")) {
e->acceptAction(true);
@@ -1216,11 +1216,11 @@ void KexiQueryDesignerGuiEditor::slotDragOverTableRow(
void
KexiQueryDesignerGuiEditor::slotDroppedAtRow(KexiTableItem * /*item*/, int /*row*/,
- QDropEvent *ev, KexiTableItem*& newItem)
+ TQDropEvent *ev, KexiTableItem*& newItem)
{
- QString sourceMimeType;
- QString srcTable;
- QString srcField;
+ TQString sourceMimeType;
+ TQString srcTable;
+ TQString srcField;
if (!KexiFieldDrag::decodeSingle(ev,sourceMimeType,srcTable,srcField))
return;
@@ -1236,10 +1236,10 @@ void KexiQueryDesignerGuiEditor::slotNewItemAppendedForAfterDeletingInSpreadShee
{
KexiTableItem *item = d->data->last();
if (item)
- item->at(COLUMN_ID_VISIBLE) = QVariant(false, 0); //the same init as in initTableRows()
+ item->at(COLUMN_ID_VISIBLE) = TQVariant(false, 0); //the same init as in initTableRows()
}
-void KexiQueryDesignerGuiEditor::slotRowInserted(KexiTableItem* item, uint row, bool /*repaint*/)
+void KexiQueryDesignerGuiEditor::slotRowInserted(KexiTableItem* item, uint row, bool /*tqrepaint*/)
{
if (d->droppedNewItem && d->droppedNewItem==item) {
createPropertySet( row, d->droppedNewTable, d->droppedNewField, true );
@@ -1264,35 +1264,35 @@ void KexiQueryDesignerGuiEditor::slotTableHidden(KexiDB::TableSchema & /*t*/)
}
/*! @internal generates smallest unique alias */
-QCString KexiQueryDesignerGuiEditor::generateUniqueAlias() const
+TQCString KexiQueryDesignerGuiEditor::generateUniqueAlias() const
{
//TODO: add option for using non-i18n'd "expr" prefix?
- const QCString expStr
+ const TQCString expStr
= i18n("short for 'expression' word (only latin letters, please)", "expr").latin1();
//TODO: optimization: cache it?
- QAsciiDict<char> aliases(101);
+ TQAsciiDict<char> aliases(101);
for (int r = 0; r<(int)d->sets->size(); r++) {
KoProperty::Set *set = d->sets->at(r);
if (set) {
- const QCString a = (*set)["alias"].value().toCString().lower();
+ const TQCString a = (*set)["alias"].value().toCString().lower();
if (!a.isEmpty())
aliases.insert(a,(char*)1);
}
}
int aliasNr=1;
for (;;aliasNr++) {
- if (!aliases[expStr+QString::number(aliasNr).latin1()])
+ if (!aliases[expStr+TQString::number(aliasNr).latin1()])
break;
}
- return expStr+QString::number(aliasNr).latin1();
+ return expStr+TQString::number(aliasNr).latin1();
}
//! @todo this is primitive, temporary: reuse SQL parser
KexiDB::BaseExpr*
-KexiQueryDesignerGuiEditor::parseExpressionString(const QString& fullString, int& token,
+KexiQueryDesignerGuiEditor::parseExpressionString(const TQString& fullString, int& token,
bool allowRelationalOperator)
{
- QString str = fullString.stripWhiteSpace();
+ TQString str = fullString.stripWhiteSpace();
int len = 0;
//KexiDB::BaseExpr *expr = 0;
//1. get token
@@ -1333,7 +1333,7 @@ KexiQueryDesignerGuiEditor::parseExpressionString(const QString& fullString, int
return 0;
KexiDB::BaseExpr *valueExpr = 0;
- QRegExp re;
+ TQRegExp re;
if (str.length()>=2 &&
(
(str.startsWith("\"") && str.endsWith("\""))
@@ -1345,38 +1345,38 @@ KexiQueryDesignerGuiEditor::parseExpressionString(const QString& fullString, int
else if (str.startsWith("[") && str.endsWith("]")) {
valueExpr = new KexiDB::QueryParameterExpr(str.mid(1,str.length()-2));
}
- else if ((re = QRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})")).exactMatch( str ))
+ else if ((re = TQRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})")).exactMatch( str ))
{
- valueExpr = new KexiDB::ConstExpr(DATE_CONST, QDate::fromString(
+ valueExpr = new KexiDB::ConstExpr(DATE_CONST, TQDate::fromString(
re.cap(1).rightJustify(4, '0')+"-"+re.cap(2).rightJustify(2, '0')
+"-"+re.cap(3).rightJustify(2, '0'), Qt::ISODate));
}
- else if ((re = QRegExp("(\\d{1,2}):(\\d{1,2})")).exactMatch( str )
- || (re = QRegExp("(\\d{1,2}):(\\d{1,2}):(\\d{1,2})")).exactMatch( str ))
+ else if ((re = TQRegExp("(\\d{1,2}):(\\d{1,2})")).exactMatch( str )
+ || (re = TQRegExp("(\\d{1,2}):(\\d{1,2}):(\\d{1,2})")).exactMatch( str ))
{
- QString res = re.cap(1).rightJustify(2, '0')+":"+re.cap(2).rightJustify(2, '0')
+ TQString res = re.cap(1).rightJustify(2, '0')+":"+re.cap(2).rightJustify(2, '0')
+":"+re.cap(3).rightJustify(2, '0');
// kexipluginsdbg << res << endl;
- valueExpr = new KexiDB::ConstExpr(TIME_CONST, QTime::fromString(res, Qt::ISODate));
+ valueExpr = new KexiDB::ConstExpr(TIME_CONST, TQTime::fromString(res, Qt::ISODate));
}
- else if ((re = QRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})\\s+(\\d{1,2}):(\\d{1,2})")).exactMatch( str )
- || (re = QRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})\\s+(\\d{1,2}):(\\d{1,2}):(\\d{1,2})")).exactMatch( str ))
+ else if ((re = TQRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})\\s+(\\d{1,2}):(\\d{1,2})")).exactMatch( str )
+ || (re = TQRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})\\s+(\\d{1,2}):(\\d{1,2}):(\\d{1,2})")).exactMatch( str ))
{
- QString res = re.cap(1).rightJustify(4, '0')+"-"+re.cap(2).rightJustify(2, '0')
+ TQString res = re.cap(1).rightJustify(4, '0')+"-"+re.cap(2).rightJustify(2, '0')
+"-"+re.cap(3).rightJustify(2, '0')
+"T"+re.cap(4).rightJustify(2, '0')+":"+re.cap(5).rightJustify(2, '0')
+":"+re.cap(6).rightJustify(2, '0');
// kexipluginsdbg << res << endl;
valueExpr = new KexiDB::ConstExpr(DATETIME_CONST,
- QDateTime::fromString(res, Qt::ISODate));
+ TQDateTime::fromString(res, Qt::ISODate));
}
else if (str[0]>='0' && str[0]<='9' || str[0]=='-' || str[0]=='+') {
//number
- QString decimalSym = KGlobal::locale()->decimalSymbol();
+ TQString decimalSym = KGlobal::locale()->decimalSymbol();
bool ok;
- int pos = str.find('.');
+ int pos = str.tqfind('.');
if (pos==-1) {//second chance: local decimal symbol
- pos = str.find(decimalSym);
+ pos = str.tqfind(decimalSym);
}
if (pos>=0) {//real const number
const int left = str.left(pos).toInt(&ok);
@@ -1385,18 +1385,18 @@ KexiQueryDesignerGuiEditor::parseExpressionString(const QString& fullString, int
const int right = str.mid(pos+1).toInt(&ok);
if (!ok)
return 0;
- valueExpr = new KexiDB::ConstExpr(REAL_CONST, QPoint(left,right)); //decoded to QPoint
+ valueExpr = new KexiDB::ConstExpr(REAL_CONST, TQPoint(left,right)); //decoded to TQPoint
}
else {
//integer const
- const Q_LLONG val = str.toLongLong(&ok);
+ const TQ_LLONG val = str.toLongLong(&ok);
if (!ok)
return 0;
valueExpr = new KexiDB::ConstExpr(INTEGER_CONST, val);
}
}
else if (str.lower()=="null") {
- valueExpr = new KexiDB::ConstExpr(SQL_NULL, QVariant());
+ valueExpr = new KexiDB::ConstExpr(SQL_NULL, TQVariant());
}
else {//identfier
if (!KexiUtils::isIdentifier(str))
@@ -1415,33 +1415,33 @@ KexiQueryDesignerGuiEditor::parseExpressionString(const QString& fullString, int
}
void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int colnum,
- QVariant& newValue, KexiDB::ResultInfo* result)
+ TQVariant& newValue, KexiDB::ResultInfo* result)
{
if (colnum == COLUMN_ID_COLUMN) {
if (newValue.isNull()) {
- d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, QVariant(), false/*!allowSignals*/);
- d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, QVariant(false,1));//invisible
- d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, QVariant());
-#ifndef KEXI_NO_QUERY_TOTALS
- d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, QVariant());//remove totals
+ d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(), false/*!allowSignals*/);
+ d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
+ d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, TQVariant());
+#ifndef KEXI_NO_TQUERY_TOTALS
+ d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
#endif
- d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, QVariant());//remove crit.
+ d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit.
d->sets->removeCurrentPropertySet();
}
else {
//auto fill 'table' column
- QString fieldId( newValue.toString().stripWhiteSpace() ); //tmp, can look like "table.field"
- QString fieldName; //"field" part of "table.field" or expression string
- QString tableName; //empty for expressions
- QCString alias;
- QString columnValueForExpr; //for setting pretty printed "alias: expr" in 1st column
+ TQString fieldId( newValue.toString().stripWhiteSpace() ); //tmp, can look like "table.field"
+ TQString fieldName; //"field" part of "table.field" or expression string
+ TQString tableName; //empty for expressions
+ TQCString alias;
+ TQString columnValueForExpr; //for setting pretty printed "alias: expr" in 1st column
const bool isExpression = !d->fieldColumnIdentifiers[fieldId];
if (isExpression) {
//this value is entered by hand and doesn't match
//any value in the combo box -- we're assuming this is an expression
//-table remains null
- //-find "alias" in something like "alias : expr"
- const int id = fieldId.find(':');
+ //-tqfind "alias" in something like "alias : expr"
+ const int id = fieldId.tqfind(':');
if (id>0) {
alias = fieldId.left(id).stripWhiteSpace().latin1();
if (!KexiUtils::isIdentifier(alias)) {
@@ -1449,7 +1449,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
result->allowToDiscardChanges = true;
result->column = colnum;
result->msg = i18n("Entered column alias \"%1\" is not a valid identifier.")
- .arg(alias);
+ .tqarg(alias.data());
result->desc = i18n("Identifiers should start with a letter or '_' character");
return;
}
@@ -1468,7 +1468,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
result->success = false;
result->allowToDiscardChanges = true;
result->column = colnum;
- result->msg = i18n("Invalid expression \"%1\"").arg(fieldName);
+ result->msg = i18n("Invalid expression \"%1\"").tqarg(fieldName);
return;
}
}
@@ -1490,7 +1490,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
KoProperty::Set *set = d->sets->findPropertySetForItem(*item); //*propertyBuffer();
if (!set) {
saveOldValue = false; // no old val.
- const int row = d->data->findRef(item);
+ const int row = d->data->tqfindRef(item);
if (row<0) {
result->success = false;
return;
@@ -1498,15 +1498,15 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
set = createPropertySet( row, tableName, fieldName, true );
propertySetSwitched();
}
- d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, QVariant(tableName), false/*!allowSignals*/);
- d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, QVariant(true,1));
-#ifndef KEXI_NO_QUERY_TOTALS
- d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, QVariant(0));
+ d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(tableName), false/*!allowSignals*/);
+ d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(true,1));
+#ifndef KEXI_NO_TQUERY_TOTALS
+ d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));
#endif
if (!sortingAllowed(fieldName, tableName)) {
// sorting is not available for "*" or "table.*" rows
//! @todo what about expressions?
- d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, QVariant());
+ d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, TQVariant());
}
//update properties
(*set)["field"].setValue(fieldName, saveOldValue);
@@ -1517,13 +1517,13 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
if (alias.isEmpty()) //-generate smallest unique alias
alias = generateUniqueAlias();
}
- (*set)["isExpression"].setValue(QVariant(isExpression,1), saveOldValue);
+ (*set)["isExpression"].setValue(TQVariant(isExpression,1), saveOldValue);
if (!alias.isEmpty()) {
(*set)["alias"].setValue(alias, saveOldValue);
//pretty printed "alias: expr"
- newValue = QString(alias) + ": " + fieldName;
+ newValue = TQString(alias) + ": " + fieldName;
}
- (*set)["caption"].setValue(QString::null, saveOldValue);
+ (*set)["caption"].setValue(TQString(), saveOldValue);
(*set)["table"].setValue(tableName, saveOldValue);
updatePropertiesVisibility(*set);
}
@@ -1531,12 +1531,12 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
else if (colnum==COLUMN_ID_TABLE) {
if (newValue.isNull()) {
if (!item->at(COLUMN_ID_COLUMN).toString().isEmpty())
- d->data->updateRowEditBuffer(item, COLUMN_ID_COLUMN, QVariant(), false/*!allowSignals*/);
- d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, QVariant(false,1));//invisible
-#ifndef KEXI_NO_QUERY_TOTALS
- d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, QVariant());//remove totals
+ d->data->updateRowEditBuffer(item, COLUMN_ID_COLUMN, TQVariant(), false/*!allowSignals*/);
+ d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
+#ifndef KEXI_NO_TQUERY_TOTALS
+ d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
#endif
- d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, QVariant());//remove crit.
+ d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit.
d->sets->removeCurrentPropertySet();
}
//update property
@@ -1544,11 +1544,11 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
if (set) {
if ((*set)["isExpression"].value().toBool()==false) {
(*set)["table"] = newValue;
- (*set)["caption"] = QString::null;
+ (*set)["caption"] = TQString();
}
else {
//do not set table for expr. columns
- newValue = QVariant();
+ newValue = TQVariant();
}
// KoProperty::Set &set = *propertyBuffer();
updatePropertiesVisibility(*set);
@@ -1560,15 +1560,15 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
saveOldValue = false;
createPropertySet( d->dataTable->dataAwareObject()->currentRow(),
item->at(COLUMN_ID_TABLE).toString(), item->at(COLUMN_ID_COLUMN).toString(), true );
-#ifndef KEXI_NO_QUERY_TOTALS
- d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, QVariant(0));//totals
+#ifndef KEXI_NO_TQUERY_TOTALS
+ d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));//totals
#endif
propertySetSwitched();
}
KoProperty::Set &set = *propertySet();
set["visible"].setValue(newValue, saveOldValue);
}
-#ifndef KEXI_NO_QUERY_TOTALS
+#ifndef KEXI_NO_TQUERY_TOTALS
else if (colnum==COLUMN_ID_TOTALS) {
//TODO:
//unused yet
@@ -1577,11 +1577,11 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
#endif
else if (colnum==COLUMN_ID_SORTING) {
KoProperty::Set *set = d->sets->findPropertySetForItem(*item);
- QString table( set->property("table").value().toString() );
- QString field( set->property("field").value().toString() );
+ TQString table( set->property("table").value().toString() );
+ TQString field( set->property("field").value().toString() );
if (newValue.toInt()==0 || sortingAllowed(field, table)) {
KoProperty::Property &property = set->property("sorting");
- QString key( property.listData()->keysAsStringList()[ newValue.toInt() ] );
+ TQString key( property.listData()->keysAsStringList()[ newValue.toInt() ] );
kexipluginsdbg << "new key=" << key << endl;
property.setValue(key, true);
}
@@ -1590,29 +1590,29 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
result->allowToDiscardChanges = true;
result->column = colnum;
result->msg = i18n("Could not set sorting for multiple columns (%1)")
- .arg(table=="*" ? table : (table+".*"));
+ .tqarg(table=="*" ? table : (table+".*"));
}
}
else if (colnum==COLUMN_ID_CRITERIA) {
//! @todo this is primitive, temporary: reuse SQL parser
- QString operatorStr, argStr;
+ TQString operatorStr, argStr;
KexiDB::BaseExpr* e = 0;
- const QString str = newValue.toString().stripWhiteSpace();
+ const TQString str = newValue.toString().stripWhiteSpace();
int token;
- QString field, table;
+ TQString field, table;
KoProperty::Set *set = d->sets->findPropertySetForItem(*item);
if (set) {
field = (*set)["field"].value().toString();
table = (*set)["table"].value().toString();
}
- if (!str.isEmpty() && (!set || table=="*" || field.find("*")!=-1)) {
+ if (!str.isEmpty() && (!set || table=="*" || field.tqfind("*")!=-1)) {
//asterisk found! criteria not allowed
result->success = false;
result->allowToDiscardChanges = true;
result->column = colnum;
if (propertySet())
result->msg = i18n("Could not set criteria for \"%1\"")
- .arg(table=="*" ? table : field);
+ .tqarg(table=="*" ? table : field);
else
result->msg = i18n("Could not set criteria for empty row");
//moved to result->allowToDiscardChanges handler //d->dataTable->dataAwareObject()->cancelEditor(); //prevents further editing of this cell
@@ -1620,7 +1620,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
else if (str.isEmpty() || (e = parseExpressionString(str, token, true/*allowRelationalOperator*/)))
{
if (e) {
- QString tokenStr;
+ TQString tokenStr;
if (token!='=') {
KexiDB::BinaryExpr be(KexiDBExpr_Relational, 0, token, 0);
tokenStr = be.tokenToString() + " ";
@@ -1630,7 +1630,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
delete e;
}
else if (str.isEmpty()) {
- (*set)["criteria"] = QVariant(); //clear it
+ (*set)["criteria"] = TQVariant(); //clear it
}
setDirty(true);
}
@@ -1638,7 +1638,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
result->success = false;
result->allowToDiscardChanges = true;
result->column = colnum;
- result->msg = i18n("Invalid criteria \"%1\"").arg(newValue.toString());
+ result->msg = i18n("Invalid criteria \"%1\"").tqarg(newValue.toString());
}
}
}
@@ -1654,7 +1654,7 @@ void KexiQueryDesignerGuiEditor::slotAboutConnectionRemove(KexiRelationViewConne
}
void KexiQueryDesignerGuiEditor::slotTableFieldDoubleClicked(
- KexiDB::TableSchema* table, const QString& fieldName )
+ KexiDB::TableSchema* table, const TQString& fieldName )
{
if (!table || (!table->field(fieldName) && fieldName!="*"))
return;
@@ -1695,10 +1695,10 @@ void KexiQueryDesignerGuiEditor::updatePropertiesVisibility(KoProperty::Set& set
KoProperty::Set*
KexiQueryDesignerGuiEditor::createPropertySet( int row,
- const QString& tableName, const QString& fieldName, bool newOne )
+ const TQString& tableName, const TQString& fieldName, bool newOne )
{
//const bool asterisk = isAsterisk(tableName, fieldName);
- QString typeName = "KexiQueryDesignerGuiEditor::Column";
+ TQString typeName = "KexiQueryDesignerGuiEditor::Column";
KoProperty::Set *set = new KoProperty::Set(d->sets, typeName);
KoProperty::Property *prop;
@@ -1708,42 +1708,42 @@ KexiQueryDesignerGuiEditor::createPropertySet( int row,
//! \todo add table_field icon (add buff->addProperty(prop = new KexiProperty("this:iconName", "table_field") );
// prop->setVisible(false);
- set->addProperty(prop = new KoProperty::Property("table", QVariant(tableName)) );
+ set->addProperty(prop = new KoProperty::Property("table", TQVariant(tableName)) );
prop->setVisible(false);//always hidden
- set->addProperty(prop = new KoProperty::Property("field", QVariant(fieldName)) );
+ set->addProperty(prop = new KoProperty::Property("field", TQVariant(fieldName)) );
prop->setVisible(false);//always hidden
- set->addProperty(prop = new KoProperty::Property("caption", QVariant(QString::null), i18n("Caption") ) );
+ set->addProperty(prop = new KoProperty::Property("caption", TQVariant(TQString()), i18n("Caption") ) );
#ifdef KEXI_NO_UNFINISHED
prop->setVisible(false);
#endif
- set->addProperty(prop = new KoProperty::Property("alias", QVariant(QString::null), i18n("Alias")) );
+ set->addProperty(prop = new KoProperty::Property("alias", TQVariant(TQString()), i18n("Alias")) );
- set->addProperty(prop = new KoProperty::Property("visible", QVariant(true, 4)) );
+ set->addProperty(prop = new KoProperty::Property("visible", TQVariant(true, 4)) );
prop->setVisible(false);
/*TODO:
- set->addProperty(prop = new KexiProperty("totals", QVariant(QString::null)) );
+ set->addProperty(prop = new KexiProperty("totals", TQVariant(TQString())) );
prop->setVisible(false);*/
//sorting
- QStringList slist, nlist;
+ TQStringList slist, nlist;
slist << "nosorting" << "ascending" << "descending";
nlist << i18n("None") << i18n("Ascending") << i18n("Descending");
set->addProperty(prop = new KoProperty::Property("sorting",
slist, nlist, *slist.at(0), i18n("Sorting")));
prop->setVisible(false);
- set->addProperty(prop = new KoProperty::Property("criteria", QVariant(QString::null)) );
+ set->addProperty(prop = new KoProperty::Property("criteria", TQVariant(TQString())) );
prop->setVisible(false);
- set->addProperty(prop = new KoProperty::Property("isExpression", QVariant(false, 1)) );
+ set->addProperty(prop = new KoProperty::Property("isExpression", TQVariant(false, 1)) );
prop->setVisible(false);
- connect(set, SIGNAL(propertyChanged(KoProperty::Set&, KoProperty::Property&)),
- this, SLOT(slotPropertyChanged(KoProperty::Set&, KoProperty::Property&)));
+ connect(set, TQT_SIGNAL(propertyChanged(KoProperty::Set&, KoProperty::Property&)),
+ this, TQT_SLOT(slotPropertyChanged(KoProperty::Set&, KoProperty::Property&)));
d->sets->insert(row, set, newOne);
@@ -1758,12 +1758,12 @@ void KexiQueryDesignerGuiEditor::setFocus()
void KexiQueryDesignerGuiEditor::slotPropertyChanged(KoProperty::Set& set, KoProperty::Property& property)
{
- const QCString& pname = property.name();
+ const TQCString& pname = property.name();
/*
- * TODO (js) use KexiProperty::setValidator(QString) when implemented as described in TODO #60
+ * TODO (js) use KexiProperty::setValidator(TQString) when implemented as described in TODO #60
*/
if (pname=="alias" || pname=="name") {
- const QVariant& v = property.value();
+ const TQVariant& v = property.value();
if (!v.toString().stripWhiteSpace().isEmpty() && !KexiUtils::isIdentifier( v.toString() )) {
KMessageBox::sorry(this,
KexiUtils::identifierExpectedMessage(property.caption(), v.toString()));
@@ -1776,7 +1776,7 @@ void KexiQueryDesignerGuiEditor::slotPropertyChanged(KoProperty::Set& set, KoPro
// d->dataTable->dataAwareObject()->setCursorPosition(d->dataTable->dataAwareObject()->currentRow(),0);
//d->dataTable->dataAwareObject()->startEditCurrentCell();
d->data->updateRowEditBuffer(d->dataTable->dataAwareObject()->selectedItem(),
- 0, QVariant(set["alias"].value().toString() + ": " + set["field"].value().toString()));
+ 0, TQVariant(set["alias"].value().toString() + ": " + set["field"].value().toString()));
d->data->saveRowChanges(*d->dataTable->dataAwareObject()->selectedItem(), true);
// d->dataTable->dataAwareObject()->acceptRowEdit();
}
@@ -1794,7 +1794,7 @@ void KexiQueryDesignerGuiEditor::slotItemRemoved(const KexiPart::Item& item)
d->relations->objectDeleted(item.mimeType(), item.name().latin1());
}
-void KexiQueryDesignerGuiEditor::slotItemRenamed(const KexiPart::Item& item, const QCString& oldName)
+void KexiQueryDesignerGuiEditor::slotItemRenamed(const KexiPart::Item& item, const TQCString& oldName)
{
d->relations->objectRenamed(item.mimeType(), oldName, item.name().latin1());
}
diff --git a/kexi/plugins/queries/kexiquerydesignerguieditor.h b/kexi/plugins/queries/kexiquerydesignerguieditor.h
index 03acb7f6..587e60a6 100644
--- a/kexi/plugins/queries/kexiquerydesignerguieditor.h
+++ b/kexi/plugins/queries/kexiquerydesignerguieditor.h
@@ -18,11 +18,11 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef KEXIQUERYDESIGNERGUIEDITOR_H
-#define KEXIQUERYDESIGNERGUIEDITOR_H
+#ifndef KEXITQUERYDESIGNERGUIEDITOR_H
+#define KEXITQUERYDESIGNERGUIEDITOR_H
-#include <qguardedptr.h>
-#include <qsplitter.h>
+#include <tqguardedptr.h>
+#include <tqsplitter.h>
#include <kexiviewbase.h>
#include "kexiquerypart.h"
@@ -59,16 +59,17 @@ namespace KexiDB
class KexiQueryDesignerGuiEditor : public KexiViewBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiQueryDesignerGuiEditor(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0);
+ KexiQueryDesignerGuiEditor(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name = 0);
virtual ~KexiQueryDesignerGuiEditor();
// KexiDB::QuerySchema *schema();
KexiRelationWidget *relationView() const;
- virtual QSize sizeHint() const;
+ virtual TQSize tqsizeHint() const;
public slots:
virtual void setFocus();
@@ -76,7 +77,7 @@ class KexiQueryDesignerGuiEditor : public KexiViewBase
protected:
void initTableColumns(); //!< Called just once.
void initTableRows(); //!< Called to have all rows empty.
-//unused void addRow(const QString &tbl, const QString &field);
+//unused void addRow(const TQString &tbl, const TQString &field);
// void restore();
virtual tristate beforeSwitchTo(int mode, bool &dontStore);
virtual tristate afterSwitchFrom(int mode);
@@ -93,32 +94,32 @@ class KexiQueryDesignerGuiEditor : public KexiViewBase
virtual KoProperty::Set *propertySet();
KoProperty::Set* createPropertySet( int row,
- const QString& tableName, const QString& fieldName, bool newOne = false );
+ const TQString& tableName, const TQString& fieldName, bool newOne = false );
/*! Builds query schema out of information provided by gui.
The schema is stored in temp->query member.
\a errMsg is optional error message returned.
\return true on proper schema creation. */
- bool buildSchema(QString *errMsg = 0);
+ bool buildSchema(TQString *errMsg = 0);
KexiQueryPart::TempData * tempData() const;
/*! Helper: allocates and initializes new table view's row. Doesn't insert it, just returns.
\a tableName and \a fieldName shoudl be provided.
\a visible flag sets value for "Visible" column. */
- KexiTableItem* createNewRow(const QString& tableName, const QString& fieldName,
+ KexiTableItem* createNewRow(const TQString& tableName, const TQString& fieldName,
bool visible) const;
- KexiDB::BaseExpr* parseExpressionString(const QString& fullString, int& token,
+ KexiDB::BaseExpr* parseExpressionString(const TQString& fullString, int& token,
bool allowRelationalOperator);
- QCString generateUniqueAlias() const;
+ TQCString generateUniqueAlias() const;
void updatePropertiesVisibility(KoProperty::Set& buf);
protected slots:
- void slotDragOverTableRow(KexiTableItem *item, int row, QDragMoveEvent* e);
+ void slotDragOverTableRow(KexiTableItem *item, int row, TQDragMoveEvent* e);
void slotDroppedAtRow(KexiTableItem *item, int row,
- QDropEvent *ev, KexiTableItem*& newItem);
+ TQDropEvent *ev, KexiTableItem*& newItem);
//! Reaction on appending a new item after deleting one
void slotNewItemAppendedForAfterDeletingInSpreadSheetMode();
void slotTableAdded(KexiDB::TableSchema &t);
@@ -126,17 +127,17 @@ class KexiQueryDesignerGuiEditor : public KexiViewBase
//! Called before cell change in tableview.
void slotBeforeCellChanged(KexiTableItem *item, int colnum,
- QVariant& newValue, KexiDB::ResultInfo* result);
+ TQVariant& newValue, KexiDB::ResultInfo* result);
- void slotRowInserted(KexiTableItem* item, uint row, bool repaint);
+ void slotRowInserted(KexiTableItem* item, uint row, bool tqrepaint);
void slotTablePositionChanged(KexiRelationViewTableContainer*);
void slotAboutConnectionRemove(KexiRelationViewConnection*);
- void slotTableFieldDoubleClicked( KexiDB::TableSchema* table, const QString& fieldName );
+ void slotTableFieldDoubleClicked( KexiDB::TableSchema* table, const TQString& fieldName );
- /*! Loads layout of relation GUI diagram. */
+ /*! Loads tqlayout of relation GUI diagram. */
bool loadLayout();
- /*! Stores layout of relation GUI diagram. */
+ /*! Stores tqlayout of relation GUI diagram. */
bool storeLayout();
void showTablesForQuery(KexiDB::QuerySchema *query);
@@ -154,10 +155,10 @@ class KexiQueryDesignerGuiEditor : public KexiViewBase
void slotPropertyChanged(KoProperty::Set& list, KoProperty::Property& property);
-// void slotObjectCreated(const QCString &mime, const QCString& name);
+// void slotObjectCreated(const TQCString &mime, const TQCString& name);
void slotNewItemStored(KexiPart::Item&);
void slotItemRemoved(const KexiPart::Item& item);
- void slotItemRenamed(const KexiPart::Item& item, const QCString& oldName);
+ void slotItemRenamed(const KexiPart::Item& item, const TQCString& oldName);
private:
class Private;
diff --git a/kexi/plugins/queries/kexiquerydesignersql.cpp b/kexi/plugins/queries/kexiquerydesignersql.cpp
index 469d551c..36455837 100644
--- a/kexi/plugins/queries/kexiquerydesignersql.cpp
+++ b/kexi/plugins/queries/kexiquerydesignersql.cpp
@@ -18,11 +18,11 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qsplitter.h>
-#include <qlayout.h>
-#include <qhbox.h>
-#include <qvbox.h>
-#include <qtimer.h>
+#include <tqsplitter.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqvbox.h>
+#include <tqtimer.h>
#include <kapplication.h>
#include <kdebug.h>
@@ -45,7 +45,7 @@
#include "kexisectionheader.h"
-static bool compareSQL(const QString& sql1, const QString& sql2)
+static bool compareSQL(const TQString& sql1, const TQString& sql2)
{
//TODO: use reformatting functions here
return sql1.stripWhiteSpace()==sql2.stripWhiteSpace();
@@ -73,18 +73,18 @@ class KexiQueryDesignerSQLView::Private
}
KexiQueryDesignerSQLEditor *editor;
KexiQueryDesignerSQLHistory *history;
- QLabel *pixmapStatus, *lblStatus;
- QHBox *status_hbox;
- QVBox *history_section;
+ TQLabel *pixmaptqStatus, *lbltqStatus;
+ TQHBox *status_hbox;
+ TQVBox *history_section;
KexiSectionHeader *head, *historyHead;
- QPixmap statusPixmapOk, statusPixmapErr, statusPixmapInfo;
- QSplitter *splitter;
+ TQPixmap statusPixmapOk, statusPixmapErr, statusPixmapInfo;
+ TQSplitter *splitter;
KToggleAction *action_toggle_history;
//! For internal use, this pointer is usually copied to TempData structure,
//! when switching out of this view (then it's cleared).
KexiDB::QuerySchema *parsedQuery;
//! For internal use, statement passed in switching to this view
- QString origStatement;
+ TQString origStatement;
//! needed to remember height for both modes, between switching
int heightForStatusMode, heightForHistoryMode;
//! helper for slotUpdateMode()
@@ -99,58 +99,58 @@ class KexiQueryDesignerSQLView::Private
//===================
-KexiQueryDesignerSQLView::KexiQueryDesignerSQLView(KexiMainWindow *mainWin, QWidget *parent, const char *name)
- : KexiViewBase(mainWin, parent, name)
+KexiQueryDesignerSQLView::KexiQueryDesignerSQLView(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name)
+ : KexiViewBase(mainWin, tqparent, name)
, d( new Private() )
{
- d->splitter = new QSplitter(this);
- d->splitter->setOrientation(Vertical);
- d->head = new KexiSectionHeader(i18n("SQL Query Text"), Vertical, d->splitter);
+ d->splitter = new TQSplitter(this);
+ d->splitter->setOrientation(Qt::Vertical);
+ d->head = new KexiSectionHeader(i18n("SQL Query Text"),Qt::Vertical, d->splitter);
d->editor = new KexiQueryDesignerSQLEditor(mainWin, d->head, "sqle");
// d->editor->installEventFilter(this);//for keys
- connect(d->editor, SIGNAL(textChanged()), this, SLOT(slotTextChanged()));
+ connect(d->editor, TQT_SIGNAL(textChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotTextChanged()));
addChildView(d->editor);
setViewWidget(d->editor);
d->splitter->setFocusProxy(d->editor);
setFocusProxy(d->editor);
- d->history_section = new QVBox(d->splitter);
+ d->history_section = new TQVBox(d->splitter);
- d->status_hbox = new QHBox(d->history_section);
+ d->status_hbox = new TQHBox(d->history_section);
d->status_hbox->installEventFilter(this);
- d->splitter->setResizeMode(d->history_section, QSplitter::KeepSize);
+ d->splitter->setResizeMode(d->history_section, TQSplitter::KeepSize);
d->status_hbox->setSpacing(0);
- d->pixmapStatus = new QLabel(d->status_hbox);
- d->pixmapStatus->setFixedWidth(d->statusPixmapOk.width()*3/2);
- d->pixmapStatus->setAlignment(AlignHCenter | AlignTop);
- d->pixmapStatus->setMargin(d->statusPixmapOk.width()/4);
- d->pixmapStatus->setPaletteBackgroundColor( palette().active().color(QColorGroup::Base) );
-
- d->lblStatus = new QLabel(d->status_hbox);
- d->lblStatus->setAlignment(AlignLeft | AlignTop | WordBreak);
- d->lblStatus->setMargin(d->statusPixmapOk.width()/4);
- d->lblStatus->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Expanding );
- d->lblStatus->resize(d->lblStatus->width(),d->statusPixmapOk.width()*3);
- d->lblStatus->setPaletteBackgroundColor( palette().active().color(QColorGroup::Base) );
-
- QHBoxLayout *b = new QHBoxLayout(this);
+ d->pixmaptqStatus = new TQLabel(d->status_hbox);
+ d->pixmaptqStatus->setFixedWidth(d->statusPixmapOk.width()*3/2);
+ d->pixmaptqStatus->tqsetAlignment(AlignHCenter | AlignTop);
+ d->pixmaptqStatus->setMargin(d->statusPixmapOk.width()/4);
+ d->pixmaptqStatus->setPaletteBackgroundColor( tqpalette().active().color(TQColorGroup::Base) );
+
+ d->lbltqStatus = new TQLabel(d->status_hbox);
+ d->lbltqStatus->tqsetAlignment(AlignLeft | AlignTop | WordBreak);
+ d->lbltqStatus->setMargin(d->statusPixmapOk.width()/4);
+ d->lbltqStatus->tqsetSizePolicy( TQSizePolicy::Preferred, TQSizePolicy::Expanding );
+ d->lbltqStatus->resize(d->lbltqStatus->width(),d->statusPixmapOk.width()*3);
+ d->lbltqStatus->setPaletteBackgroundColor( tqpalette().active().color(TQColorGroup::Base) );
+
+ TQHBoxLayout *b = new TQHBoxLayout(this);
b->addWidget(d->splitter);
- plugSharedAction("querypart_check_query", this, SLOT(slotCheckQuery()));
- plugSharedAction("querypart_view_toggle_history", this, SLOT(slotUpdateMode()));
+ plugSharedAction("querypart_check_query", TQT_TQOBJECT(this), TQT_SLOT(slotCheckQuery()));
+ plugSharedAction("querypart_view_toggle_history", TQT_TQOBJECT(this), TQT_SLOT(slotUpdateMode()));
d->action_toggle_history = static_cast<KToggleAction*>( sharedAction( "querypart_view_toggle_history" ) );
- d->historyHead = new KexiSectionHeader(i18n("SQL Query History"), Vertical, d->history_section);
+ d->historyHead = new KexiSectionHeader(i18n("SQL Query History"),Qt::Vertical, d->history_section);
d->historyHead->installEventFilter(this);
d->history = new KexiQueryDesignerSQLHistory(d->historyHead, "sql_history");
- static const QString msg_back = i18n("Back to Selected Query");
- static const QString msg_clear = i18n("Clear History");
- d->historyHead->addButton("select_item", msg_back, this, SLOT(slotSelectQuery()));
- d->historyHead->addButton("editclear", msg_clear, d->history, SLOT(clear()));
- d->history->popupMenu()->insertItem(SmallIcon("select_item"), msg_back, this, SLOT(slotSelectQuery()));
- d->history->popupMenu()->insertItem(SmallIcon("editclear"), msg_clear, d->history, SLOT(clear()));
- connect(d->history, SIGNAL(currentItemDoubleClicked()), this, SLOT(slotSelectQuery()));
+ static const TQString msg_back = i18n("Back to Selected Query");
+ static const TQString msg_clear = i18n("Clear History");
+ d->historyHead->addButton("select_item", msg_back, TQT_TQOBJECT(this), TQT_SLOT(slotSelectQuery()));
+ d->historyHead->addButton("editclear", msg_clear, TQT_TQOBJECT(d->history), TQT_SLOT(clear()));
+ d->history->popupMenu()->insertItem(SmallIcon("select_item"), msg_back, TQT_TQOBJECT(this), TQT_SLOT(slotSelectQuery()));
+ d->history->popupMenu()->insertItem(SmallIcon("editclear"), msg_clear, d->history, TQT_SLOT(clear()));
+ connect(d->history, TQT_SIGNAL(currentItemDoubleClicked()), TQT_TQOBJECT(this), TQT_SLOT(slotSelectQuery()));
d->heightForHistoryMode = -1; //height() / 2;
//d->historyHead->hide();
@@ -171,36 +171,36 @@ KexiQueryDesignerSQLEditor *KexiQueryDesignerSQLView::editor() const
void KexiQueryDesignerSQLView::setStatusOk()
{
- d->pixmapStatus->setPixmap(d->statusPixmapOk);
+ d->pixmaptqStatus->setPixmap(d->statusPixmapOk);
setStatusText("<h2>"+i18n("The query is correct")+"</h2>");
- d->history->addEvent(d->editor->text().stripWhiteSpace(), true, QString::null);
+ d->history->addEvent(d->editor->text().stripWhiteSpace(), true, TQString());
}
-void KexiQueryDesignerSQLView::setStatusError(const QString& msg)
+void KexiQueryDesignerSQLView::setStatusError(const TQString& msg)
{
- d->pixmapStatus->setPixmap(d->statusPixmapErr);
+ d->pixmaptqStatus->setPixmap(d->statusPixmapErr);
setStatusText("<h2>"+i18n("The query is incorrect")+"</h2><p>"+msg+"</p>");
d->history->addEvent(d->editor->text().stripWhiteSpace(), false, msg);
}
void KexiQueryDesignerSQLView::setStatusEmpty()
{
- d->pixmapStatus->setPixmap(d->statusPixmapInfo);
+ d->pixmaptqStatus->setPixmap(d->statusPixmapInfo);
setStatusText(i18n("Please enter your query and execute \"Check query\" function to verify it."));
}
-void KexiQueryDesignerSQLView::setStatusText(const QString& text)
+void KexiQueryDesignerSQLView::setStatusText(const TQString& text)
{
if (!d->action_toggle_history->isChecked()) {
- QSimpleRichText rt(text, d->lblStatus->font());
- rt.setWidth(d->lblStatus->width());
- QValueList<int> sz = d->splitter->sizes();
- const int newHeight = rt.height()+d->lblStatus->margin()*2;
+ TQSimpleRichText rt(text, d->lbltqStatus->font());
+ rt.setWidth(d->lbltqStatus->width());
+ TQValueList<int> sz = d->splitter->sizes();
+ const int newHeight = rt.height()+d->lbltqStatus->margin()*2;
if (sz[1]<newHeight) {
sz[1] = newHeight;
d->splitter->setSizes(sz);
}
- d->lblStatus->setText(text);
+ d->lbltqStatus->setText(text);
}
}
@@ -210,7 +210,7 @@ KexiQueryDesignerSQLView::beforeSwitchTo(int mode, bool &dontStore)
//TODO
dontStore = true;
if (mode==Kexi::DesignViewMode || mode==Kexi::DataViewMode) {
- QString sqlText = d->editor->text().stripWhiteSpace();
+ TQString sqlText = d->editor->text().stripWhiteSpace();
KexiQueryPart::TempData * temp = tempData();
if (sqlText.isEmpty()) {
//special case: empty SQL text
@@ -222,7 +222,7 @@ KexiQueryDesignerSQLView::beforeSwitchTo(int mode, bool &dontStore)
}
}
else {
- const bool designViewWasVisible = parentDialog()->viewForMode(mode)!=0;
+ const bool designViewWasVisible = tqparentDialog()->viewForMode(mode)!=0;
//should we check SQL text?
if (designViewWasVisible
&& !d->justSwitchedFromNoViewMode //unchanged, but we should check SQL text
@@ -274,7 +274,7 @@ KexiQueryDesignerSQLView::beforeSwitchTo(int mode, bool &dontStore)
}
setDirty(true);*/
-// if (parentDialog()->hasFocus())
+// if (tqparentDialog()->hasFocus())
d->editor->setFocus();
return true;
}
@@ -287,13 +287,13 @@ KexiQueryDesignerSQLView::afterSwitchFrom(int mode)
if (mode==Kexi::NoViewMode) {
//User opened text view _directly_.
//This flag is set to indicate for beforeSwitchTo() that even if text has not been changed,
- //SQL text should be invalidated.
+ //SQL text should be tqinvalidated.
d->justSwitchedFromNoViewMode = true;
}
KexiQueryPart::TempData * temp = tempData();
KexiDB::QuerySchema *query = temp->query();
if (!query) {//try to just get saved schema, instead of temporary one
- query = dynamic_cast<KexiDB::QuerySchema *>(parentDialog()->schemaData());
+ query = dynamic_cast<KexiDB::QuerySchema *>(tqparentDialog()->schemaData());
}
if (mode!=0/*failure only if it is switching from prev. view*/ && !query) {
@@ -320,11 +320,11 @@ KexiQueryDesignerSQLView::afterSwitchFrom(int mode)
d->slotTextChangedEnabled = false;
d->editor->setText( d->origStatement );
d->slotTextChangedEnabled = true;
- QTimer::singleShot(100, d->editor, SLOT(setFocus()));
+ TQTimer::singleShot(100, d->editor, TQT_SLOT(setFocus()));
return true;
}
-QString
+TQString
KexiQueryDesignerSQLView::sqlText() const
{
return d->editor->text();
@@ -332,7 +332,7 @@ KexiQueryDesignerSQLView::sqlText() const
bool KexiQueryDesignerSQLView::slotCheckQuery()
{
- QString sqlText( d->editor->text().stripWhiteSpace() );
+ TQString sqlText( d->editor->text().stripWhiteSpace() );
if (sqlText.isEmpty()) {
delete d->parsedQuery;
d->parsedQuery = 0;
@@ -366,7 +366,7 @@ void KexiQueryDesignerSQLView::slotUpdateMode()
d->eventFilterForSplitterEnabled = false;
- QValueList<int> sz = d->splitter->sizes();
+ TQValueList<int> sz = d->splitter->sizes();
d->action_toggle_history_was_checked = d->action_toggle_history->isChecked();
int heightToSet = -1;
if (d->action_toggle_history->isChecked()) {
@@ -407,13 +407,13 @@ void KexiQueryDesignerSQLView::slotTextChanged()
setStatusEmpty();
}
-bool KexiQueryDesignerSQLView::eventFilter( QObject *o, QEvent *e )
+bool KexiQueryDesignerSQLView::eventFilter( TQObject *o, TQEvent *e )
{
if (d->eventFilterForSplitterEnabled) {
- if (e->type()==QEvent::Resize && o && o==d->historyHead && d->historyHead->isVisible()) {
+ if (e->type()==TQEvent::Resize && o && TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(d->historyHead) && d->historyHead->isVisible()) {
d->heightForHistoryMode = d->historyHead->height();
}
- else if (e->type()==QEvent::Resize && o && o==d->status_hbox && d->status_hbox->isVisible()) {
+ else if (e->type()==TQEvent::Resize && o && TQT_BASE_OBJECT(o)==TQT_BASE_OBJECT(d->status_hbox) && d->status_hbox->isVisible()) {
d->heightForStatusMode = d->status_hbox->height();
}
}
@@ -432,7 +432,7 @@ void KexiQueryDesignerSQLView::updateActions(bool activated)
void KexiQueryDesignerSQLView::slotSelectQuery()
{
- QString sql = d->history->selectedStatement();
+ TQString sql = d->history->selectedStatement();
if (!sql.isEmpty()) {
d->editor->setText( sql );
}
@@ -441,7 +441,7 @@ void KexiQueryDesignerSQLView::slotSelectQuery()
KexiQueryPart::TempData *
KexiQueryDesignerSQLView::tempData() const
{
- return dynamic_cast<KexiQueryPart::TempData*>(parentDialog()->tempData());
+ return dynamic_cast<KexiQueryPart::TempData*>(tqparentDialog()->tempData());
}
KexiDB::SchemaData*
@@ -449,7 +449,7 @@ KexiQueryDesignerSQLView::storeNewData(const KexiDB::SchemaData& sdata, bool &ca
{
Q_UNUSED( cancel );
- //here: we won't store query layout: it will be recreated 'by hand' in GUI Query Editor
+ //here: we won't store query tqlayout: it will be recreated 'by hand' in GUI Query Editor
bool queryOK = slotCheckQuery();
bool ok = true;
KexiDB::SchemaData* query = 0;
@@ -519,7 +519,7 @@ tristate KexiQueryDesignerSQLView::storeData(bool dontAsk)
#endif
}
if (res == true) {
- QString empty_xml;
+ TQString empty_xml;
res = storeDataBlock( empty_xml, "query_layout" ); //clear
}
if (!res)
@@ -528,7 +528,7 @@ tristate KexiQueryDesignerSQLView::storeData(bool dontAsk)
}
-/*void KexiQueryDesignerSQLView::slotHistoryHeaderButtonClicked(const QString& buttonIdentifier)
+/*void KexiQueryDesignerSQLView::slotHistoryHeaderButtonClicked(const TQString& buttonIdentifier)
{
if (buttonIdentifier=="select_query") {
slotSelectQuery();
diff --git a/kexi/plugins/queries/kexiquerydesignersql.h b/kexi/plugins/queries/kexiquerydesignersql.h
index f31c838f..ae07d457 100644
--- a/kexi/plugins/queries/kexiquerydesignersql.h
+++ b/kexi/plugins/queries/kexiquerydesignersql.h
@@ -18,8 +18,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef KEXIQUERYDESIGNERSQL_H
-#define KEXIQUERYDESIGNERSQL_H
+#ifndef KEXITQUERYDESIGNERSQL_H
+#define KEXITQUERYDESIGNERSQL_H
#include <kexiviewbase.h>
#include "kexiquerypart.h"
@@ -35,15 +35,16 @@ class KexiQueryDesignerSQLViewPrivate;
class KexiQueryDesignerSQLView : public KexiViewBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiQueryDesignerSQLView(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0);
+ KexiQueryDesignerSQLView(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name = 0);
virtual ~KexiQueryDesignerSQLView();
- QString sqlText() const;
+ TQString sqlText() const;
KexiQueryDesignerSQLEditor *editor() const;
- virtual bool eventFilter ( QObject *o, QEvent *e );
+ virtual bool eventFilter ( TQObject *o, TQEvent *e );
protected:
KexiQueryPart::TempData * tempData() const;
@@ -54,9 +55,9 @@ class KexiQueryDesignerSQLView : public KexiViewBase
virtual tristate storeData(bool dontAsk = false);
void setStatusOk();
- void setStatusError(const QString& msg);
+ void setStatusError(const TQString& msg);
void setStatusEmpty();
- void setStatusText(const QString& text);
+ void setStatusText(const TQString& text);
virtual void updateActions(bool activated);
@@ -66,7 +67,7 @@ class KexiQueryDesignerSQLView : public KexiViewBase
bool slotCheckQuery();
void slotUpdateMode();
void slotTextChanged();
-// void slotHistoryHeaderButtonClicked(const QString& buttonIdentifier);
+// void slotHistoryHeaderButtonClicked(const TQString& buttonIdentifier);
void slotSelectQuery();
signals:
diff --git a/kexi/plugins/queries/kexiquerydesignersqlhistory.cpp b/kexi/plugins/queries/kexiquerydesignersqlhistory.cpp
index d86caf83..19c0e06a 100644
--- a/kexi/plugins/queries/kexiquerydesignersqlhistory.cpp
+++ b/kexi/plugins/queries/kexiquerydesignersqlhistory.cpp
@@ -18,9 +18,9 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qpainter.h>
-#include <qclipboard.h>
-#include <qregexp.h>
+#include <tqpainter.h>
+#include <tqclipboard.h>
+#include <tqregexp.h>
#include <kpopupmenu.h>
#include <klocale.h>
@@ -31,8 +31,8 @@
#include "kexiquerydesignersqlhistory.h"
-KexiQueryDesignerSQLHistory::KexiQueryDesignerSQLHistory(QWidget *parent, const char *name)
- : QScrollView(parent, name)
+KexiQueryDesignerSQLHistory::KexiQueryDesignerSQLHistory(TQWidget *tqparent, const char *name)
+ : TQScrollView(tqparent, name)
{
viewport()->setPaletteBackgroundColor(white);
@@ -41,7 +41,7 @@ KexiQueryDesignerSQLHistory::KexiQueryDesignerSQLHistory(QWidget *parent, const
m_history->setAutoDelete(true);
m_popup = new KPopupMenu(this);
- m_popup->insertItem(SmallIcon("editcopy"), i18n("Copy to Clipboard"), this, SLOT(slotToClipboard()));
+ m_popup->insertItem(SmallIcon("editcopy"), i18n("Copy to Clipboard"), this, TQT_SLOT(slotToClipboard()));
}
KexiQueryDesignerSQLHistory::~KexiQueryDesignerSQLHistory()
@@ -49,65 +49,65 @@ KexiQueryDesignerSQLHistory::~KexiQueryDesignerSQLHistory()
}
void
-KexiQueryDesignerSQLHistory::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
+KexiQueryDesignerSQLHistory::drawContents(TQPainter *p, int cx, int cy, int cw, int ch)
{
- QRect clipping(cx, cy, cw, ch);
+ TQRect clipping(cx, cy, cw, ch);
int y = 0;
for(HistoryEntry *it = m_history->first(); it; it = m_history->next())
{
// it->drawItem(p, visibleWidth());
- if(clipping.intersects(it->geometry(y, visibleWidth(), fontMetrics())))
+ if(clipping.intersects(it->tqgeometry(y, visibleWidth(), fontMetrics())))
{
p->saveWorldMatrix();
p->translate(0, y);
- it->drawItem(p, visibleWidth(), colorGroup());
+ it->drawItem(p, visibleWidth(), tqcolorGroup());
p->restoreWorldMatrix();
}
- y += it->geometry(y, visibleWidth(), fontMetrics()).height() + 5;
+ y += it->tqgeometry(y, visibleWidth(), fontMetrics()).height() + 5;
}
}
void
-KexiQueryDesignerSQLHistory::contentsMousePressEvent(QMouseEvent * e)
+KexiQueryDesignerSQLHistory::contentsMousePressEvent(TQMouseEvent * e)
{
int y = 0;
HistoryEntry *popupHistory = 0;
int pos;
- for(QPtrListIterator<HistoryEntry> it(*m_history); it.current(); ++it)
+ for(TQPtrListIterator<HistoryEntry> it(*m_history); it.current(); ++it)
{
if(it.current()->isSelected())
{
//clear
- it.current()->setSelected(false, colorGroup());
- updateContents(it.current()->geometry(y, visibleWidth(), fontMetrics()));
+ it.current()->setSelected(false, tqcolorGroup());
+ updateContents(it.current()->tqgeometry(y, visibleWidth(), fontMetrics()));
}
- if(it.current()->geometry(y, visibleWidth(), fontMetrics()).contains(e->pos()))
+ if(it.current()->tqgeometry(y, visibleWidth(), fontMetrics()).tqcontains(e->pos()))
{
popupHistory = it.current();
pos = y;
}
- y += it.current()->geometry(y, visibleWidth(), fontMetrics()).height() + 5;
+ y += it.current()->tqgeometry(y, visibleWidth(), fontMetrics()).height() + 5;
}
//now do update
if (popupHistory) {
if (m_selected && m_selected != popupHistory) {
- m_selected->setSelected(false, colorGroup());
- updateContents(m_selected->geometry(pos, visibleWidth(), fontMetrics()));
+ m_selected->setSelected(false, tqcolorGroup());
+ updateContents(m_selected->tqgeometry(pos, visibleWidth(), fontMetrics()));
}
m_selected = popupHistory;
- m_selected->setSelected(true, colorGroup());
- updateContents(m_selected->geometry(pos, visibleWidth(), fontMetrics()));
- if(e->button() == RightButton) {
+ m_selected->setSelected(true, tqcolorGroup());
+ updateContents(m_selected->tqgeometry(pos, visibleWidth(), fontMetrics()));
+ if(e->button() == Qt::RightButton) {
m_popup->exec(e->globalPos());
}
}
}
void
-KexiQueryDesignerSQLHistory::contentsMouseDoubleClickEvent(QMouseEvent * e)
+KexiQueryDesignerSQLHistory::contentsMouseDoubleClickEvent(TQMouseEvent * e)
{
contentsMousePressEvent(e);
if (m_selected)
@@ -115,17 +115,17 @@ KexiQueryDesignerSQLHistory::contentsMouseDoubleClickEvent(QMouseEvent * e)
}
void
-KexiQueryDesignerSQLHistory::addEvent(const QString& q, bool s, const QString &error)
+KexiQueryDesignerSQLHistory::addEvent(const TQString& q, bool s, const TQString &error)
{
HistoryEntry *he=m_history->last();
if (he) {
if (he->statement()==q) {
- he->updateTime(QTime::currentTime());
- repaint();
+ he->updateTime(TQTime::currentTime());
+ tqrepaint();
return;
}
}
- addEntry(new HistoryEntry(s, QTime::currentTime(), q, error));
+ addEntry(new HistoryEntry(s, TQTime::currentTime(), q, error));
}
void
@@ -137,37 +137,37 @@ KexiQueryDesignerSQLHistory::addEntry(HistoryEntry *e)
int y = 0;
for(HistoryEntry *it = m_history->first(); it; it = m_history->next())
{
- y += it->geometry(y, visibleWidth(), fontMetrics()).height() + 5;
+ y += it->tqgeometry(y, visibleWidth(), fontMetrics()).height() + 5;
}
resizeContents(visibleWidth() - 1, y);
if (m_selected) {
- m_selected->setSelected(false, colorGroup());
+ m_selected->setSelected(false, tqcolorGroup());
}
m_selected = e;
- m_selected->setSelected(true, colorGroup());
+ m_selected->setSelected(true, tqcolorGroup());
ensureVisible(0,y+5);
updateContents();
/* ensureVisible(0, 0);
if (m_selected) {
- m_selected->setSelected(false, colorGroup());
+ m_selected->setSelected(false, tqcolorGroup());
}
m_selected = e;
- m_selected->setSelected(true, colorGroup());
+ m_selected->setSelected(true, tqcolorGroup());
// updateContents();
- updateContents(m_selected->geometry(0, visibleWidth(), fontMetrics()));*/
+ updateContents(m_selected->tqgeometry(0, visibleWidth(), fontMetrics()));*/
}
/*void
-KexiQueryDesignerSQLHistory::contextMenu(const QPoint &pos, HistoryEntry *)
+KexiQueryDesignerSQLHistory::contextMenu(const TQPoint &pos, HistoryEntry *)
{
KPopupMenu p(this);
- p.insertItem(SmallIcon("editcopy"), i18n("Copy to Clipboard"), this, SLOT(slotToClipboard()));
+ p.insertItem(SmallIcon("editcopy"), i18n("Copy to Clipboard"), this, TQT_SLOT(slotToClipboard()));
#ifndef KEXI_NO_UNFINISHED
p.insertSeparator();
- p.insertItem(SmallIcon("edit"), i18n("Edit"), this, SLOT(slotEdit()));
+ p.insertItem(SmallIcon("edit"), i18n("Edit"), this, TQT_SLOT(slotEdit()));
p.insertItem(SmallIcon("reload"), i18n("Requery"));
#endif
@@ -180,7 +180,7 @@ KexiQueryDesignerSQLHistory::slotToClipboard()
if(!m_selected)
return;
- QApplication::clipboard()->setText(m_selected->statement(), QClipboard::Clipboard);
+ TQApplication::tqclipboard()->setText(m_selected->statement(), TQClipboard::Clipboard);
}
void
@@ -189,10 +189,10 @@ KexiQueryDesignerSQLHistory::slotEdit()
emit editRequested(m_selected->statement());
}
-QString
+TQString
KexiQueryDesignerSQLHistory::selectedStatement() const
{
- return m_selected ? m_selected->statement() : QString::null;
+ return m_selected ? m_selected->statement() : TQString();
}
void
@@ -216,37 +216,37 @@ KPopupMenu* KexiQueryDesignerSQLHistory::popupMenu() const
//==================================
-HistoryEntry::HistoryEntry(bool succeed, const QTime &execTime, const QString &statement, /*int ,*/ const QString &err)
+HistoryEntry::HistoryEntry(bool succeed, const TQTime &execTime, const TQString &statement, /*int ,*/ const TQString &err)
{
m_succeed = succeed;
m_execTime = execTime;
m_statement = statement;
m_error = err;
m_selected = false;
- highlight(QColorGroup());
+ highlight(TQColorGroup());
}
void
-HistoryEntry::drawItem(QPainter *p, int width, const QColorGroup &cg)
+HistoryEntry::drawItem(TQPainter *p, int width, const TQColorGroup &cg)
{
- p->setPen(QColor(200, 200, 200));
- p->setBrush(QColor(200, 200, 200));
+ p->setPen(TQColor(200, 200, 200));
+ p->setBrush(TQColor(200, 200, 200));
p->drawRect(2, 2, 200, 20);
- p->setPen(QColor(0, 0, 0));
+ p->setPen(TQColor(0, 0, 0));
if(m_succeed)
p->drawPixmap(4, 4, SmallIcon("button_ok"));
else
p->drawPixmap(4, 4, SmallIcon("button_cancel"));
- p->drawText(22, 2, 180, 20, Qt::AlignLeft | Qt::AlignVCenter, m_execTime.toString());
- p->setPen(QColor(200, 200, 200));
- p->setBrush(QColor(255, 255, 255));
+ p->drawText(22, 2, 180, 20, TQt::AlignLeft | TQt::AlignVCenter, m_execTime.toString());
+ p->setPen(TQColor(200, 200, 200));
+ p->setBrush(TQColor(255, 255, 255));
m_formated->setWidth(width - 2);
- QRect content(2, 21, width - 2, m_formated->height());
-// QRect content = p->fontMetrics().boundingRect(2, 21, width - 2, 0, Qt::WordBreak | Qt::AlignLeft | Qt::AlignVCenter, m_statement);
-// QRect content(2, 21, width - 2, p->fontMetrics().height() + 4);
-// content = QRect(2, 21, width - 2, m_for.height());
+ TQRect content(2, 21, width - 2, m_formated->height());
+// TQRect content = p->fontMetrics().boundingRect(2, 21, width - 2, 0, TQt::WordBreak | TQt::AlignLeft | TQt::AlignVCenter, m_statement);
+// TQRect content(2, 21, width - 2, p->fontMetrics().height() + 4);
+// content = TQRect(2, 21, width - 2, m_for.height());
if(m_selected)
p->setBrush(cg.highlight());
@@ -260,36 +260,36 @@ HistoryEntry::drawItem(QPainter *p, int width, const QColorGroup &cg)
content.setX(content.x() + 2);
content.setWidth(content.width() - 2);
-// p->drawText(content, Qt::WordBreak | Qt::AlignLeft | Qt::AlignVCenter, m_statement);
+// p->drawText(content, TQt::WordBreak | TQt::AlignLeft | TQt::AlignVCenter, m_statement);
m_formated->draw(p, content.x(), content.y(), content, cg);
}
void
-HistoryEntry::highlight(const QColorGroup &cg)
+HistoryEntry::highlight(const TQColorGroup &cg)
{
- QString statement;
- QString text;
+ TQString statement;
+ TQString text;
bool quote = false;
bool dblquote = false;
statement = m_statement;
- statement.replace("<", "&lt;");
- statement.replace(">", "&gt;");
- statement.replace("\r\n", "<br>"); //(js) first win32 specific pair
- statement.replace("\n", "<br>"); // now single \n
- statement.replace(" ", "&nbsp;");
- statement.replace("\t", "&nbsp;&nbsp;&nbsp;");
+ statement.tqreplace("<", "&lt;");
+ statement.tqreplace(">", "&gt;");
+ statement.tqreplace("\r\n", "<br>"); //(js) first win32 specific pair
+ statement.tqreplace("\n", "<br>"); // now single \n
+ statement.tqreplace(" ", "&nbsp;");
+ statement.tqreplace("\t", "&nbsp;&nbsp;&nbsp;");
// getting quoting...
if(!m_selected)
{
for(int i=0; i < (int)statement.length(); i++)
{
- QString beginTag;
- QString endTag;
- QChar curr = QChar(statement[i]);
+ TQString beginTag;
+ TQString endTag;
+ TQChar curr = TQChar(statement[i]);
- if(curr == "'" && !dblquote && QChar(statement[i-1]) != "\\")
+ if(TQString(curr) == "'" && !dblquote && TQString(TQChar(statement[i-1])) != "\\")
{
if(!quote)
{
@@ -302,7 +302,7 @@ HistoryEntry::highlight(const QColorGroup &cg)
endTag += "</font>";
}
}
- if(curr == "\"" && !quote && QChar(statement[i-1]) != "\\")
+ if(TQString(curr) == "\"" && !quote && TQString(TQChar(statement[i-1])) != "\\")
{
if(!dblquote)
{
@@ -315,7 +315,7 @@ HistoryEntry::highlight(const QColorGroup &cg)
endTag += "</font>";
}
}
- if(QRegExp("[0-9]").exactMatch(QString(curr)) && !quote && !dblquote)
+ if(TQRegExp("[0-9]").exactMatch(TQString(curr)) && !quote && !dblquote)
{
beginTag += "<font color=\"#0000ff\">";
endTag += "</font>";
@@ -326,43 +326,43 @@ HistoryEntry::highlight(const QColorGroup &cg)
}
else
{
- text = QString("<font color=\"%1\">%2").arg(cg.highlightedText().name()).arg(statement);
+ text = TQString("<font color=\"%1\">%2").tqarg(cg.highlightedText().name()).tqarg(statement);
}
- QRegExp keywords("\\b(SELECT|UPDATE|INSERT|DELETE|DROP|FROM|WHERE|AND|OR|NOT|NULL|JOIN|LEFT|RIGHT|ON|INTO|TABLE)\\b");
+ TQRegExp keywords("\\b(SELECT|UPDATE|INSERT|DELETE|DROP|FROM|WHERE|AND|OR|NOT|NULL|JOIN|LEFT|RIGHT|ON|INTO|TABLE)\\b");
keywords.setCaseSensitive(false);
- text = text.replace(keywords, "<b>\\1</b>");
+ text = text.tqreplace(keywords, "<b>\\1</b>");
if(!m_error.isEmpty())
-// text += ("<br>"+i18n("Error: %1").arg(m_error));
-// text += QString("<br><font face=\"") + KGlobalSettings::generalFont().family() + QString("\" size=\"-1\">") + i18n("Error: %1").arg(m_error) + "</font>";
- text += QString("<br><font face=\"") + KGlobalSettings::generalFont().family() + QString("\">") + i18n("Error: %1").arg(m_error) + "</font>";
+// text += ("<br>"+i18n("Error: %1").tqarg(m_error));
+// text += TQString("<br><font face=\"") + KGlobalSettings::generalFont().family() + TQString("\" size=\"-1\">") + i18n("Error: %1").tqarg(m_error) + "</font>";
+ text += TQString("<br><font face=\"") + KGlobalSettings::generalFont().family() + TQString("\">") + i18n("Error: %1").tqarg(m_error) + "</font>";
kdDebug() << "HistoryEntry::highlight() text:" << text << endl;
-// m_formated = new QSimpleRichText(text, QFont("courier", 8));
- m_formated = new QSimpleRichText(text, KGlobalSettings::fixedFont());
+// m_formated = new TQSimpleRichText(text, TQFont("courier", 8));
+ m_formated = new TQSimpleRichText(text, KGlobalSettings::fixedFont());
}
void
-HistoryEntry::setSelected(bool selected, const QColorGroup &cg)
+HistoryEntry::setSelected(bool selected, const TQColorGroup &cg)
{
m_selected = selected;
highlight(cg);
}
-QRect
-HistoryEntry::geometry(int y, int width, QFontMetrics f)
+TQRect
+HistoryEntry::tqgeometry(int y, int width, TQFontMetrics f)
{
Q_UNUSED( f );
-// int h = 21 + f.boundingRect(2, 21, width - 2, 0, Qt::WordBreak | Qt::AlignLeft | Qt::AlignVCenter, m_statement).height();
-// return QRect(0, y, width, h);
+// int h = 21 + f.boundingRect(2, 21, width - 2, 0, TQt::WordBreak | TQt::AlignLeft | TQt::AlignVCenter, m_statement).height();
+// return TQRect(0, y, width, h);
m_formated->setWidth(width - 2);
- return QRect(0, y, width, m_formated->height() + 21);
+ return TQRect(0, y, width, m_formated->height() + 21);
}
-void HistoryEntry::updateTime(const QTime &execTime) {
+void HistoryEntry::updateTime(const TQTime &execTime) {
m_execTime=execTime;
}
diff --git a/kexi/plugins/queries/kexiquerydesignersqlhistory.h b/kexi/plugins/queries/kexiquerydesignersqlhistory.h
index a8d0c2e0..6709a22f 100644
--- a/kexi/plugins/queries/kexiquerydesignersqlhistory.h
+++ b/kexi/plugins/queries/kexiquerydesignersqlhistory.h
@@ -18,65 +18,66 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef KEXIQUERYDESIGNERSQLHISTORY_H
-#define KEXIQUERYDESIGNERSQLHISTORY_H
+#ifndef KEXITQUERYDESIGNERSQLHISTORY_H
+#define KEXITQUERYDESIGNERSQLHISTORY_H
-#include <qscrollview.h>
-#include <qdatetime.h>
-#include <qptrlist.h>
-#include <qmap.h>
-#include <qsimplerichtext.h>
+#include <tqscrollview.h>
+#include <tqdatetime.h>
+#include <tqptrlist.h>
+#include <tqmap.h>
+#include <tqsimplerichtext.h>
-class QSimpleRichText;
+class TQSimpleRichText;
class KPopupMenu;
class HistoryEntry
{
public:
- HistoryEntry(bool success, const QTime &time, const QString &statement, /*int y,*/ const QString &error = QString::null);
+ HistoryEntry(bool success, const TQTime &time, const TQString &statement, /*int y,*/ const TQString &error = TQString());
~HistoryEntry();
- QRect geometry(int y, int width, QFontMetrics f);
- void drawItem(QPainter *p, int width, const QColorGroup &cg);
+ TQRect tqgeometry(int y, int width, TQFontMetrics f);
+ void drawItem(TQPainter *p, int width, const TQColorGroup &cg);
- void setSelected(bool selected, const QColorGroup &cg);
+ void setSelected(bool selected, const TQColorGroup &cg);
bool isSelected() const { return m_selected; }
- void highlight(const QColorGroup &selected);
+ void highlight(const TQColorGroup &selected);
- QString statement() { return m_statement; }
- void updateTime(const QTime &execTime);
+ TQString statement() { return m_statement; }
+ void updateTime(const TQTime &execTime);
private:
bool m_succeed;
- QTime m_execTime;
- QString m_statement;
- QString m_error;
- QSimpleRichText *m_formated;
+ TQTime m_execTime;
+ TQString m_statement;
+ TQString m_error;
+ TQSimpleRichText *m_formated;
int m_y;
bool m_selected;
};
-typedef QPtrList<HistoryEntry> History;
+typedef TQPtrList<HistoryEntry> History;
-class KexiQueryDesignerSQLHistory : public QScrollView
+class KexiQueryDesignerSQLHistory : public TQScrollView
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiQueryDesignerSQLHistory(QWidget *parent, const char *name=0);
+ KexiQueryDesignerSQLHistory(TQWidget *tqparent, const char *name=0);
virtual ~KexiQueryDesignerSQLHistory();
KPopupMenu* popupMenu() const;
-// void contextMenu(const QPoint &pos, HistoryEntry *e);
+// void contextMenu(const TQPoint &pos, HistoryEntry *e);
void setHistory(History *h);
- QString selectedStatement() const;
+ TQString selectedStatement() const;
public slots:
- void addEvent(const QString& q, bool s, const QString &error);
+ void addEvent(const TQString& q, bool s, const TQString &error);
void slotToClipboard();
void slotEdit();
@@ -87,12 +88,12 @@ class KexiQueryDesignerSQLHistory : public QScrollView
protected:
void addEntry(HistoryEntry *e);
- virtual void drawContents(QPainter *p, int cx, int cy, int cw, int ch);
- virtual void contentsMousePressEvent(QMouseEvent * e);
- virtual void contentsMouseDoubleClickEvent(QMouseEvent * e);
+ virtual void drawContents(TQPainter *p, int cx, int cy, int cw, int ch);
+ virtual void contentsMousePressEvent(TQMouseEvent * e);
+ virtual void contentsMouseDoubleClickEvent(TQMouseEvent * e);
signals:
- void editRequested(const QString &text);
+ void editRequested(const TQString &text);
void currentItemDoubleClicked();
private:
diff --git a/kexi/plugins/queries/kexiquerypart.cpp b/kexi/plugins/queries/kexiquerypart.cpp
index 6cecfcf1..c9ce5755 100644
--- a/kexi/plugins/queries/kexiquerypart.cpp
+++ b/kexi/plugins/queries/kexiquerypart.cpp
@@ -37,8 +37,8 @@
//------------------------------------------------
-KexiQueryPart::KexiQueryPart(QObject *parent, const char *name, const QStringList &l)
- : KexiPart::Part(parent, name, l)
+KexiQueryPart::KexiQueryPart(TQObject *tqparent, const char *name, const TQStringList &l)
+ : KexiPart::Part(tqparent, name, l)
{
// REGISTERED ID:
m_registeredPartID = (int)KexiPart::QueryObjectType;
@@ -65,33 +65,33 @@ KexiQueryPart::createTempData(KexiDialogBase* dialog)
}
KexiViewBase*
-KexiQueryPart::createView(QWidget *parent, KexiDialogBase* dialog, KexiPart::Item &item, int viewMode, QMap<QString,QString>*)
+KexiQueryPart::createView(TQWidget *tqparent, KexiDialogBase* dialog, KexiPart::Item &item, int viewMode, TQMap<TQString,TQString>*)
{
Q_UNUSED( item );
kdDebug() << "KexiQueryPart::createView()" << endl;
if (viewMode == Kexi::DataViewMode) {
- return new KexiQueryView(dialog->mainWin(), parent, "dataview");
+ return new KexiQueryView(dialog->mainWin(), tqparent, "dataview");
}
else if (viewMode == Kexi::DesignViewMode) {
KexiQueryDesignerGuiEditor* view = new KexiQueryDesignerGuiEditor(
- dialog->mainWin(), parent, "guieditor");
+ dialog->mainWin(), tqparent, "guieditor");
//needed for updating tables combo box:
KexiProject *prj = dialog->mainWin()->project();
- connect(prj, SIGNAL(newItemStored(KexiPart::Item&)),
- view, SLOT(slotNewItemStored(KexiPart::Item&)));
- connect(prj, SIGNAL(itemRemoved(const KexiPart::Item&)),
- view, SLOT(slotItemRemoved(const KexiPart::Item&)));
- connect(prj, SIGNAL(itemRenamed(const KexiPart::Item&, const QCString&)),
- view, SLOT(slotItemRenamed(const KexiPart::Item&, const QCString&)));
-
-// connect(dialog->mainWin()->project(), SIGNAL(tableCreated(KexiDB::TableSchema&)),
-// view, SLOT(slotTableCreated(KexiDB::TableSchema&)));
+ connect(prj, TQT_SIGNAL(newItemStored(KexiPart::Item&)),
+ view, TQT_SLOT(slotNewItemStored(KexiPart::Item&)));
+ connect(prj, TQT_SIGNAL(itemRemoved(const KexiPart::Item&)),
+ view, TQT_SLOT(slotItemRemoved(const KexiPart::Item&)));
+ connect(prj, TQT_SIGNAL(itemRenamed(const KexiPart::Item&, const TQCString&)),
+ view, TQT_SLOT(slotItemRenamed(const KexiPart::Item&, const TQCString&)));
+
+// connect(dialog->mainWin()->project(), TQT_SIGNAL(tableCreated(KexiDB::TableSchema&)),
+// view, TQT_SLOT(slotTableCreated(KexiDB::TableSchema&)));
return view;
}
else if (viewMode == Kexi::TextViewMode) {
- return new KexiQueryDesignerSQLView(dialog->mainWin(), parent, "sqldesigner");
+ return new KexiQueryDesignerSQLView(dialog->mainWin(), tqparent, "sqldesigner");
}
return 0;
@@ -128,9 +128,9 @@ void KexiQueryPart::initInstanceActions( int mode, KActionCollection *col )
else if (mode==Kexi::DesignViewMode) {
}
else if (mode==Kexi::TextViewMode) {
-// new KAction(i18n("Check Query"), "test_it", 0, this, SLOT(slotCheckQuery()), col, "querypart_check_query");
+// new KAction(i18n("Check Query"), "test_it", 0, this, TQT_SLOT(slotCheckQuery()), col, "querypart_check_query");
-//TODO new KAction(i18n("Execute Query"), "?????", 0, this, SLOT(checkQuery()), col, "querypart_execute_query");
+//TODO new KAction(i18n("Execute Query"), "?????", 0, this, TQT_SLOT(checkQuery()), col, "querypart_execute_query");
}
}
#endif
@@ -141,7 +141,7 @@ void KexiQueryPart::initPartActions()
void KexiQueryPart::initInstanceActions()
{
-// new KAction(i18n("Check Query"), "test_it", 0, this, SLOT(slotCheckQuery()),
+// new KAction(i18n("Check Query"), "test_it", 0, this, TQT_SLOT(slotCheckQuery()),
// m_instanceGuiClients[Kexi::DesignViewMode]->actionCollection(), "querypart_check_query");
KAction *a = createSharedAction(Kexi::TextViewMode, i18n("Check Query"), "test_it",
@@ -161,7 +161,7 @@ KexiDB::SchemaData*
KexiQueryPart::loadSchemaData(KexiDialogBase *dlg, const KexiDB::SchemaData& sdata, int viewMode)
{
KexiQueryPart::TempData * temp = static_cast<KexiQueryPart::TempData*>(dlg->tempData());
- QString sqlText;
+ TQString sqlText;
if (!loadDataBlock( dlg, sqlText, "sql" )) {
return 0;
}
@@ -191,7 +191,7 @@ KexiQueryPart::loadSchemaData(KexiDialogBase *dlg, const KexiDB::SchemaData& sda
return query;
}
-QString KexiQueryPart::i18nMessage(const QCString& englishMessage, KexiDialogBase* dlg) const
+TQString KexiQueryPart::i18nMessage(const TQCString& englishMessage, KexiDialogBase* dlg) const
{
Q_UNUSED(dlg);
if (englishMessage=="Design of object \"%1\" has been modified.")
@@ -202,7 +202,7 @@ QString KexiQueryPart::i18nMessage(const QCString& englishMessage, KexiDialogBas
return englishMessage;
}
-tristate KexiQueryPart::rename(KexiMainWindow *win, KexiPart::Item &item, const QString& newName)
+tristate KexiQueryPart::rename(KexiMainWindow *win, KexiPart::Item &item, const TQString& newName)
{
Q_UNUSED(newName);
if (!win->project()->dbConnection())
@@ -213,8 +213,8 @@ tristate KexiQueryPart::rename(KexiMainWindow *win, KexiPart::Item &item, const
//----------------
-KexiQueryPart::TempData::TempData(KexiDialogBase* parent, KexiDB::Connection *conn)
- : KexiDialogTempData(parent)
+KexiQueryPart::TempData::TempData(KexiDialogBase* tqparent, KexiDB::Connection *conn)
+ : KexiDialogTempData(TQT_TQOBJECT(tqparent))
, KexiDB::Connection::TableSchemaChangeListenerInterface()
, queryChangedInPreviousView(false)
, m_query(0)
@@ -253,7 +253,7 @@ void KexiQueryPart::TempData::registerTableSchemaChanges(KexiDB::QuerySchema *q)
tristate KexiQueryPart::TempData::closeListener()
{
- KexiDialogBase* dlg = static_cast<KexiDialogBase*>(parent());
+ KexiDialogBase* dlg = static_cast<KexiDialogBase*>(TQT_TQWIDGET(tqparent()));
return dlg->mainWin()->closeDialog(dlg);
}
@@ -270,7 +270,7 @@ void KexiQueryPart::TempData::setQuery(KexiDB::QuerySchema *query)
return;
if (m_query
/* query not owned by dialog */
- && (static_cast<KexiDialogBase*>(parent())->schemaData() != static_cast<KexiDB::SchemaData*>( m_query )))
+ && (static_cast<KexiDialogBase*>(TQT_TQWIDGET(tqparent()))->schemaData() != static_cast<KexiDB::SchemaData*>( m_query )))
{
delete m_query;
}
diff --git a/kexi/plugins/queries/kexiquerypart.h b/kexi/plugins/queries/kexiquerypart.h
index 6b16f28d..aee905e6 100644
--- a/kexi/plugins/queries/kexiquerypart.h
+++ b/kexi/plugins/queries/kexiquerypart.h
@@ -18,10 +18,10 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef KEXIQUERYPART_H
-#define KEXIQUERYPART_H
+#ifndef KEXITQUERYPART_H
+#define KEXITQUERYPART_H
-#include <qmap.h>
+#include <tqmap.h>
#include <kexidialogbase.h>
#include <kexipart.h>
@@ -44,9 +44,10 @@ class KexiProject;
class KexiQueryPart : public KexiPart::Part
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiQueryPart(QObject *parent, const char *name, const QStringList &);
+ KexiQueryPart(TQObject *tqparent, const char *name, const TQStringList &);
virtual ~KexiQueryPart();
virtual bool remove(KexiMainWindow *win, KexiPart::Item &item);
@@ -56,7 +57,7 @@ class KexiQueryPart : public KexiPart::Part
public KexiDB::Connection::TableSchemaChangeListenerInterface
{
public:
- TempData(KexiDialogBase* parent, KexiDB::Connection *conn);
+ TempData(KexiDialogBase* tqparent, KexiDB::Connection *conn);
virtual ~TempData();
virtual tristate closeListener();
void clearQuery();
@@ -65,7 +66,7 @@ class KexiQueryPart : public KexiPart::Part
/*! Assigns query \a query for this data.
Existing query (available using query()) is deleted but only
- if it is not owned by parent dialog (i.e. != KexiDialogBase::schemaData()).
+ if it is not owned by tqparent dialog (i.e. != KexiDialogBase::schemaData()).
\a query can be 0.
If \a query is equal to existing query, nothing is performed.
*/
@@ -91,18 +92,18 @@ class KexiQueryPart : public KexiPart::Part
KexiDB::QuerySchema *m_query;
};
- virtual QString i18nMessage(const QCString& englishMessage,
+ virtual TQString i18nMessage(const TQCString& englishMessage,
KexiDialogBase* dlg) const;
/*! Renames stored data pointed by \a item to \a newName.
Reimplemented to mark the query obsolete by using KexiDB::Connection::setQuerySchemaObsolete(). */
- virtual tristate rename(KexiMainWindow * win, KexiPart::Item & item, const QString& newName);
+ virtual tristate rename(KexiMainWindow * win, KexiPart::Item & item, const TQString& newName);
protected:
virtual KexiDialogTempData* createTempData(KexiDialogBase* dialog);
- virtual KexiViewBase* createView(QWidget *parent, KexiDialogBase* dialog,
- KexiPart::Item &item, int viewMode = Kexi::DataViewMode, QMap<QString,QString>* staticObjectArgs = 0);
+ virtual KexiViewBase* createView(TQWidget *tqparent, KexiDialogBase* dialog,
+ KexiPart::Item &item, int viewMode = Kexi::DataViewMode, TQMap<TQString,TQString>* staticObjectArgs = 0);
// virtual void initPartActions( KActionCollection *col );
// virtual void initInstanceActions( int mode, KActionCollection *col );
diff --git a/kexi/plugins/queries/kexiqueryview.cpp b/kexi/plugins/queries/kexiqueryview.cpp
index cf3fee96..cf5400dc 100644
--- a/kexi/plugins/queries/kexiqueryview.cpp
+++ b/kexi/plugins/queries/kexiqueryview.cpp
@@ -50,8 +50,8 @@ class KexiQueryView::Private
//---------------------------------------------------------------------------------
-KexiQueryView::KexiQueryView(KexiMainWindow *win, QWidget *parent, const char *name)
- : KexiDataTable(win, parent, name)
+KexiQueryView::KexiQueryView(KexiMainWindow *win, TQWidget *tqparent, const char *name)
+ : KexiDataTable(win, tqparent, name)
, d( new Private() )
{
tableView()->setInsertingEnabled(false); //default
@@ -72,7 +72,7 @@ tristate KexiQueryView::executeQuery(KexiDB::QuerySchema *query)
KexiDB::Cursor *oldCursor = d->cursor;
KexiDB::debug( query->parameters() );
bool ok;
- QValueList<QVariant> params;
+ TQValueList<TQVariant> params;
{
KexiUtils::WaitCursorRemover remover;
params = KexiQueryParameters::getParameters(this,
@@ -83,7 +83,7 @@ tristate KexiQueryView::executeQuery(KexiDB::QuerySchema *query)
}
d->cursor = mainWin()->project()->dbConnection()->executeQuery(*query, params);
if (!d->cursor) {
- parentDialog()->setStatus(parentDialog()->mainWin()->project()->dbConnection(),
+ tqparentDialog()->settqStatus(tqparentDialog()->mainWin()->project()->dbConnection(),
i18n("Query executing failed."));
//todo: also provide server result and sql statement
return false;
@@ -100,7 +100,7 @@ tristate KexiQueryView::executeQuery(KexiDB::QuerySchema *query)
tableView()->setReadOnly( true );
//! @todo maybe allow writing and inserting for single-table relations?
//set data model itself read-only too
- tableView()->data()->setReadOnly( true );
+ tableView()->KexiDataAwareObjectInterface::data()->setReadOnly( true );
tableView()->setInsertingEnabled( false );
return true;
}
@@ -108,13 +108,13 @@ tristate KexiQueryView::executeQuery(KexiDB::QuerySchema *query)
tristate KexiQueryView::afterSwitchFrom(int mode)
{
if (mode==Kexi::NoViewMode) {
- KexiDB::QuerySchema *querySchema = static_cast<KexiDB::QuerySchema *>(parentDialog()->schemaData());
+ KexiDB::QuerySchema *querySchema = static_cast<KexiDB::QuerySchema *>(tqparentDialog()->schemaData());
const tristate result = executeQuery(querySchema);
if (true != result)
return result;
}
else if (mode==Kexi::DesignViewMode || Kexi::TextViewMode) {
- KexiQueryPart::TempData * temp = static_cast<KexiQueryPart::TempData*>(parentDialog()->tempData());
+ KexiQueryPart::TempData * temp = static_cast<KexiQueryPart::TempData*>(tqparentDialog()->tempData());
//remember what view we should use to store data changes, if needed
// if (temp->queryChangedInPreviousView)
@@ -131,7 +131,7 @@ tristate KexiQueryView::afterSwitchFrom(int mode)
KexiDB::SchemaData* KexiQueryView::storeNewData(const KexiDB::SchemaData& sdata, bool &cancel)
{
- KexiViewBase * view = parentDialog()->viewThatRecentlySetDirtyFlag();
+ KexiViewBase * view = tqparentDialog()->viewThatRecentlySetDirtyFlag();
if (dynamic_cast<KexiQueryDesignerGuiEditor*>(view))
return dynamic_cast<KexiQueryDesignerGuiEditor*>(view)->storeNewData(sdata, cancel);
if (dynamic_cast<KexiQueryDesignerSQLView*>(view))
@@ -141,7 +141,7 @@ KexiDB::SchemaData* KexiQueryView::storeNewData(const KexiDB::SchemaData& sdata,
tristate KexiQueryView::storeData(bool dontAsk)
{
- KexiViewBase * view = parentDialog()->viewThatRecentlySetDirtyFlag();
+ KexiViewBase * view = tqparentDialog()->viewThatRecentlySetDirtyFlag();
if (dynamic_cast<KexiQueryDesignerGuiEditor*>(view))
return dynamic_cast<KexiQueryDesignerGuiEditor*>(view)->storeData(dontAsk);
if (dynamic_cast<KexiQueryDesignerSQLView*>(view))
diff --git a/kexi/plugins/queries/kexiqueryview.h b/kexi/plugins/queries/kexiqueryview.h
index f0083738..b1f183ad 100644
--- a/kexi/plugins/queries/kexiqueryview.h
+++ b/kexi/plugins/queries/kexiqueryview.h
@@ -18,8 +18,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef KEXIQUERYVIEW_H
-#define KEXIQUERYVIEW_H
+#ifndef KEXITQUERYVIEW_H
+#define KEXITQUERYVIEW_H
#include <kexidatatable.h>
@@ -32,9 +32,10 @@ class KexiMainWindow;
class KexiQueryView : public KexiDataTable
{
Q_OBJECT
+ TQ_OBJECT
public:
- KexiQueryView(KexiMainWindow *win, QWidget *parent, const char *name=0);
+ KexiQueryView(KexiMainWindow *win, TQWidget *tqparent, const char *name=0);
~KexiQueryView();
protected: