diff options
Diffstat (limited to 'kexi/plugins/forms/kexidbfactory.cpp')
-rw-r--r-- | kexi/plugins/forms/kexidbfactory.cpp | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/kexi/plugins/forms/kexidbfactory.cpp b/kexi/plugins/forms/kexidbfactory.cpp index 4ab05d76..5f379e6e 100644 --- a/kexi/plugins/forms/kexidbfactory.cpp +++ b/kexi/plugins/forms/kexidbfactory.cpp @@ -18,11 +18,11 @@ * Boston, MA 02110-1301, USA. */ -#include <qpopupmenu.h> -#include <qscrollview.h> -#include <qcursor.h> -#include <qpainter.h> -#include <qstyle.h> +#include <tqpopupmenu.h> +#include <tqscrollview.h> +#include <tqcursor.h> +#include <tqpainter.h> +#include <tqstyle.h> #include <kgenericfactory.h> #include <klocale.h> @@ -69,8 +69,8 @@ ////////////////////////////////////////// -KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringList &) - : KFormDesigner::WidgetFactory(parent, name) +KexiDBFactory::KexiDBFactory(TQObject *tqparent, const char *name, const TQStringList &) + : KFormDesigner::WidgetFactory(tqparent, name) { KFormDesigner::WidgetInfo *wi; wi = new KexiDataAwareWidgetInfo(this); @@ -101,7 +101,7 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis wi = new KexiDataAwareWidgetInfo(this, "stdwidgets", "KLineEdit"); wi->setPixmap("lineedit"); wi->setClassName("KexiDBLineEdit"); - wi->addAlternateClassName("QLineEdit", true/*override*/); + wi->addAlternateClassName(TQLINEEDIT_OBJECT_NAME_STRING, true/*override*/); wi->addAlternateClassName("KLineEdit", true/*override*/); wi->setIncludeFileName("klineedit.h"); wi->setName(i18n("Text Box")); @@ -115,7 +115,7 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis wi = new KexiDataAwareWidgetInfo(this, "stdwidgets", "KTextEdit"); wi->setPixmap("textedit"); wi->setClassName("KexiDBTextEdit"); - wi->addAlternateClassName("QTextEdit", true/*override*/); + wi->addAlternateClassName(TQTEXTEDIT_OBJECT_NAME_STRING, true/*override*/); wi->addAlternateClassName("KTextEdit", true/*override*/); wi->setIncludeFileName("ktextedit.h"); wi->setName(i18n("Text Editor")); @@ -126,10 +126,10 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis addClass(wi); wi = new KFormDesigner::WidgetInfo( - this, "containers", "QFrame" /*we're inheriting to get i18n'd strings already translated there*/); + this, "containers", TQFRAME_OBJECT_NAME_STRING /*we're inheriting to get i18n'd strings already translated there*/); wi->setPixmap("frame"); wi->setClassName("KexiFrame"); - wi->addAlternateClassName("QFrame", true/*override*/); + wi->addAlternateClassName(TQFRAME_OBJECT_NAME_STRING, true/*override*/); wi->setName(i18n("Frame")); wi->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. " @@ -138,10 +138,10 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis addClass(wi); wi = new KexiDataAwareWidgetInfo( - this, "stdwidgets", "QLabel" /*we're inheriting to get i18n'd strings already translated there*/); + this, "stdwidgets", TQLABEL_OBJECT_NAME_STRING /*we're inheriting to get i18n'd strings already translated there*/); wi->setPixmap("label"); wi->setClassName("KexiDBLabel"); - wi->addAlternateClassName("QLabel", true/*override*/); + wi->addAlternateClassName(TQLABEL_OBJECT_NAME_STRING, true/*override*/); wi->addAlternateClassName("KexiLabel", true/*override*/); //older wi->setName(i18n("Text Label", "Label")); wi->setNamePrefix( @@ -184,10 +184,10 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis addClass(wi); #endif - wi = new KexiDataAwareWidgetInfo(this, "stdwidgets", "QCheckBox"); + wi = new KexiDataAwareWidgetInfo(this, "stdwidgets", TQCHECKBOX_OBJECT_NAME_STRING); wi->setPixmap("check"); wi->setClassName("KexiDBCheckBox"); - wi->addAlternateClassName("QCheckBox", true/*override*/); + wi->addAlternateClassName(TQCHECKBOX_OBJECT_NAME_STRING, true/*override*/); wi->setName(i18n("Check Box")); wi->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. " @@ -213,11 +213,11 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis #if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) KexiDataAwareWidgetInfo *wDate = new KexiDataAwareWidgetInfo(this, "stdwidgets", "KDateWidget"); #else - KexiDataAwareWidgetInfo *wDate = new KexiDataAwareWidgetInfo(this, "stdwidgets", "QDateEdit"); + KexiDataAwareWidgetInfo *wDate = new KexiDataAwareWidgetInfo(this, "stdwidgets", TQDATEEDIT_OBJECT_NAME_STRING); #endif wDate->setPixmap("dateedit"); wDate->setClassName("KexiDBDateEdit"); - wDate->addAlternateClassName("QDateEdit", true);//override + wDate->addAlternateClassName(TQDATEEDIT_OBJECT_NAME_STRING, true);//override wDate->addAlternateClassName("KDateWidget", true);//override wDate->setName(i18n("Date Widget")); wDate->setNamePrefix( @@ -228,11 +228,11 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis #if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) KexiDataAwareWidgetInfo *wTime = new KexiDataAwareWidgetInfo(this, "stdwidgets", "KTimeWidget"); #else - KexiDataAwareWidgetInfo *wTime = new KexiDataAwareWidgetInfo(this, "stdwidgets", "QTimeEdit"); + KexiDataAwareWidgetInfo *wTime = new KexiDataAwareWidgetInfo(this, "stdwidgets", TQTIMEEDIT_OBJECT_NAME_STRING); #endif wTime->setPixmap("timeedit"); wTime->setClassName("KexiDBTimeEdit"); - wTime->addAlternateClassName("QTimeEdit", true);//override + wTime->addAlternateClassName(TQTIMEEDIT_OBJECT_NAME_STRING, true);//override wTime->addAlternateClassName("KTimeWidget", true);//override wTime->setName(i18n("Time Widget")); wTime->setNamePrefix( @@ -247,7 +247,7 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis #endif wDateTime->setPixmap("datetimeedit"); wDateTime->setClassName("KexiDBDateTimeEdit"); - wDateTime->addAlternateClassName("QDateTimeEdit", true);//override + wDateTime->addAlternateClassName(TQDATETIMEEDIT_OBJECT_NAME_STRING, true);//override wDateTime->addAlternateClassName("KDateTimeWidget", true);//override wDateTime->setName(i18n("Date/Time Widget")); wDateTime->setNamePrefix( @@ -259,7 +259,7 @@ KexiDBFactory::KexiDBFactory(QObject *parent, const char *name, const QStringLis /* KexiDataAwareWidgetInfo *wIntSpinBox = new KexiDataAwareWidgetInfo(this, "stdwidgets", "KIntSpinBox"); wIntSpinBox->setPixmap("spin"); wIntSpinBox->setClassName("KexiDBIntSpinBox"); - wIntSpinBox->addAlternateClassName("QSpinBox", true); + wIntSpinBox->addAlternateClassName(TQSPINBOX_OBJECT_NAME_STRING, true); wIntSpinBox->addAlternateClassName("KIntSpinBox", true); wIntSpinBox->setName(i18n("Integer Number Spin Box")); wIntSpinBox->setNamePrefix( @@ -350,14 +350,14 @@ KexiDBFactory::~KexiDBFactory() { } -QWidget* -KexiDBFactory::createWidget(const QCString &c, QWidget *p, const char *n, +TQWidget* +KexiDBFactory::createWidget(const TQCString &c, TQWidget *p, const char *n, KFormDesigner::Container *container, int options) { kexipluginsdbg << "KexiDBFactory::createWidget() " << this << endl; - QWidget *w=0; - QString text( container->form()->library()->textForWidgetName(n, c) ); + TQWidget *w=0; + TQString text( container->form()->library()->textForWidgetName(n, c) ); const bool designMode = options & KFormDesigner::WidgetFactory::DesignViewMode; if(c == "KexiDBSubForm") @@ -366,15 +366,15 @@ KexiDBFactory::createWidget(const QCString &c, QWidget *p, const char *n, { w = new KexiDBLineEdit(p, n); if (designMode) - w->setCursor(QCursor(Qt::ArrowCursor)); + w->setCursor(TQCursor(TQt::ArrowCursor)); } else if(c == "KexiDBTextEdit") { w = new KexiDBTextEdit(p, n); if (designMode) - w->setCursor(QCursor(Qt::ArrowCursor)); + w->setCursor(TQCursor(TQt::ArrowCursor)); } - else if(c == "QFrame" || c == "KexiFrame") + else if(c == TQFRAME_OBJECT_NAME_STRING || c == "KexiFrame") { w = new KexiFrame(p, n); new KFormDesigner::Container(container, w, container); @@ -384,7 +384,7 @@ KexiDBFactory::createWidget(const QCString &c, QWidget *p, const char *n, #ifndef KEXI_NO_IMAGEBOX_WIDGET else if(c == "KexiDBImageBox") { w = new KexiDBImageBox(designMode, p, n); - connect(w, SIGNAL(idChanged(long)), this, SLOT(slotImageBoxIdChanged(long))); + connect(w, TQT_SIGNAL(idChanged(long)), this, TQT_SLOT(slotImageBoxIdChanged(long))); } #endif #ifndef KEXI_NO_AUTOFIELD_WIDGET @@ -396,11 +396,11 @@ KexiDBFactory::createWidget(const QCString &c, QWidget *p, const char *n, else if(c == "KexiDBComboBox") w = new KexiDBComboBox(p, n, designMode); /* else if(c == "KexiDBTimeEdit") - w = new KexiDBTimeEdit(QTime::currentTime(), p, n); + w = new KexiDBTimeEdit(TQTime::currentTime(), p, n); else if(c == "KexiDBDateEdit") - w = new KexiDBDateEdit(QDate::currentDate(), p, n); + w = new KexiDBDateEdit(TQDate::tqcurrentDate(), p, n); else if(c == "KexiDBDateTimeEdit") - w = new KexiDBDateTimeEdit(QDateTime::currentDateTime(), p, n);*/ + w = new KexiDBDateTimeEdit(TQDateTime::tqcurrentDateTime(), p, n);*/ // else if(c == "KexiDBIntSpinBox") // w = new KexiDBIntSpinBox(p, n); // else if(c == "KexiDBDoubleSpinBox") @@ -412,10 +412,10 @@ KexiDBFactory::createWidget(const QCString &c, QWidget *p, const char *n, } bool -KexiDBFactory::createMenuActions(const QCString &classname, QWidget *w, QPopupMenu *menu, +KexiDBFactory::createMenuActions(const TQCString &classname, TQWidget *w, TQPopupMenu *menu, KFormDesigner::Container *) { - if(classname == "QPushButton" || classname == "KPushButton" || classname == "KexiPushButton") + if(classname == TQPUSHBUTTON_OBJECT_NAME_STRING || classname == "KPushButton" || classname == "KexiPushButton") { /*! @todo also call createMenuActions() for inherited factory! */ m_assignAction->plug( menu ); @@ -453,7 +453,7 @@ KexiDBFactory::createCustomActions(KActionCollection* col) } bool -KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner::Container *container) +KexiDBFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container) { m_container = container; if(classname == "KexiDBLineEdit") @@ -462,7 +462,7 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner //! just inherited StdWidgetFactory::clearWidgetContent() should be called KLineEdit *lineedit = static_cast<KLineEdit*>(w); createEditor(classname, lineedit->text(), lineedit, container, - lineedit->geometry(), lineedit->alignment(), true); + lineedit->tqgeometry(), lineedit->tqalignment(), true); return true; } if(classname == "KexiDBTextEdit") @@ -471,7 +471,7 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner //! just inherited StdWidgetFactory::clearWidgetContent() should be called KTextEdit *textedit = static_cast<KTextEdit*>(w); createEditor(classname, textedit->text(), textedit, container, - textedit->geometry(), textedit->alignment(), true, true); + textedit->tqgeometry(), textedit->tqalignment(), true, true); //copy a few properties KTextEdit *ed = dynamic_cast<KTextEdit *>( editor(w) ); ed->setWrapPolicy(textedit->wrapPolicy()); @@ -489,7 +489,7 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner m_widget = w; if(label->textFormat() == RichText) { - QString text = label->text(); + TQString text = label->text(); if ( editRichText( label, text ) ) { changeProperty( "textFormat", "RichText", container->form() ); @@ -497,13 +497,13 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner } if ( classname == "KexiDBLabel" ) - w->resize(w->sizeHint()); + w->resize(w->tqsizeHint()); } else { createEditor(classname, label->text(), label, container, - label->geometry(), label->alignment(), - false, label->alignment() & Qt::WordBreak /*multiline*/); + label->tqgeometry(), label->tqalignment(), + false, label->tqalignment() & TQt::WordBreak /*multiline*/); } return true; } @@ -528,15 +528,15 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner else if(classname == "KexiDBAutoField") { if(static_cast<KexiDBAutoField*>(w)->hasAutoCaption()) return false; // caption is auto, abort editing - QLabel *label = static_cast<KexiDBAutoField*>(w)->label(); - createEditor(classname, label->text(), label, container, label->geometry(), label->alignment()); + TQLabel *label = static_cast<KexiDBAutoField*>(w)->label(); + createEditor(classname, label->text(), label, container, label->tqgeometry(), label->tqalignment()); return true; } else if (classname == "KexiDBCheckBox") { KexiDBCheckBox *cb = static_cast<KexiDBCheckBox*>(w); - QRect r( cb->geometry() ); - r.setLeft( r.left() + 2 + cb->style().subRect( QStyle::SR_CheckBoxIndicator, cb ).width() ); - createEditor(classname, cb->text(), cb, container, r, Qt::AlignAuto); + TQRect r( cb->tqgeometry() ); + r.setLeft( r.left() + 2 + cb->tqstyle().subRect( TQStyle::SR_CheckBoxIndicator, cb ).width() ); + createEditor(classname, cb->text(), cb, container, r, TQt::AlignAuto); return true; } else if(classname == "KexiDBImageBox") { @@ -548,13 +548,13 @@ KexiDBFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner } bool -KexiDBFactory::previewWidget(const QCString &, QWidget *, KFormDesigner::Container *) +KexiDBFactory::previewWidget(const TQCString &, TQWidget *, KFormDesigner::Container *) { return false; } bool -KexiDBFactory::clearWidgetContent(const QCString & /*classname*/, QWidget *w) +KexiDBFactory::clearWidgetContent(const TQCString & /*classname*/, TQWidget *w) { //! @todo this code should not be copied here but //! just inherited StdWidgetFactory::clearWidgetContent() should be called @@ -564,10 +564,10 @@ KexiDBFactory::clearWidgetContent(const QCString & /*classname*/, QWidget *w) return true; } -QValueList<QCString> -KexiDBFactory::autoSaveProperties(const QCString & /*classname*/) +TQValueList<TQCString> +KexiDBFactory::autoSaveProperties(const TQCString & /*classname*/) { - QValueList<QCString> lst; + TQValueList<TQCString> lst; // if(classname == "KexiDBSubForm") //lst << "formName"; // if(classname == "KexiDBLineEdit") @@ -578,8 +578,8 @@ KexiDBFactory::autoSaveProperties(const QCString & /*classname*/) } bool -KexiDBFactory::isPropertyVisibleInternal(const QCString& classname, QWidget *w, - const QCString& property, bool isTopLevel) +KexiDBFactory::isPropertyVisibleInternal(const TQCString& classname, TQWidget *w, + const TQCString& property, bool isTopLevel) { //general if (property=="dataSource" || property=="dataSourceMimeType") { @@ -646,7 +646,7 @@ KexiDBFactory::isPropertyVisibleInternal(const QCString& classname, QWidget *w, } else if(classname == "KexiDBCheckBox") { //hide text property if the widget is a child of an autofield beause there's already "caption" for this purpose - if (property=="text" && w && dynamic_cast<KFormDesigner::WidgetWithSubpropertiesInterface*>(w->parentWidget())) + if (property=="text" && w && dynamic_cast<KFormDesigner::WidgetWithSubpropertiesInterface*>(w->tqparentWidget())) return false; ok = property!="autoRepeat"; } @@ -655,8 +655,8 @@ KexiDBFactory::isPropertyVisibleInternal(const QCString& classname, QWidget *w, } bool -KexiDBFactory::propertySetShouldBeReloadedAfterPropertyChange(const QCString& classname, - QWidget *w, const QCString& property) +KexiDBFactory::propertySetShouldBeReloadedAfterPropertyChange(const TQCString& classname, + TQWidget *w, const TQCString& property) { Q_UNUSED(classname); Q_UNUSED(w); @@ -666,41 +666,41 @@ KexiDBFactory::propertySetShouldBeReloadedAfterPropertyChange(const QCString& cl } bool -KexiDBFactory::changeText(const QString &text) +KexiDBFactory::changeText(const TQString &text) { KFormDesigner::Form *form = m_container ? m_container->form() : 0; if (!form) return false; if (!form->selectedWidget()) return false; - QCString n( form->selectedWidget()->className() ); -// QWidget *w = WidgetFactory::widget(); + TQCString n( form->selectedWidget()->className() ); +// TQWidget *w = WidgetFactory::widget(); if(n == "KexiDBAutoField") { changeProperty("caption", text, form); return true; } - //! \todo check field's geometry + //! \todo check field's tqgeometry return false; } void -KexiDBFactory::resizeEditor(QWidget *editor, QWidget *w, const QCString &classname) +KexiDBFactory::resizeEditor(TQWidget *editor, TQWidget *w, const TQCString &classname) { - //QSize s = widget->size(); - //QPoint p = widget->pos(); + //TQSize s = widget->size(); + //TQPoint p = widget->pos(); if(classname == "KexiDBAutoField") - editor->setGeometry( static_cast<KexiDBAutoField*>(w)->label()->geometry() ); + editor->setGeometry( static_cast<KexiDBAutoField*>(w)->label()->tqgeometry() ); } void KexiDBFactory::slotImageBoxIdChanged(KexiBLOBBuffer::Id_t id) { -//old KexiFormView *formView = KexiUtils::findParent<KexiFormView>((QWidget*)m_widget, "KexiFormView"); +//old KexiFormView *formView = KexiUtils::findParent<KexiFormView>((TQWidget*)m_widget, "KexiFormView"); // (js) heh, porting to KFormDesigner::FormManager::self() singleton took me entire day of work... KFormDesigner::Form *form = KFormDesigner::FormManager::self()->activeForm(); - KexiFormView *formView = form ? KexiUtils::findParent<KexiFormView>((QWidget*)form->widget(), "KexiFormView") : 0; + KexiFormView *formView = form ? KexiUtils::findParent<KexiFormView>((TQWidget*)form->widget(), "KexiFormView") : 0; if (formView) { changeProperty("pixmapId", (uint)/*! @todo unsafe */id, form); //old formView->setUnsavedLocalBLOB(m_widget, id); |