summaryrefslogtreecommitdiffstats
path: root/kexi/core/kexidialogbase.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/core/kexidialogbase.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/core/kexidialogbase.cpp')
-rw-r--r--kexi/core/kexidialogbase.cpp106
1 files changed, 53 insertions, 53 deletions
diff --git a/kexi/core/kexidialogbase.cpp b/kexi/core/kexidialogbase.cpp
index 2f94e661..1469575b 100644
--- a/kexi/core/kexidialogbase.cpp
+++ b/kexi/core/kexidialogbase.cpp
@@ -33,17 +33,17 @@
#include <kexidb/utils.h>
#include <kexiutils/utils.h>
-#include <qwidgetstack.h>
-#include <qobjectlist.h>
-#include <qtimer.h>
+#include <tqwidgetstack.h>
+#include <tqobjectlist.h>
+#include <tqtimer.h>
#include <kdebug.h>
#include <kapplication.h>
#include <kiconloader.h>
-KexiDialogBase::KexiDialogBase(KexiMainWindow *parent, const QString &caption)
- : KMdiChildView(caption, parent, "KexiDialogBase")
- , KexiActionProxy(this, parent)
+KexiDialogBase::KexiDialogBase(KexiMainWindow *tqparent, const TQString &caption)
+ : KMdiChildView(caption, tqparent, "KexiDialogBase")
+ , KexiActionProxy(TQT_TQOBJECT(this), tqparent)
, m_isRegistered(false)
, m_origCaption(caption)
, m_schemaData(0)
@@ -54,17 +54,17 @@ KexiDialogBase::KexiDialogBase(KexiMainWindow *parent, const QString &caption)
m_supportedViewModes = 0; //will be set by KexiPart
m_openedViewModes = 0;
m_currentViewMode = Kexi::NoViewMode; //no view available yet
- m_parentWindow = parent;
+ m_parentWindow = tqparent;
m_creatingViewsMode = -1;
- QVBoxLayout *lyr = new QVBoxLayout(this);
- m_stack = new QWidgetStack(this, "stack");
+ TQVBoxLayout *lyr = new TQVBoxLayout(this);
+ m_stack = new TQWidgetStack(this, "stack");
lyr->addWidget(m_stack);
#ifdef KEXI_NO_CTXT_HELP
m_contextHelpInfo=new KexiContextHelpInfo();
#endif
-// m_instance=parent->instance();
+// m_instance=tqparent->instance();
m_id = -1;
m_item = 0;
@@ -100,7 +100,7 @@ void KexiDialogBase::addView(KexiViewBase *view, int mode)
// addActionProxyChild( view );
//set focus proxy inside this view
- QWidget *ch = static_cast<QWidget*>(view->child( 0, "QWidget", false ));
+ TQWidget *ch = TQT_TQWIDGET(view->child( 0, TQWIDGET_OBJECT_NAME_STRING, false ));
if (ch)
view->setFocusProxy(ch);
@@ -117,20 +117,20 @@ void KexiDialogBase::removeView(int mode)
m_openedViewModes ^= mode;
}
-QSize KexiDialogBase::minimumSizeHint() const
+TQSize KexiDialogBase::tqminimumSizeHint() const
{
KexiViewBase *v = selectedView();
if (!v)
- return KMdiChildView::minimumSizeHint();
- return v->minimumSizeHint() + QSize(0, mdiParent() ? mdiParent()->captionHeight() : 0);
+ return KMdiChildView::tqminimumSizeHint();
+ return v->tqminimumSizeHint() + TQSize(0, mdiParent() ? mdiParent()->captionHeight() : 0);
}
-QSize KexiDialogBase::sizeHint() const
+TQSize KexiDialogBase::tqsizeHint() const
{
KexiViewBase *v = selectedView();
if (!v)
- return KMdiChildView::sizeHint();
- return v->preferredSizeHint( v->sizeHint() );
+ return KMdiChildView::tqsizeHint();
+ return v->preferredSizeHint( v->tqsizeHint() );
}
/*
@@ -174,7 +174,7 @@ int KexiDialogBase::id() const
return (partItem() && partItem()->identifier()>0) ? partItem()->identifier() : m_id;
}
-void KexiDialogBase::setContextHelp(const QString& caption, const QString& text, const QString& iconName) {
+void KexiDialogBase::setContextHelp(const TQString& caption, const TQString& text, const TQString& iconName) {
#ifdef KEXI_NO_CTXT_HELP
m_contextHelpInfo->caption=caption;
m_contextHelpInfo->text=text;
@@ -183,15 +183,15 @@ void KexiDialogBase::setContextHelp(const QString& caption, const QString& text,
#endif
}
-void KexiDialogBase::closeEvent( QCloseEvent * e )
+void KexiDialogBase::closeEvent( TQCloseEvent * e )
{
m_parentWindow->acceptPropertySetEditing();
//let any view send "closing" signal
- QObjectList *list = m_stack->queryList( "KexiViewBase", 0, false, false);
+ TQObjectList *list = m_stack->queryList( "KexiViewBase", 0, false, false);
KexiViewBase *view;
- QObjectListIt it( *list );
- for ( ;(view = static_cast<KexiViewBase*>(it.current()) ) != 0; ++it ) {
+ TQObjectListIt it( *list );
+ for ( ;(view = static_cast<KexiViewBase*>(TQT_TQWIDGET(it.current())) ) != 0; ++it ) {
bool cancel = false;
emit view->closing(cancel);
if (cancel) {
@@ -252,14 +252,14 @@ void KexiDialogBase::setDirty(bool dirty)
dirtyChanged(m_viewThatRecentlySetDirtyFlag); //update
}
-QString KexiDialogBase::itemIcon()
+TQString KexiDialogBase::itemIcon()
{
if (!m_part || !m_part->info()) {
KexiViewBase *v = selectedView();
if (v) {//m_stack->visibleWidget() && m_stack->visibleWidget()->inherits("KexiViewBase")) {
return v->m_defaultIconName;
}
- return QString::null;
+ return TQString();
}
return m_part->info()->itemIcon();
}
@@ -285,7 +285,7 @@ bool KexiDialogBase::isDesignModePreloadedForTextModeHackUsed(int newViewMode) c
&& supportsViewMode(Kexi::DesignViewMode);
}
-tristate KexiDialogBase::switchToViewMode( int newViewMode, QMap<QString,QString>* staticObjectArgs,
+tristate KexiDialogBase::switchToViewMode( int newViewMode, TQMap<TQString,TQString>* staticObjectArgs,
bool& proposeOpeningInTextViewModeBecauseOfProblems)
{
m_parentWindow->acceptPropertySetEditing();
@@ -377,9 +377,9 @@ tristate KexiDialogBase::switchToViewMode( int newViewMode, QMap<QString,QString
delete newView;
kdDebug() << "Switching to mode " << newViewMode << " failed. Previous mode "
<< prevViewMode << " restored." << endl;
- const Kexi::ObjectStatus status(*this);
- setStatus(mainWin()->project()->dbConnection(),
- i18n("Switching to other view failed (%1).").arg(Kexi::nameForViewMode(newViewMode)),"");
+ const Kexi::ObjecttqStatus status(*this);
+ settqStatus(mainWin()->project()->dbConnection(),
+ i18n("Switching to other view failed (%1).").tqarg(Kexi::nameForViewMode(newViewMode)),"");
append( status );
m_currentViewMode = prevViewMode;
return false;
@@ -394,8 +394,8 @@ tristate KexiDialogBase::switchToViewMode( int newViewMode, QMap<QString,QString
addActionProxyChild( newView ); //new proxy child
m_stack->raiseWidget( newView );
newView->propertySetSwitched();
- m_parentWindow->invalidateSharedActions( newView );
- QTimer::singleShot(10, newView, SLOT(setFocus())); //newView->setFocus(); //js ok?
+ m_parentWindow->tqinvalidateSharedActions( TQT_TQOBJECT(newView) );
+ TQTimer::singleShot(10, newView, TQT_SLOT(setFocus())); //newView->setFocus(); //js ok?
// setFocus();
return true;
}
@@ -429,17 +429,17 @@ KexiDialogBase::propertySet()
return v->propertySet();
}
-bool KexiDialogBase::eventFilter(QObject *obj, QEvent *e)
+bool KexiDialogBase::eventFilter(TQObject *obj, TQEvent *e)
{
if (KMdiChildView::eventFilter(obj, e))
return true;
-/* if (e->type()==QEvent::FocusIn) {
- QWidget *w = m_parentWindow->activeWindow();
+/* if (e->type()==TQEvent::FocusIn) {
+ TQWidget *w = m_parentWindow->activeWindow();
w=0;
}*/
- if ((e->type()==QEvent::FocusIn && m_parentWindow->activeWindow()==this)
- || e->type()==QEvent::MouseButtonPress) {
- if (m_stack->visibleWidget() && KexiUtils::hasParent(m_stack->visibleWidget(), obj)) {
+ if ((e->type()==TQEvent::FocusIn && m_parentWindow->activeWindow()==this)
+ || e->type()==TQEvent::MouseButtonPress) {
+ if (m_stack->visibleWidget() && KexiUtils::hasParent(TQT_TQOBJECT(m_stack->visibleWidget()), obj)) {
//pass the activation
activate();
}
@@ -464,7 +464,7 @@ void KexiDialogBase::dirtyChanged(KexiViewBase* view)
emit dirtyChanged(this);
}
-/*QString KexiDialogBase::caption() const
+/*TQString KexiDialogBase::caption() const
{
return m_origCaption;
if (dirty())
@@ -478,8 +478,8 @@ void KexiDialogBase::updateCaption()
if (!m_item || !m_part || !m_origCaption.isEmpty())
return;
// m_origCaption = c;
- QString capt = m_item->name();
- QString fullCapt = capt;
+ TQString capt = m_item->name();
+ TQString fullCapt = capt;
if (m_part)
fullCapt += (" : " + m_part->instanceCaption());
if (dirty()) {
@@ -517,7 +517,7 @@ tristate KexiDialogBase::storeNewData()
if (cancel)
return cancelled;
if (!m_schemaData) {
- setStatus(m_parentWindow->project()->dbConnection(), i18n("Saving object's definition failed."),"");
+ settqStatus(m_parentWindow->project()->dbConnection(), i18n("Saving object's definition failed."),"");
return false;
}
@@ -544,25 +544,25 @@ tristate KexiDialogBase::storeNewData()
} else {
// Got a maximum part ID, or there were no parts
p_id = p_id + 1;
- p_id = QMAX(p_id, (int)KexiPart::UserObjectType);
+ p_id = TQMAX(p_id, (int)KexiPart::UserObjectType);
}
}
KexiDB::FieldList *fl = ts->subList("p_id", "p_name", "p_mime", "p_url");
kexidbg << "KexiDialogBase::storeNewData(): fieldlist: "
- << (fl ? fl->debugString() : QString::null) << endl;
+ << (fl ? fl->debugString() : TQString()) << endl;
if (!fl)
return false;
kexidbg << part()->info()->ptr()->untranslatedGenericName() << endl;
-// QStringList sl = part()->info()->ptr()->propertyNames();
-// for (QStringList::ConstIterator it=sl.constBegin();it!=sl.constEnd();++it)
+// TQStringList sl = part()->info()->ptr()->propertyNames();
+// for (TQStringList::ConstIterator it=sl.constBegin();it!=sl.constEnd();++it)
// kexidbg << *it << " " << part()->info()->ptr()->property(*it).toString() << endl;
if (!m_parentWindow->project()->dbConnection()->insertRecord(
*fl,
- QVariant(p_id),
- QVariant(part()->info()->ptr()->untranslatedGenericName()),
- QVariant(part()->info()->mimeType()), QVariant("http://www.koffice.org/kexi/" /*always ok?*/)))
+ TQVariant(p_id),
+ TQVariant(part()->info()->ptr()->untranslatedGenericName()),
+ TQVariant(part()->info()->mimeType()), TQVariant("http://www.koffice.org/kexi/" /*always ok?*/)))
return false;
kdDebug() << "KexiDialogBase::storeNewData(): insert success!" << endl;
@@ -594,7 +594,7 @@ tristate KexiDialogBase::storeData(bool dontAsk)
return false;
#define storeData_ERR \
- setStatus(m_parentWindow->project()->dbConnection(), i18n("Saving object's data failed."),"");
+ settqStatus(m_parentWindow->project()->dbConnection(), i18n("Saving object's data failed."),"");
//save changes using transaction
KexiDB::Transaction transaction = m_parentWindow->project()->dbConnection()->beginTransaction();
@@ -624,8 +624,8 @@ tristate KexiDialogBase::storeData(bool dontAsk)
void KexiDialogBase::activate()
{
KexiViewBase *v = selectedView();
- //kdDebug() << "focusWidget(): " << focusWidget()->name() << endl;
- if (KexiUtils::hasParent( v, KMdiChildView::focusedChildWidget()))//focusWidget()))
+ //kdDebug() << "tqfocusWidget(): " << tqfocusWidget()->name() << endl;
+ if (KexiUtils::hasParent( TQT_TQOBJECT(v), TQT_TQOBJECT(KMdiChildView::focusedChildWidget())))//tqfocusWidget()))
KMdiChildView::activate();
else {//ah, focused widget is not in this view, move focus:
if (v)
@@ -633,7 +633,7 @@ void KexiDialogBase::activate()
}
if (v)
v->updateActions(true);
-//js: not neeed?? m_parentWindow->invalidateSharedActions(this);
+//js: not neeed?? m_parentWindow->tqinvalidateSharedActions(this);
}
void KexiDialogBase::deactivate()
@@ -647,14 +647,14 @@ void KexiDialogBase::sendDetachedStateToCurrentView()
{
KexiViewBase *v = selectedView();
if (v)
- v->parentDialogDetached();
+ v->tqparentDialogDetached();
}
void KexiDialogBase::sendAttachedStateToCurrentView()
{
KexiViewBase *v = selectedView();
if (v)
- v->parentDialogAttached();
+ v->tqparentDialogAttached();
}
#include "kexidialogbase.moc"