summaryrefslogtreecommitdiffstats
path: root/kexi/widget/kexiqueryparameters.cpp
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/widget/kexiqueryparameters.cpp
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/widget/kexiqueryparameters.cpp')
-rw-r--r--kexi/widget/kexiqueryparameters.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/kexi/widget/kexiqueryparameters.cpp b/kexi/widget/kexiqueryparameters.cpp
index 449c265c..bcef819f 100644
--- a/kexi/widget/kexiqueryparameters.cpp
+++ b/kexi/widget/kexiqueryparameters.cpp
@@ -29,14 +29,14 @@
#include "utils/kexidatetimeformatter.h"
//static
-QValueList<QVariant> KexiQueryParameters::getParameters(QWidget *parent,
+TQValueList<TQVariant> KexiQueryParameters::getParameters(TQWidget *tqparent,
const KexiDB::Driver &driver, KexiDB::QuerySchema& querySchema, bool &ok)
{
Q_UNUSED(driver);
ok = false;
const KexiDB::QuerySchemaParameterList params( querySchema.parameters() );
- QValueList<QVariant> values;
- const QString caption( i18n("Enter Query Parameter Value", "Enter Parameter Value") );
+ TQValueList<TQVariant> values;
+ const TQString caption( i18n("Enter Query Parameter Value", "Enter Parameter Value") );
foreach(KexiDB::QuerySchemaParameterListConstIterator, it, params) {
switch ((*it).type) {
case KexiDB::Field::Byte:
@@ -48,53 +48,53 @@ QValueList<QVariant> KexiQueryParameters::getParameters(QWidget *parent,
//! @todo add support for unsigned parameter here
KexiDB::getLimitsForType((*it).type, minValue, maxValue);
const int result = KInputDialog::getInteger(
- caption, (*it).message, 0, minValue, maxValue, 1/*step*/, 10/*base*/, &ok, parent);
+ caption, (*it).message, 0, minValue, maxValue, 1/*step*/, 10/*base*/, &ok, tqparent);
if (!ok)
- return QValueList<QVariant>(); //cancelled
+ return TQValueList<TQVariant>(); //cancelled
values.append(result);
break;
}
case KexiDB::Field::Boolean: {
- QStringList list;
+ TQStringList list;
list << i18n("Boolean True - Yes", "Yes") << i18n("Boolean False - No", "No");
- const QString result = KInputDialog::getItem(
- caption, (*it).message, list, 0/*current*/, false /*!editable*/, &ok, parent);
+ const TQString result = KInputDialog::getItem(
+ caption, (*it).message, list, 0/*current*/, false /*!editable*/, &ok, tqparent);
if (!ok || result.isEmpty())
- return QValueList<QVariant>(); //cancelled
- values.append( QVariant( result==list.first(), 1 ) );
+ return TQValueList<TQVariant>(); //cancelled
+ values.append( TQVariant( result==list.first(), 1 ) );
break;
}
case KexiDB::Field::Date: {
KexiDateFormatter df;
- const QString result = KInputDialog::getText(
- caption, (*it).message, QString::null, &ok, parent, 0/*name*/,
+ const TQString result = KInputDialog::getText(
+ caption, (*it).message, TQString(), &ok, tqparent, 0/*name*/,
//! @todo add validator
0/*validator*/, df.inputMask() );
if (!ok)
- return QValueList<QVariant>(); //cancelled
+ return TQValueList<TQVariant>(); //cancelled
values.append( df.stringToDate(result) );
break;
}
case KexiDB::Field::DateTime: {
KexiDateFormatter df;
KexiTimeFormatter tf;
- const QString result = KInputDialog::getText(
- caption, (*it).message, QString::null, &ok, parent, 0/*name*/,
+ const TQString result = KInputDialog::getText(
+ caption, (*it).message, TQString(), &ok, tqparent, 0/*name*/,
//! @todo add validator
0/*validator*/, dateTimeInputMask(df, tf) );
if (!ok)
- return QValueList<QVariant>(); //cancelled
+ return TQValueList<TQVariant>(); //cancelled
values.append( stringToDateTime(df, tf, result) );
break;
}
case KexiDB::Field::Time: {
KexiTimeFormatter tf;
- const QString result = KInputDialog::getText(
- caption, (*it).message, QString::null, &ok, parent, 0/*name*/,
+ const TQString result = KInputDialog::getText(
+ caption, (*it).message, TQString(), &ok, tqparent, 0/*name*/,
//! @todo add validator
0/*validator*/, tf.inputMask() );
if (!ok)
- return QValueList<QVariant>(); //cancelled
+ return TQValueList<TQVariant>(); //cancelled
values.append( tf.stringToTime(result) );
break;
}
@@ -102,35 +102,35 @@ QValueList<QVariant> KexiQueryParameters::getParameters(QWidget *parent,
case KexiDB::Field::Double: {
// KInputDialog::getDouble() does not work well, use getText and double validator
KDoubleValidator validator(0);
- const QString textResult = KInputDialog::getText( caption, (*it).message, QString::null, &ok,
- parent, 0, &validator);
+ const TQString textResult = KInputDialog::getText( caption, (*it).message, TQString(), &ok,
+ tqparent, 0, &validator);
if (!ok || textResult.isEmpty())
- return QValueList<QVariant>(); //cancelled
+ return TQValueList<TQVariant>(); //cancelled
//! @todo this value will be still rounded: consider storing them as a decimal type
-//! (e.g. using a special Q_LLONG+decimalplace class)
+//! (e.g. using a special TQ_LLONG+decimalplace class)
const double result = textResult.toDouble(&ok); //this is also good for float (to avoid rounding)
if (!ok)
- return QValueList<QVariant>();
+ return TQValueList<TQVariant>();
values.append( result );
break;
}
case KexiDB::Field::Text:
case KexiDB::Field::LongText: {
- const QString result = KInputDialog::getText(
- caption, (*it).message, QString::null, &ok, parent);
+ const TQString result = KInputDialog::getText(
+ caption, (*it).message, TQString(), &ok, tqparent);
if (!ok)
- return QValueList<QVariant>(); //cancelled
+ return TQValueList<TQVariant>(); //cancelled
values.append( result );
break;
}
case KexiDB::Field::BLOB: {
//! @todo BLOB input unsupported
- values.append( QByteArray() );
+ values.append( TQByteArray() );
}
default:
kexiwarn << "KexiQueryParameters::getParameters() unsupported type " << KexiDB::Field::typeName((*it).type)
<< " for parameter \"" << (*it).message << "\" - aborting query execution!" << endl;
- return QValueList<QVariant>();
+ return TQValueList<TQVariant>();
}
}
ok = true;