diff options
Diffstat (limited to 'src/gui/fieldwidget.cpp')
-rw-r--r-- | src/gui/fieldwidget.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/gui/fieldwidget.cpp b/src/gui/fieldwidget.cpp index 6a9fc66..0983217 100644 --- a/src/gui/fieldwidget.cpp +++ b/src/gui/fieldwidget.cpp @@ -28,13 +28,13 @@ #include <kurllabel.h> #include <klocale.h> -#include <qlayout.h> -#include <qwhatsthis.h> -#include <qregexp.h> -#include <qlabel.h> -#include <qcheckbox.h> -#include <qstyle.h> -#include <qtimer.h> +#include <tqlayout.h> +#include <tqwhatsthis.h> +#include <tqregexp.h> +#include <tqlabel.h> +#include <tqcheckbox.h> +#include <tqstyle.h> +#include <tqtimer.h> namespace { // if you change this, update numberfieldwidget, too @@ -43,40 +43,40 @@ namespace { using Tellico::GUI::FieldWidget; -const QRegExp FieldWidget::s_semiColon = QRegExp(QString::fromLatin1("\\s*;\\s*")); +const TQRegExp FieldWidget::s_semiColon = TQRegExp(TQString::tqfromLatin1("\\s*;\\s*")); -FieldWidget* FieldWidget::create(Data::FieldPtr field_, QWidget* parent_, const char* name_) { +FieldWidget* FieldWidget::create(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_) { switch (field_->type()) { case Data::Field::Line: - return new GUI::LineFieldWidget(field_, parent_, name_); + return new GUI::LineFieldWidget(field_, tqparent_, name_); case Data::Field::Para: - return new GUI::ParaFieldWidget(field_, parent_, name_); + return new GUI::ParaFieldWidget(field_, tqparent_, name_); case Data::Field::Bool: - return new GUI::BoolFieldWidget(field_, parent_, name_); + return new GUI::BoolFieldWidget(field_, tqparent_, name_); case Data::Field::Number: - return new GUI::NumberFieldWidget(field_, parent_, name_); + return new GUI::NumberFieldWidget(field_, tqparent_, name_); case Data::Field::Choice: - return new GUI::ChoiceFieldWidget(field_, parent_, name_); + return new GUI::ChoiceFieldWidget(field_, tqparent_, name_); case Data::Field::Table: case Data::Field::Table2: - return new GUI::TableFieldWidget(field_, parent_, name_); + return new GUI::TableFieldWidget(field_, tqparent_, name_); case Data::Field::Date: - return new GUI::DateFieldWidget(field_, parent_, name_); + return new GUI::DateFieldWidget(field_, tqparent_, name_); case Data::Field::URL: - return new GUI::URLFieldWidget(field_, parent_, name_); + return new GUI::URLFieldWidget(field_, tqparent_, name_); case Data::Field::Image: - return new GUI::ImageFieldWidget(field_, parent_, name_); + return new GUI::ImageFieldWidget(field_, tqparent_, name_); case Data::Field::Rating: - return new GUI::RatingFieldWidget(field_, parent_, name_); + return new GUI::RatingFieldWidget(field_, tqparent_, name_); case Data::Field::ReadOnly: case Data::Field::Dependent: @@ -89,23 +89,23 @@ FieldWidget* FieldWidget::create(Data::FieldPtr field_, QWidget* parent_, const } } -FieldWidget::FieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* name_/*=0*/) - : QWidget(parent_, name_), m_field(field_) { - QHBoxLayout* l = new QHBoxLayout(this, 2, 2); // parent, margin, spacing +FieldWidget::FieldWidget(Data::FieldPtr field_, TQWidget* tqparent_, const char* name_/*=0*/) + : TQWidget(tqparent_, name_), m_field(field_) { + TQHBoxLayout* l = new TQHBoxLayout(this, 2, 2); // tqparent, margin, spacing l->addSpacing(4); // add some more space in the columns between widgets - if(QCString(style().name()).lower().find("keramik", 0, false) > -1) { + if(TQCString(tqstyle().name()).lower().tqfind("keramik", 0, false) > -1) { l->setMargin(1); } Data::Field::Type type = field_->type(); - QString s = i18n("Edit Label", "%1:").arg(field_->title()); + TQString s = i18n("Edit Label", "%1:").tqarg(field_->title()); if(type == Data::Field::URL) { // set URL to null for now - m_label = new KURLLabel(QString::null, s, this); + m_label = new KURLLabel(TQString(), s, this); } else { - m_label = new QLabel(s, this); + m_label = new TQLabel(s, this); } - m_label->setFixedWidth(m_label->sizeHint().width()); + m_label->setFixedWidth(m_label->tqsizeHint().width()); l->addWidget(m_label); // expands indicates if the edit widget should expand to full width of widget @@ -118,15 +118,15 @@ FieldWidget::FieldWidget(Data::FieldPtr field_, QWidget* parent_, const char* na || type == Data::Field::Image || type == Data::Field::Date); - m_editMultiple = new QCheckBox(this); + m_editMultiple = new TQCheckBox(this); m_editMultiple->setChecked(true); - m_editMultiple->setFixedWidth(m_editMultiple->sizeHint().width()); // don't let it have any extra space - connect(m_editMultiple, SIGNAL(toggled(bool)), SLOT(setEnabled(bool))); + m_editMultiple->setFixedWidth(m_editMultiple->tqsizeHint().width()); // don't let it have any extra space + connect(m_editMultiple, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setEnabled(bool))); l->addWidget(m_editMultiple); - QWhatsThis::add(this, field_->description()); + TQWhatsThis::add(this, field_->description()); // after letting the subclass get created, insert default value - QTimer::singleShot(0, this, SLOT(insertDefault())); + TQTimer::singleShot(0, this, TQT_SLOT(insertDefault())); } void FieldWidget::insertDefault() { @@ -147,7 +147,7 @@ void FieldWidget::setEnabled(bool enabled_) { } int FieldWidget::labelWidth() const { - return m_label->sizeHint().width(); + return m_label->tqsizeHint().width(); } void FieldWidget::setLabelWidth(int width_) { @@ -166,23 +166,23 @@ void FieldWidget::editMultiple(bool show_) { // FIXME: maybe modified should only be signaled when the button is toggle on if(show_) { m_editMultiple->show(); - connect(m_editMultiple, SIGNAL(clicked()), this, SIGNAL(modified())); + connect(m_editMultiple, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(modified())); } else { m_editMultiple->hide(); - disconnect(m_editMultiple, SIGNAL(clicked()), this, SIGNAL(modified())); + disconnect(m_editMultiple, TQT_SIGNAL(clicked()), this, TQT_SIGNAL(modified())); } // the widget length needs to be updated since it gets shorter widget()->updateGeometry(); } void FieldWidget::registerWidget() { - QWidget* w = widget(); + TQWidget* w = widget(); m_label->setBuddy(w); if(w->isFocusEnabled()) { setFocusProxy(w); } - QHBoxLayout* l = static_cast<QHBoxLayout*>(layout()); + TQHBoxLayout* l = static_cast<TQHBoxLayout*>(tqlayout()); l->insertWidget(FIELD_EDIT_WIDGET_INDEX, w, m_expands ? 1 : 0 /*stretch*/); if(!m_expands) { l->insertStretch(FIELD_EDIT_WIDGET_INDEX+1, 1 /*stretch*/); @@ -192,9 +192,9 @@ void FieldWidget::registerWidget() { void FieldWidget::updateField(Data::FieldPtr oldField_, Data::FieldPtr newField_) { m_field = newField_; - m_label->setText(i18n("Edit Label", "%1:").arg(newField_->title())); + m_label->setText(i18n("Edit Label", "%1:").tqarg(newField_->title())); updateGeometry(); - QWhatsThis::add(this, newField_->description()); + TQWhatsThis::add(this, newField_->description()); updateFieldHook(oldField_, newField_); } |