summaryrefslogtreecommitdiffstats
path: root/kexi/widget/kexidatasourcecombobox.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/kexidatasourcecombobox.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/kexidatasourcecombobox.cpp')
-rw-r--r--kexi/widget/kexidatasourcecombobox.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/kexi/widget/kexidatasourcecombobox.cpp b/kexi/widget/kexidatasourcecombobox.cpp
index 77dc771f..77895e24 100644
--- a/kexi/widget/kexidatasourcecombobox.cpp
+++ b/kexi/widget/kexidatasourcecombobox.cpp
@@ -34,7 +34,7 @@
#include <kexidb/connection.h>
#ifdef KEXI_SHOW_UNIMPLEMENTED
-#define ADD_DEFINEQUERY_ROW
+#define ADD_DEFINETQUERY_ROW
#endif
//! @internal
@@ -50,7 +50,7 @@ class KexiDataSourceComboBox::Private
}
int firstTableIndex() const {
int index = 1; //skip empty row
-#ifdef ADD_DEFINEQUERY_ROW
+#ifdef ADD_DEFINETQUERY_ROW
index++; /*skip 'define query' row*/
#endif
return index;
@@ -59,8 +59,8 @@ class KexiDataSourceComboBox::Private
return firstTableIndex() + tablesCount;
}
- QGuardedPtr<KexiProject> prj;
- QPixmap tableIcon, queryIcon;
+ TQGuardedPtr<KexiProject> prj;
+ TQPixmap tableIcon, queryIcon;
int tablesCount;
int prevIndex; //!< Used in slotActivated()
bool showTables : 1;
@@ -69,15 +69,15 @@ class KexiDataSourceComboBox::Private
//------------------------
-KexiDataSourceComboBox::KexiDataSourceComboBox(QWidget *parent, const char *name)
- : KComboBox(true/*rw*/, parent, name)
+KexiDataSourceComboBox::KexiDataSourceComboBox(TQWidget *tqparent, const char *name)
+ : KComboBox(true/*rw*/, tqparent, name)
, d(new Private())
{
setInsertionPolicy(NoInsertion);
setCompletionMode(KGlobalSettings::CompletionPopupAuto);
setSizeLimit( 16 );
- connect(this, SIGNAL(activated(int)), this, SLOT(slotActivated(int)));
- connect(this, SIGNAL(returnPressed(const QString &)), this, SLOT(slotReturnPressed(const QString &)));
+ connect(this, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotActivated(int)));
+ connect(this, TQT_SIGNAL(returnPressed(const TQString &)), this, TQT_SLOT(slotReturnPressed(const TQString &)));
d->tableIcon = SmallIcon("table");
d->queryIcon = SmallIcon("query");
@@ -110,12 +110,12 @@ void KexiDataSourceComboBox::setProject(KexiProject *prj, bool showTables, bool
return;
//needed for updating contents of the combo box
- connect(d->prj, SIGNAL(newItemStored(KexiPart::Item&)),
- this, SLOT(slotNewItemStored(KexiPart::Item&)));
- connect(d->prj, SIGNAL(itemRemoved(const KexiPart::Item&)),
- this, SLOT(slotItemRemoved(const KexiPart::Item&)));
- connect(d->prj, SIGNAL(itemRenamed(const KexiPart::Item&, const QCString&)),
- this, SLOT(slotItemRenamed(const KexiPart::Item&, const QCString&)));
+ connect(d->prj, TQT_SIGNAL(newItemStored(KexiPart::Item&)),
+ this, TQT_SLOT(slotNewItemStored(KexiPart::Item&)));
+ connect(d->prj, TQT_SIGNAL(itemRemoved(const KexiPart::Item&)),
+ this, TQT_SLOT(slotItemRemoved(const KexiPart::Item&)));
+ connect(d->prj, TQT_SIGNAL(itemRenamed(const KexiPart::Item&, const TQCString&)),
+ this, TQT_SLOT(slotItemRenamed(const KexiPart::Item&, const TQCString&)));
KexiDB::Connection *conn = d->prj->dbConnection();
if (!conn)
@@ -123,7 +123,7 @@ void KexiDataSourceComboBox::setProject(KexiProject *prj, bool showTables, bool
//special item: empty
insertItem("");
-#ifdef ADD_DEFINEQUERY_ROW
+#ifdef ADD_DEFINETQUERY_ROW
//special item: define query
insertItem(i18n("Define Query..."));
#endif
@@ -162,7 +162,7 @@ void KexiDataSourceComboBox::setProject(KexiProject *prj, bool showTables, bool
setCurrentItem(0);
}
-void KexiDataSourceComboBox::setDataSource(const QString& mimeType, const QString& name)
+void KexiDataSourceComboBox::setDataSource(const TQString& mimeType, const TQString& name)
{
if (name.isEmpty()) {
clearEdit();
@@ -172,7 +172,7 @@ void KexiDataSourceComboBox::setDataSource(const QString& mimeType, const QStrin
return;
}
- QString mt(mimeType);
+ TQString mt(mimeType);
if (mimeType.isEmpty())
mt="kexi/table";
int i = findItem(mt, name);
@@ -190,11 +190,11 @@ void KexiDataSourceComboBox::setDataSource(const QString& mimeType, const QStrin
void KexiDataSourceComboBox::slotNewItemStored(KexiPart::Item& item)
{
- QString name(item.name());
+ TQString name(item.name());
//insert a new item, maintaining sort order and splitting to tables and queries
if (item.mimeType()=="kexi/table") {
int i = 1; /*skip empty row*/
-#ifdef ADD_DEFINEQUERY_ROW
+#ifdef ADD_DEFINETQUERY_ROW
i++; /*skip 'define query' row*/
#endif
for (; i < d->firstQueryIndex() && name>=text(i); i++)
@@ -212,12 +212,12 @@ void KexiDataSourceComboBox::slotNewItemStored(KexiPart::Item& item)
}
}
-int KexiDataSourceComboBox::findItem(const QString& mimeType, const QString& name)
+int KexiDataSourceComboBox::findItem(const TQString& mimeType, const TQString& name)
{
int i, end;
if (mimeType=="kexi/table") {
i = 0;
-#ifdef ADD_DEFINEQUERY_ROW
+#ifdef ADD_DEFINETQUERY_ROW
i++; //skip 'define query'
#endif
end = d->firstQueryIndex();
@@ -229,7 +229,7 @@ int KexiDataSourceComboBox::findItem(const QString& mimeType, const QString& nam
else
return -1;
- QString nameString(name);
+ TQString nameString(name);
for (; i<end; i++)
if (text(i)==nameString)
@@ -257,13 +257,13 @@ void KexiDataSourceComboBox::slotItemRemoved(const KexiPart::Item& item)
#endif
}
-void KexiDataSourceComboBox::slotItemRenamed(const KexiPart::Item& item, const QCString& oldName)
+void KexiDataSourceComboBox::slotItemRenamed(const KexiPart::Item& item, const TQCString& oldName)
{
- const int i = findItem(item.mimeType(), QString(oldName));
+ const int i = findItem(item.mimeType(), TQString(oldName));
if (i==-1)
return;
changeItem(item.name(), i);
- completionObject()->removeItem(QString(oldName));
+ completionObject()->removeItem(TQString(oldName));
completionObject()->addItem(item.name());
setCurrentText(oldName); //still keep old name
}
@@ -276,7 +276,7 @@ void KexiDataSourceComboBox::slotActivated( int index )
}
}
-QString KexiDataSourceComboBox::selectedMimeType() const
+TQString KexiDataSourceComboBox::selectedMimeType() const
{
if (selectedName().isEmpty())
return "";
@@ -288,7 +288,7 @@ QString KexiDataSourceComboBox::selectedMimeType() const
return "";
}
-QString KexiDataSourceComboBox::selectedName() const
+TQString KexiDataSourceComboBox::selectedName() const
{
if (isSelectionValid())
return text(currentItem());
@@ -301,7 +301,7 @@ bool KexiDataSourceComboBox::isSelectionValid() const
return index >= d->firstTableIndex() && index < count() && text(index)==currentText();
}
-void KexiDataSourceComboBox::slotReturnPressed(const QString & text)
+void KexiDataSourceComboBox::slotReturnPressed(const TQString & text)
{
//text is available: select item for this text:
bool changed = false;
@@ -310,7 +310,7 @@ void KexiDataSourceComboBox::slotReturnPressed(const QString & text)
changed = true;
}
else {
- QListBoxItem *item = listBox()->findItem( text, Qt::ExactMatch );
+ TQListBoxItem *item = listBox()->tqfindItem( text, TQt::ExactMatch );
if (item) {
int index = listBox()->index( item );
//if (index < d->firstTableIndex())
@@ -324,7 +324,7 @@ void KexiDataSourceComboBox::slotReturnPressed(const QString & text)
emit dataSourceChanged();
}
-void KexiDataSourceComboBox::focusOutEvent( QFocusEvent *e )
+void KexiDataSourceComboBox::focusOutEvent( TQFocusEvent *e )
{
KComboBox::focusOutEvent( e );
slotReturnPressed(currentText());