summaryrefslogtreecommitdiffstats
path: root/kbarcode/sqltables.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 00:55:34 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 00:55:34 +0000
commitc4189d200e71c7ef82e9a6e34935ad225154d658 (patch)
treef7f29a1159e0402472ff2ab22617a8113f66263c /kbarcode/sqltables.h
parent2f888b1578e65ec1bc514996eb509fcaf34462d6 (diff)
downloadkbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.tar.gz
kbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.zip
TQt4 port kbarcode
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbarcode@1233956 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbarcode/sqltables.h')
-rw-r--r--kbarcode/sqltables.h79
1 files changed, 38 insertions, 41 deletions
diff --git a/kbarcode/sqltables.h b/kbarcode/sqltables.h
index d78fd21..ba4029c 100644
--- a/kbarcode/sqltables.h
+++ b/kbarcode/sqltables.h
@@ -15,12 +15,12 @@
* *
***************************************************************************/
-#ifndef SQLTABLES_H
-#define SQLTABLES_H
+#ifndef STQLTABLES_H
+#define STQLTABLES_H
-#include <qobject.h>
-#include <qwidget.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqwidget.h>
+#include <tqstring.h>
/* Change these values to match your environment: */
@@ -30,24 +30,19 @@
#define TABLE_BASIC "barcode_basic"
/* -------- */
-// a macro to support QString::replace( QString, QString )
+// a macro to support TQString::tqreplace( TQString, TQString )
// also on QT 3.0.x
-#if QT_VERSION <= 0x030100
- #include <qregexp.h>
- #define DSREPLACE( x ) QRegExp( x )
-#else
- #define DSREPLACE( x ) x
-#endif
+#define DSREPLACE( x ) x
// Holds all information
// necessary for connecting
// to a database
typedef struct mysqldata {
- QString username;
- QString password;
- QString hostname; // localhost
- QString database; // kbarcode
- QString driver; // QMYSQL3
+ TQString username;
+ TQString password;
+ TQString hostname; // localhost
+ TQString database; // kbarcode
+ TQString driver; // TQMYSQL3
bool autoconnect;
void operator=( const mysqldata & rhs ) {
@@ -72,19 +67,19 @@ class SqlDescription {
/** return the name of the database we can always
* use to connect to this database.
*/
- virtual const QString initdb( QString ) const = 0;
+ virtual const TQString initdb( TQString ) const = 0;
/** return the auto_increment or serial command used for this db.
*/
- virtual const QString autoIncrement() const = 0;
+ virtual const TQString autoIncrement() const = 0;
/** return the command to show all fields of table for this db.
*/
- virtual const QString showColumns( const QString & table ) const = 0;
+ virtual const TQString showColumns( const TQString & table ) const = 0;
};
-class QSqlDatabase;
-class QSqlQuery;
+class TQSqlDatabase;
+class TQSqlQuery;
/**
* This class is used to access a database, create it and save its settings to the
* application configuration file. Also the labeldefinitions and exmplate data
@@ -93,8 +88,9 @@ class QSqlQuery;
* @short This singleton is used to access a database in KBarcode.
* @author Dominik Seichter
*/
-class SqlTables : public QObject {
+class SqlTables : public TQObject {
Q_OBJECT
+ TQ_OBJECT
public:
/** get a mysqldata object which contains the current database settings.
* this object is for all sql databases, not only for mysql. The name is just a
@@ -127,7 +123,7 @@ class SqlTables : public QObject {
const SqlDescription* driver() const;
public slots:
- const QString getBarcodeMaxLength( const QString & name );
+ const TQString getBarcodeMaxLength( const TQString & name );
void loadConfig();
void saveConfig();
@@ -139,34 +135,34 @@ class SqlTables : public QObject {
bool connectMySQL();
bool newTables();
- bool newTables( const QString & username, const QString & password, const QString & hostname, const QString & database, const QString & driver );
+ bool newTables( const TQString & username, const TQString & password, const TQString & hostname, const TQString & database, const TQString & driver );
void importLabelDef();
void importExampleData();
- void importData( const QString & filename, QSqlDatabase* db );
- bool testSettings( const QString & username, const QString & password, const QString & hostname, const QString & database, const QString & driver );
+ void importData( const TQString & filename, TQSqlDatabase* db );
+ bool testSettings( const TQString & username, const TQString & password, const TQString & hostname, const TQString & database, const TQString & driver );
- inline QSqlDatabase* database() const;
+ inline TQSqlDatabase* database() const;
signals:
void tablesChanged();
void connectedSQL();
private:
- SqlTables( QObject* parent = 0 );
+ SqlTables( TQObject* tqparent = 0 );
~SqlTables();
- void exec( QSqlQuery* query, const QString & text );
+ void exec( TQSqlQuery* query, const TQString & text );
void updateTables();
bool connected;
- QSqlDatabase* db;
+ TQSqlDatabase* db;
mysqldata sqldata;
static SqlTables* instance;
};
-inline QSqlDatabase* SqlTables::database() const
+inline TQSqlDatabase* SqlTables::database() const
{
return db;
}
@@ -174,7 +170,7 @@ inline QSqlDatabase* SqlTables::database() const
class KComboBox;
class KLineEdit;
class KPushButton;
-class QCheckBox;
+class TQCheckBox;
/** A widget for configuring a SQL connection.
* It has child widgets for entering data like the
* user name, database name, host name, password
@@ -183,17 +179,18 @@ class QCheckBox;
*
* @author Dominik Seichter
*/
-class SqlWidget : public QWidget {
+class SqlWidget : public TQWidget {
Q_OBJECT
+ TQ_OBJECT
public:
- SqlWidget( bool showlabel, QWidget* parent = 0, const char* name = 0 );
+ SqlWidget( bool showlabel, TQWidget* tqparent = 0, const char* name = 0 );
~SqlWidget();
- const QString username() const;
- const QString driver() const;
- const QString database() const;
- const QString hostname() const;
- const QString password() const;
+ const TQString username() const;
+ const TQString driver() const;
+ const TQString database() const;
+ const TQString hostname() const;
+ const TQString password() const;
bool autoconnect() const;
int driverCount() const;
@@ -214,7 +211,7 @@ class SqlWidget : public QWidget {
KLineEdit* m_hostname;
KLineEdit* m_password;
- QCheckBox* m_autoconnect;
+ TQCheckBox* m_autoconnect;
KPushButton* buttonTest;
};