diff options
Diffstat (limited to 'kexi/core/kexiviewbase.cpp')
-rw-r--r-- | kexi/core/kexiviewbase.cpp | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/kexi/core/kexiviewbase.cpp b/kexi/core/kexiviewbase.cpp index 1696f502..d31a15fa 100644 --- a/kexi/core/kexiviewbase.cpp +++ b/kexi/core/kexiviewbase.cpp @@ -30,9 +30,9 @@ #include <kdebug.h> -KexiViewBase::KexiViewBase(KexiMainWindow *mainWin, QWidget *parent, const char *name) - : QWidget(parent, name) - , KexiActionProxy(this, mainWin) +KexiViewBase::KexiViewBase(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name) + : TQWidget(tqparent, name) + , KexiActionProxy(TQT_TQOBJECT(this), mainWin) , m_mainWin(mainWin) , m_viewWidget(0) , m_parentView(0) @@ -40,8 +40,8 @@ KexiViewBase::KexiViewBase(KexiMainWindow *mainWin, QWidget *parent, const char , m_viewMode(0) //unknown! , m_dirty(false) { - QWidget *wi=this; - while ((wi = wi->parentWidget()) && !wi->inherits("KexiDialogBase")) + TQWidget *wi=this; + while ((wi = wi->tqparentWidget()) && !wi->inherits("KexiDialogBase")) ; m_dialog = (wi && wi->inherits("KexiDialogBase")) ? static_cast<KexiDialogBase*>(wi) : 0; if (m_dialog) { @@ -72,12 +72,12 @@ tristate KexiViewBase::afterSwitchFrom(int /* mode */) return true; } -QSize KexiViewBase::preferredSizeHint(const QSize& otherSize) +TQSize KexiViewBase::preferredSizeHint(const TQSize& otherSize) { - KexiDialogBase* dlg = parentDialog(); + KexiDialogBase* dlg = tqparentDialog(); if (dlg && dlg->mdiParent()) { - QRect r = dlg->mdiParent()->mdiAreaContentsRect(); - return otherSize.boundedTo( QSize( + TQRect r = dlg->mdiParent()->mdiAreaContentsRect(); + return otherSize.boundedTo( TQSize( r.width() - 10, r.height() - dlg->mdiParent()->captionHeight() - dlg->pos().y() - 10 ) ); @@ -85,7 +85,7 @@ QSize KexiViewBase::preferredSizeHint(const QSize& otherSize) return otherSize; } -void KexiViewBase::closeEvent( QCloseEvent * e ) +void KexiViewBase::closeEvent( TQCloseEvent * e ) { bool cancel = false; emit closing(cancel); @@ -93,7 +93,7 @@ void KexiViewBase::closeEvent( QCloseEvent * e ) e->ignore(); return; } - QWidget::closeEvent(e); + TQWidget::closeEvent(e); } KoProperty::Set *KexiViewBase::propertySet() @@ -103,14 +103,14 @@ KoProperty::Set *KexiViewBase::propertySet() void KexiViewBase::propertySetSwitched() { - if (parentDialog()) - m_mainWin->propertySetSwitched( parentDialog(), false ); + if (tqparentDialog()) + m_mainWin->propertySetSwitched( tqparentDialog(), false ); } -void KexiViewBase::propertySetReloaded(bool preservePrevSelection, const QCString& propertyToSelect) +void KexiViewBase::propertySetReloaded(bool preservePrevSelection, const TQCString& propertyToSelect) { - if (parentDialog()) - m_mainWin->propertySetSwitched( parentDialog(), true, preservePrevSelection, propertyToSelect ); + if (tqparentDialog()) + m_mainWin->propertySetSwitched( tqparentDialog(), true, preservePrevSelection, propertyToSelect ); } void KexiViewBase::setDirty(bool set) @@ -175,19 +175,19 @@ tristate KexiViewBase::storeData(bool dontAsk) return true; } -bool KexiViewBase::loadDataBlock( QString &dataString, const QString& dataID, bool canBeEmpty ) +bool KexiViewBase::loadDataBlock( TQString &dataString, const TQString& dataID, bool canBeEmpty ) { if (!m_dialog) return false; const tristate res = m_mainWin->project()->dbConnection()->loadDataBlock(m_dialog->id(), dataString, dataID); if (canBeEmpty && ~res) { - dataString = QString::null; + dataString = TQString(); return true; } return res == true; } -bool KexiViewBase::storeDataBlock( const QString &dataString, const QString &dataID ) +bool KexiViewBase::storeDataBlock( const TQString &dataString, const TQString &dataID ) { if (!m_dialog) return false; @@ -203,50 +203,50 @@ bool KexiViewBase::storeDataBlock( const QString &dataString, const QString &dat && m_mainWin->project()->dbConnection()->storeDataBlock(effectiveID, dataString, dataID); } -bool KexiViewBase::removeDataBlock( const QString& dataID ) +bool KexiViewBase::removeDataBlock( const TQString& dataID ) { if (!m_dialog) return false; return m_mainWin->project()->dbConnection()->removeDataBlock(m_dialog->id(), dataID); } -bool KexiViewBase::eventFilter( QObject *o, QEvent *e ) +bool KexiViewBase::eventFilter( TQObject *o, TQEvent *e ) { - if (e->type()==QEvent::FocusIn || e->type()==QEvent::FocusOut) {// && o->inherits("QWidget")) { + if (e->type()==TQEvent::FocusIn || e->type()==TQEvent::FocusOut) {// && o->inherits(TQWIDGET_OBJECT_NAME_STRING)) { // //hp==true if currently focused widget is a child of this table view -// const bool hp = Kexi::hasParent( static_cast<QWidget*>(o), focusWidget()); +// const bool hp = Kexi::hasParent( static_cast<TQWidget*>(o), tqfocusWidget()); // kexidbg << "KexiViewBase::eventFilter(): " << o->name() << " " << e->type() << endl; - if (KexiUtils::hasParent( this, static_cast<QWidget*>(o))) { - if (e->type()==QEvent::FocusOut && focusWidget() && !KexiUtils::hasParent( this, focusWidget())) { - //focus out: when currently focused widget is not a parent of this view + if (KexiUtils::hasParent( TQT_TQOBJECT(this), TQT_TQOBJECT(o))) { + if (e->type()==TQEvent::FocusOut && tqfocusWidget() && !KexiUtils::hasParent( TQT_TQOBJECT(this), TQT_TQOBJECT(tqfocusWidget()))) { + //focus out: when currently focused widget is not a tqparent of this view emit focus(false); - } else if (e->type()==QEvent::FocusIn) { + } else if (e->type()==TQEvent::FocusIn) { emit focus(true); } - if (e->type()==QEvent::FocusOut) { // && focusWidget() && Kexi::hasParent( this, focusWidget())) { // && focusWidget()->inherits("KexiViewBase")) { -// kdDebug() << focusWidget()->className() << " " << focusWidget()->name()<< endl; + if (e->type()==TQEvent::FocusOut) { // && tqfocusWidget() && Kexi::hasParent( this, tqfocusWidget())) { // && tqfocusWidget()->inherits("KexiViewBase")) { +// kdDebug() << tqfocusWidget()->className() << " " << tqfocusWidget()->name()<< endl; // kdDebug() << o->className() << " " << o->name()<< endl; KexiViewBase *v = KexiUtils::findParent<KexiViewBase>(o, "KexiViewBase") ; -// QWidget *www=v->focusWidget(); +// TQWidget *www=v->tqfocusWidget(); if (v) { while (v->m_parentView) v = v->m_parentView; - if (KexiUtils::hasParent( this, static_cast<QWidget*>(v->focusWidget()) )) - v->m_lastFocusedChildBeforeFocusOut = static_cast<QWidget*>(v->focusWidget()); -// v->m_lastFocusedChildBeforeFocusOut = static_cast<QWidget*>(o); //focusWidget(); + if (KexiUtils::hasParent( TQT_TQOBJECT(this), TQT_TQOBJECT(v->tqfocusWidget()) )) + v->m_lastFocusedChildBeforeFocusOut = static_cast<TQWidget*>(v->tqfocusWidget()); +// v->m_lastFocusedChildBeforeFocusOut = static_cast<TQWidget*>(o); //tqfocusWidget(); } } - if (e->type()==QEvent::FocusIn && m_actionProxyParent) { + if (e->type()==TQEvent::FocusIn && m_actionProxyParent) { m_actionProxyParent->m_focusedChild = this; } -// m_mainWin->invalidateSharedActions(this); +// m_mainWin->tqinvalidateSharedActions(this); } } return false; } -void KexiViewBase::setViewWidget(QWidget* w, bool focusProxy) +void KexiViewBase::setViewWidget(TQWidget* w, bool focusProxy) { if (m_viewWidget == w) return; @@ -263,7 +263,7 @@ void KexiViewBase::setViewWidget(QWidget* w, bool focusProxy) void KexiViewBase::addChildView( KexiViewBase* childView ) { - m_children.append( childView ); + m_tqchildren.append( childView ); addActionProxyChild( childView ); childView->m_parentView = this; // if (m_parentView) @@ -276,7 +276,7 @@ void KexiViewBase::setFocus() { if (!m_lastFocusedChildBeforeFocusOut.isNull()) { // kdDebug() << "FOCUS: " << m_lastFocusedChildBeforeFocusOut->className() << " " << m_lastFocusedChildBeforeFocusOut->name()<< endl; - QWidget *w = m_lastFocusedChildBeforeFocusOut; + TQWidget *w = m_lastFocusedChildBeforeFocusOut; m_lastFocusedChildBeforeFocusOut = 0; w->setFocus(); } @@ -286,7 +286,7 @@ void KexiViewBase::setFocus() else setFocusInternal(); } - m_mainWin->invalidateSharedActions(this); + m_mainWin->tqinvalidateSharedActions(TQT_TQOBJECT(this)); } KAction* KexiViewBase::sharedAction( const char *action_name ) @@ -318,8 +318,8 @@ void KexiViewBase::setAvailable(const char* action_name, bool set) void KexiViewBase::updateActions(bool activated) { //do nothing here - //do the same for children :) - for (QPtrListIterator<KexiViewBase> it(m_children); it.current(); ++it) { + //do the same for tqchildren :) + for (TQPtrListIterator<KexiViewBase> it(m_tqchildren); it.current(); ++it) { it.current()->updateActions(activated); } } |