diff options
Diffstat (limited to 'kexi/plugins/forms/widgets/kexidbautofield.cpp')
-rw-r--r-- | kexi/plugins/forms/widgets/kexidbautofield.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/kexi/plugins/forms/widgets/kexidbautofield.cpp b/kexi/plugins/forms/widgets/kexidbautofield.cpp index be17c159..7ebc522f 100644 --- a/kexi/plugins/forms/widgets/kexidbautofield.cpp +++ b/kexi/plugins/forms/widgets/kexidbautofield.cpp @@ -22,7 +22,7 @@ #include "kexidbautofield.h" #include <tqlabel.h> -#include <layout.h> +#include <tqlayout.h> #include <tqpainter.h> #include <tqmetaobject.h> #include <tqapplication.h> @@ -57,7 +57,7 @@ class KexiDBAutoField::Private //!< of widgetTypeForFieldType() if widgetTypeForFieldType is Auto WidgetType widgetType_property; //!< provides widget type or Auto LabelPosition lblPosition; - TQBoxLayout *layout; + TQBoxLayout *tqlayout; TQLabel *label; TQString caption; KexiDB::Field::Type fieldTypeInternal; @@ -104,7 +104,7 @@ void KexiDBAutoField::init(const TQString &text, WidgetType type, LabelPosition pos) { d->fieldTypeInternal = KexiDB::Field::InvalidType; - d->layout = 0; + d->tqlayout = 0; m_subwidget = 0; d->label = new TQLabel(text, this); d->label->installEventFilter( this ); @@ -116,8 +116,8 @@ KexiDBAutoField::init(const TQString &text, WidgetType type, LabelPosition pos) d->widgetType_property = (type==Auto ? Text : type); //to force "differ" to be true in setWidgetType() setLabelPosition(pos); setWidgetType(type); - d->baseColor = palette().active().base(); - d->textColor = palette().active().text(); + d->baseColor = tqpalette().active().base(); + d->textColor = tqpalette().active().text(); } void @@ -222,30 +222,30 @@ void KexiDBAutoField::setLabelPosition(LabelPosition position) { d->lblPosition = position; - if(d->layout) { - TQBoxLayout *lyr = d->layout; - d->layout = 0; + if(d->tqlayout) { + TQBoxLayout *lyr = d->tqlayout; + d->tqlayout = 0; delete lyr; } if(m_subwidget) m_subwidget->show(); - //! \todo support right-to-left layout where positions are inverted + //! \todo support right-to-left tqlayout where positions are inverted if (position==Top || position==Left) { - int align = d->label->alignment(); + int align = d->label->tqalignment(); if(position == Top) { - d->layout = (TQBoxLayout*) new TQVBoxLayout(this); + d->tqlayout = (TQBoxLayout*) new TQVBoxLayout(this); align |= AlignVertical_Mask; align ^= AlignVertical_Mask; align |= AlignTop; } else { - d->layout = (TQBoxLayout*) new TQHBoxLayout(this); + d->tqlayout = (TQBoxLayout*) new TQHBoxLayout(this); align |= AlignVertical_Mask; align ^= AlignVertical_Mask; align |= AlignVCenter; } - d->label->setAlignment(align); + d->label->tqsetAlignment(align); if(d->widgetType == Boolean || (d->widgetType == Auto && fieldTypeInternal() == KexiDB::Field::InvalidType && !d->designMode)) { @@ -254,36 +254,36 @@ KexiDBAutoField::setLabelPosition(LabelPosition position) else { d->label->show(); } - d->layout->addWidget(d->label, 0, position == Top ? int(TQt::AlignLeft) : 0); + d->tqlayout->addWidget(d->label, 0, position == Top ? int(TQt::AlignLeft) : 0); if(position == Left && d->widgetType != Boolean) - d->layout->addSpacing(KexiDBAutoField_SPACING); - d->layout->addWidget(m_subwidget, 1); + d->tqlayout->addSpacing(KexiDBAutoField_SPACING); + d->tqlayout->addWidget(m_subwidget, 1); KexiSubwidgetInterface *subwidgetInterface = dynamic_cast<KexiSubwidgetInterface*>((TQWidget*)m_subwidget); if (subwidgetInterface) { if (subwidgetInterface->appendStretchRequired(this)) - d->layout->addStretch(0); + d->tqlayout->addStretch(0); if (subwidgetInterface->subwidgetStretchRequired(this)) { - TQSizePolicy sizePolicy( m_subwidget->sizePolicy() ); + TQSizePolicy sizePolicy( m_subwidget->tqsizePolicy() ); if(position == Left) { sizePolicy.setHorData( TQSizePolicy::Minimum ); - d->label->setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred); + d->label->tqsetSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred); } else { sizePolicy.setVerData( TQSizePolicy::Minimum ); - d->label->setSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); + d->label->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); } - m_subwidget->setSizePolicy(sizePolicy); + m_subwidget->tqsetSizePolicy(sizePolicy); } } // if(m_subwidget) - // m_subwidget->setSizePolicy(...); + // m_subwidget->tqsetSizePolicy(...); } else { - d->layout = (TQBoxLayout*) new TQHBoxLayout(this); + d->tqlayout = (TQBoxLayout*) new TQHBoxLayout(this); d->label->hide(); - d->layout->addWidget(m_subwidget); + d->tqlayout->addWidget(m_subwidget); } - //a hack to force layout to be refreshed (any better idea for this?) + //a hack to force tqlayout to be refreshed (any better idea for this?) resize(size()+TQSize(1,0)); resize(size()-TQSize(1,0)); if (dynamic_cast<KexiDBAutoField*>((TQWidget*)m_subwidget)) { @@ -570,7 +570,7 @@ KexiDBAutoField::changeText(const TQString &text, bool beautify) bool unbound = false; if (d->autoCaption && (d->widgetType==Auto || dataSource().isEmpty())) { if (d->designMode) - realText = TQString::fromLatin1(name())+" "+i18n("Unbound Auto Field", "(unbound)"); + realText = TQString::tqfromLatin1(name())+" "+i18n("Unbound Auto Field", "(unbound)"); else realText = TQString(); unbound = true; @@ -584,7 +584,7 @@ KexiDBAutoField::changeText(const TQString &text, bool beautify) realText = text[0].upper() + text.mid(1); if (d->widgetType!=Boolean) { //! @todo ":" suffix looks weird for checkbox; remove this condition when [x] is displayed _after_ label -//! @todo support right-to-left layout where position of ":" is inverted +//! @todo support right-to-left tqlayout where position of ":" is inverted realText += ": "; } } @@ -594,9 +594,9 @@ KexiDBAutoField::changeText(const TQString &text, bool beautify) } if (unbound) - d->label->setAlignment( TQt::AlignCenter | TQt::WordBreak ); + d->label->tqsetAlignment( TQt::AlignCenter | TQt::WordBreak ); else - d->label->setAlignment( TQt::AlignCenter ); + d->label->tqsetAlignment( TQt::AlignCenter ); // TQWidget* widgetToAlterForegroundColor; if(d->widgetType == Boolean) { static_cast<TQCheckBox*>((TQWidget*)m_subwidget)->setText(realText); @@ -650,15 +650,15 @@ KexiDBAutoField::setDataSource( const TQString &ds ) { } TQSize -KexiDBAutoField::sizeHint() const +KexiDBAutoField::tqsizeHint() const { if (d->lblPosition == NoLabel) - return m_subwidget ? m_subwidget->sizeHint() : TQWidget::sizeHint(); + return m_subwidget ? m_subwidget->tqsizeHint() : TQWidget::tqsizeHint(); TQSize s1(0,0); if (m_subwidget) - s1 = m_subwidget->sizeHint(); - TQSize s2(d->label->sizeHint()); + s1 = m_subwidget->tqsizeHint(); + TQSize s2(d->label->tqsizeHint()); if (d->lblPosition == Top) return TQSize(TQMAX(s1.width(), s2.width()), s1.height()+KexiDBAutoField_SPACING+s2.height()); @@ -682,10 +682,10 @@ KexiDBAutoField::updateInformationAboutUnboundField() if ( (d->autoCaption && (dataSource().isEmpty() || dataSourceMimeType().isEmpty())) || (!d->autoCaption && d->caption.isEmpty()) ) { - d->label->setText( TQString::fromLatin1(name())+" "+i18n("Unbound Auto Field", " (unbound)") ); + d->label->setText( TQString::tqfromLatin1(name())+" "+i18n("Unbound Auto Field", " (unbound)") ); } // else -// d->label->setText( TQString::fromLatin1(name())+" "+i18n(" (unbound)") ); +// d->label->setText( TQString::tqfromLatin1(name())+" "+i18n(" (unbound)") ); } /*void @@ -701,7 +701,7 @@ KexiDBAutoField::paintEvent( TQPaintEvent* pe ) p.setClipRect(pe->rect()); p.setFont(d->label->font()); p.drawText(rect(), TQt::AlignLeft | TQt::WordBreak, - TQString::fromLatin1(name())+" "+i18n(" (unbound)")); + TQString::tqfromLatin1(name())+" "+i18n(" (unbound)")); } }*/ |