diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/formeditor/factories/stdwidgetfactory.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-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/formeditor/factories/stdwidgetfactory.cpp')
-rw-r--r-- | kexi/formeditor/factories/stdwidgetfactory.cpp | 340 |
1 files changed, 170 insertions, 170 deletions
diff --git a/kexi/formeditor/factories/stdwidgetfactory.cpp b/kexi/formeditor/factories/stdwidgetfactory.cpp index fade100a..b625c712 100644 --- a/kexi/formeditor/factories/stdwidgetfactory.cpp +++ b/kexi/formeditor/factories/stdwidgetfactory.cpp @@ -7,19 +7,19 @@ * License, or (at your option) any later version. * ***************************************************************************/ -#include <qlabel.h> -#include <qpopupmenu.h> -#include <qcursor.h> -#include <qradiobutton.h> -#include <qcheckbox.h> -#include <qslider.h> -#include <qobjectlist.h> -#include <qstring.h> -#include <qvariant.h> -#include <qheader.h> -#include <qdom.h> -#include <qstyle.h> -#include <qvaluevector.h> +#include <tqlabel.h> +#include <tqpopupmenu.h> +#include <tqcursor.h> +#include <tqradiobutton.h> +#include <tqcheckbox.h> +#include <tqslider.h> +#include <tqobjectlist.h> +#include <tqstring.h> +#include <tqvariant.h> +#include <tqheader.h> +#include <tqdom.h> +#include <tqstyle.h> +#include <tqvaluevector.h> #include <klineedit.h> #include <kpushbutton.h> @@ -36,10 +36,10 @@ #include <kdeversion.h> #if KDE_VERSION < KDE_MAKE_VERSION(3,1,9) -# include <qdatetimeedit.h> -# define KTimeWidget QTimeEdit -# define KDateWidget QDateEdit -# define KDateTimeWidget QDateTimeEdit +# include <tqdatetimeedit.h> +# define KTimeWidget TQTimeEdit +# define KDateWidget TQDateEdit +# define KDateTimeWidget TQDateTimeEdit #else # include <ktimewidget.h> # include <kdatewidget.h> @@ -57,26 +57,26 @@ #include "stdwidgetfactory.h" // Some widgets subclass to allow event filtering and some other things -KexiPictureLabel::KexiPictureLabel(const QPixmap &pix, QWidget *parent, const char *name) - : QLabel(parent, name) +KexiPictureLabel::KexiPictureLabel(const TQPixmap &pix, TQWidget *tqparent, const char *name) + : TQLabel(tqparent, name) { setPixmap(pix); setScaledContents(false); } bool -KexiPictureLabel::setProperty(const char *name, const QVariant &value) +KexiPictureLabel::setProperty(const char *name, const TQVariant &value) { - if(QString(name) == "pixmap") + if(TQString(name) == "pixmap") resize(value.toPixmap().height(), value.toPixmap().width()); - return QLabel::setProperty(name, value); + return TQLabel::setProperty(name, value); } -Line::Line(Qt::Orientation orient, QWidget *parent, const char *name) - : QFrame(parent, name) +Line::Line(Qt::Orientation orient, TQWidget *tqparent, const char *name) + : TQFrame(tqparent, name) { setFrameShadow(Sunken); - if(orient == Horizontal) + if(orient ==Qt::Horizontal) setFrameShape(HLine); else setFrameShape(VLine); @@ -85,7 +85,7 @@ Line::Line(Qt::Orientation orient, QWidget *parent, const char *name) void Line::setOrientation(Qt::Orientation orient) { - if(orient == Horizontal) + if(orient ==Qt::Horizontal) setFrameShape(HLine); else setFrameShape(VLine); @@ -95,15 +95,15 @@ Qt::Orientation Line::orientation() const { if(frameShape() == HLine) - return Horizontal; + return Qt::Horizontal; else - return Vertical; + return Qt::Vertical; } // The factory itself -StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringList &) - : KFormDesigner::WidgetFactory(parent, "stdwidgets") +StdWidgetFactory::StdWidgetFactory(TQObject *tqparent, const char *, const TQStringList &) + : KFormDesigner::WidgetFactory(tqparent, "stdwidgets") { KFormDesigner::WidgetInfo *wFormWidget = new KFormDesigner::WidgetInfo(this); wFormWidget->setPixmap("form"); @@ -125,7 +125,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wLabel = new KFormDesigner::WidgetInfo(this); wLabel->setPixmap("label"); - wLabel->setClassName("QLabel"); + wLabel->setClassName(TQLABEL_OBJECT_NAME_STRING); wLabel->setName(i18n("Text Label")); wLabel->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "label")); @@ -136,8 +136,8 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL wPixLabel->setPixmap("pixmaplabel"); wPixLabel->setClassName("KexiPictureLabel"); wPixLabel->setName(i18n("Picture Label")); -//! @todo Qt designer compatibility: maybe use this class when QLabel has a pixmap set...? - //wPixLabel->addAlternateClassName("QLabel"); +//! @todo TQt designer compatibility: maybe use this class when TQLabel has a pixmap set...? + //wPixLabel->addAlternateClassName(TQLABEL_OBJECT_NAME_STRING); wPixLabel->setSavingName("KexiPictureLabel"); wPixLabel->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "picture")); @@ -147,7 +147,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wLineEdit = new KFormDesigner::WidgetInfo(this); wLineEdit->setPixmap("lineedit"); wLineEdit->setClassName("KLineEdit"); - wLineEdit->addAlternateClassName("QLineEdit"); + wLineEdit->addAlternateClassName(TQLINEEDIT_OBJECT_NAME_STRING); wLineEdit->setIncludeFileName("klineedit.h"); wLineEdit->setName(i18n("Line Edit")); wLineEdit->setNamePrefix( @@ -167,7 +167,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wPushButton = new KFormDesigner::WidgetInfo(this); wPushButton->setPixmap("button"); wPushButton->setClassName("KPushButton"); - wPushButton->addAlternateClassName("QPushButton"); + wPushButton->addAlternateClassName(TQPUSHBUTTON_OBJECT_NAME_STRING); wPushButton->setIncludeFileName("kpushbutton.h"); wPushButton->setName(i18n("Push Button")); wPushButton->setNamePrefix( @@ -177,7 +177,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wRadioButton = new KFormDesigner::WidgetInfo(this); wRadioButton->setPixmap("radio"); - wRadioButton->setClassName("QRadioButton"); + wRadioButton->setClassName(TQRADIOBUTTON_OBJECT_NAME_STRING); wRadioButton->setName(i18n("Option Button")); wRadioButton->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "optionButton")); @@ -186,7 +186,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wCheckBox = new KFormDesigner::WidgetInfo(this); wCheckBox->setPixmap("check"); - wCheckBox->setClassName("QCheckBox"); + wCheckBox->setClassName(TQCHECKBOX_OBJECT_NAME_STRING); wCheckBox->setName(i18n("Check Box")); wCheckBox->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "checkBox")); @@ -196,7 +196,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wSpinBox = new KFormDesigner::WidgetInfo(this); wSpinBox->setPixmap("spin"); wSpinBox->setClassName("KIntSpinBox"); - wSpinBox->addAlternateClassName("QSpinBox"); + wSpinBox->addAlternateClassName(TQSPINBOX_OBJECT_NAME_STRING); wSpinBox->setIncludeFileName("knuminput.h"); wSpinBox->setName(i18n("Spin Box")); wSpinBox->setNamePrefix( @@ -207,7 +207,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wComboBox = new KFormDesigner::WidgetInfo(this); wComboBox->setPixmap("combo"); wComboBox->setClassName("KComboBox"); - wComboBox->addAlternateClassName("QComboBox"); + wComboBox->addAlternateClassName(TQCOMBOBOX_OBJECT_NAME_STRING); wComboBox->setIncludeFileName("kcombobox.h"); wComboBox->setName(i18n("Combo Box")); wComboBox->setNamePrefix( @@ -218,7 +218,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wListBox = new KFormDesigner::WidgetInfo(this); wListBox->setPixmap("listbox"); wListBox->setClassName("KListBox"); - wListBox->addAlternateClassName("QListBox"); + wListBox->addAlternateClassName(TQLISTBOX_OBJECT_NAME_STRING); wListBox->setIncludeFileName("klistbox.h"); wListBox->setName(i18n("List Box")); wListBox->setNamePrefix( @@ -229,7 +229,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wTextEdit = new KFormDesigner::WidgetInfo(this); wTextEdit->setPixmap("textedit"); wTextEdit->setClassName("KTextEdit"); - wTextEdit->addAlternateClassName("QTextEdit"); + wTextEdit->addAlternateClassName(TQTEXTEDIT_OBJECT_NAME_STRING); wTextEdit->setIncludeFileName("ktextedit.h"); wTextEdit->setName(i18n("Text Editor")); wTextEdit->setNamePrefix( @@ -240,7 +240,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wListView = new KFormDesigner::WidgetInfo(this); wListView->setPixmap("listview"); wListView->setClassName("KListView"); - wListView->addAlternateClassName("QListView"); + wListView->addAlternateClassName(TQLISTVIEW_OBJECT_NAME_STRING); wListView->setIncludeFileName("klistview.h"); wListView->setName(i18n("List View")); wListView->setNamePrefix( @@ -250,7 +250,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wSlider = new KFormDesigner::WidgetInfo(this); wSlider->setPixmap("slider"); - wSlider->setClassName("QSlider"); + wSlider->setClassName(TQSLIDER_OBJECT_NAME_STRING); wSlider->setName(i18n("Slider")); wSlider->setNamePrefix( i18n("Widget name. This string will be used to name widgets of this class. It must _not_ contain white spaces and non latin1 characters.", "slider")); @@ -260,7 +260,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL KFormDesigner::WidgetInfo *wProgressBar = new KFormDesigner::WidgetInfo(this); wProgressBar->setPixmap("progress"); wProgressBar->setClassName("KProgress"); - wProgressBar->addAlternateClassName("QProgressBar"); + wProgressBar->addAlternateClassName(TQPROGRESSBAR_OBJECT_NAME_STRING); wProgressBar->setIncludeFileName("kprogress.h"); wProgressBar->setName(i18n("Progress Bar")); wProgressBar->setNamePrefix( @@ -281,7 +281,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL wDate->setPixmap("dateedit"); wDate->setClassName("KDateWidget"); #if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) - wDate->addAlternateClassName("QDateEdit"); + wDate->addAlternateClassName(TQDATEEDIT_OBJECT_NAME_STRING); wDate->setIncludeFileName("kdatewidget.h"); #endif wDate->setName(i18n("Date Widget")); @@ -294,7 +294,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL wTime->setPixmap("timeedit"); wTime->setClassName("KTimeWidget"); #if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) - wTime->addAlternateClassName("QTimeEdit"); + wTime->addAlternateClassName(TQTIMEEDIT_OBJECT_NAME_STRING); wTime->setIncludeFileName("ktimewidget.h"); #endif wTime->setName(i18n("Time Widget")); @@ -307,7 +307,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL wDateTime->setPixmap("datetimeedit"); wDateTime->setClassName("KDateTimeWidget"); #if KDE_VERSION >= KDE_MAKE_VERSION(3,1,9) - wDateTime->addAlternateClassName("QDateTimeEdit"); + wDateTime->addAlternateClassName(TQDATETIMEEDIT_OBJECT_NAME_STRING); wDateTime->setIncludeFileName("kdatetimewidget.h"); #endif wDateTime->setName(i18n("Date/Time Widget")); @@ -325,7 +325,7 @@ StdWidgetFactory::StdWidgetFactory(QObject *parent, const char *, const QStringL i18n("Echo mode for Line Edit widget eg. Normal, NoEcho, Password","Echo Mode"); m_propDesc["indent"] = i18n("Indent"); //line - m_propDesc["orientation"] = i18n("Orientation"); + m_propDesc["orientation"] = i18n("Qt::Orientation"); //checkbox m_propDesc["checked"] = i18n("Checked checkbox", "Checked"); m_propDesc["tristate"] = i18n("Tristate checkbox", "Tristate"); @@ -377,16 +377,16 @@ StdWidgetFactory::~StdWidgetFactory() { } -QWidget* -StdWidgetFactory::createWidget(const QCString &c, QWidget *p, const char *n, +TQWidget* +StdWidgetFactory::createWidget(const TQCString &c, TQWidget *p, const char *n, KFormDesigner::Container *container, int options) { - 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 == "QLabel") - w = new QLabel(text, p, n); + if(c == TQLABEL_OBJECT_NAME_STRING) + w = new TQLabel(text, p, n); else if(c == "KexiPictureLabel") w = new KexiPictureLabel(DesktopIcon("image"), p, n); @@ -394,16 +394,16 @@ StdWidgetFactory::createWidget(const QCString &c, QWidget *p, const char *n, { w = new KLineEdit(p, n); if (designMode) - w->setCursor(QCursor(Qt::ArrowCursor)); + w->setCursor(TQCursor(TQt::ArrowCursor)); } else if(c == "KPushButton") w = new KPushButton(/*i18n("Button")*/text, p, n); - else if(c == "QRadioButton") - w = new QRadioButton(/*i18n("Radio Button")*/text, p, n); + else if(c == TQRADIOBUTTON_OBJECT_NAME_STRING) + w = new TQRadioButton(/*i18n("Radio Button")*/text, p, n); - else if(c == "QCheckBox") - w = new QCheckBox(/*i18n("Check Box")*/text, p, n); + else if(c == TQCHECKBOX_OBJECT_NAME_STRING) + w = new TQCheckBox(/*i18n("Check Box")*/text, p, n); else if(c == "KIntSpinBox") w = new KIntSpinBox(p, n); @@ -415,7 +415,7 @@ StdWidgetFactory::createWidget(const QCString &c, QWidget *p, const char *n, w = new KListBox(p, n); else if(c == "KTextEdit") - w = new KTextEdit(/*i18n("Enter your text here")*/text, QString::null, p, n); + w = new KTextEdit(/*i18n("Enter your text here")*/text, TQString(), p, n); else if(c == "KListView") { @@ -424,23 +424,23 @@ StdWidgetFactory::createWidget(const QCString &c, QWidget *p, const char *n, ((KListView*)w)->addColumn(i18n("Column 1")); ((KListView*)w)->setRootIsDecorated(true); } - else if(c == "QSlider") - w = new QSlider(Qt::Horizontal, p, n); + else if(c == TQSLIDER_OBJECT_NAME_STRING) + w = new TQSlider(Qt::Horizontal, p, n); else if(c == "KProgress") w = new KProgress(p, n); else if(c == "KDateWidget") - w = new KDateWidget(QDate::currentDate(), p, n); + w = new KDateWidget(TQDate::tqcurrentDate(), p, n); else if(c == "KTimeWidget") - w = new KTimeWidget(QTime::currentTime(), p, n); + w = new KTimeWidget(TQTime::currentTime(), p, n); else if(c == "KDateTimeWidget") - w = new KDateTimeWidget(QDateTime::currentDateTime(), p, n); + w = new KDateTimeWidget(TQDateTime::tqcurrentDateTime(), p, n); else if(c == "Line") - w = new Line(options & WidgetFactory::VerticalOrientation ? Line::Vertical : Line::Horizontal, p, n); + w = new Line(options & WidgetFactory::VerticalOrientation ? Qt::Vertical : Qt::Horizontal, p, n); else if(c == "Spring") { w = new Spring(p, n); @@ -457,7 +457,7 @@ StdWidgetFactory::createWidget(const QCString &c, QWidget *p, const char *n, } bool -StdWidgetFactory::previewWidget(const QCString &classname, QWidget *widget, KFormDesigner::Container *) +StdWidgetFactory::previewWidget(const TQCString &classname, TQWidget *widget, KFormDesigner::Container *) { if(classname == "Spring") { ((Spring*)widget)->setPreviewMode(); @@ -467,17 +467,17 @@ StdWidgetFactory::previewWidget(const QCString &classname, QWidget *widget, KFor } bool -StdWidgetFactory::createMenuActions(const QCString &classname, QWidget *, QPopupMenu *menu, +StdWidgetFactory::createMenuActions(const TQCString &classname, TQWidget *, TQPopupMenu *menu, KFormDesigner::Container *) { - if((classname == "QLabel") || (classname == "KTextEdit")) + if((classname == TQLABEL_OBJECT_NAME_STRING) || (classname == "KTextEdit")) { - menu->insertItem(SmallIconSet("edit"), i18n("Edit Rich Text"), this, SLOT(editText())); + menu->insertItem(SmallIconSet("edit"), i18n("Edit Rich Text"), this, TQT_SLOT(editText())); return true; } else if(classname == "KListView") { - menu->insertItem(SmallIconSet("edit"), i18n("Edit Listview Contents"), this, SLOT(editListContents())); + menu->insertItem(SmallIconSet("edit"), i18n("Edit Listview Contents"), this, TQT_SLOT(editListContents())); return true; } @@ -485,19 +485,19 @@ StdWidgetFactory::createMenuActions(const QCString &classname, QWidget *, QPopup } bool -StdWidgetFactory::startEditing(const QCString &classname, QWidget *w, KFormDesigner::Container *container) +StdWidgetFactory::startEditing(const TQCString &classname, TQWidget *w, KFormDesigner::Container *container) { setWidget(w, container); // m_container = container; if(classname == "KLineEdit") { KLineEdit *lineedit = static_cast<KLineEdit*>(w); - createEditor(classname, lineedit->text(), lineedit, container, lineedit->geometry(), lineedit->alignment(), true); + createEditor(classname, lineedit->text(), lineedit, container, lineedit->tqgeometry(), lineedit->tqalignment(), true); return true; } - else if(classname == "QLabel") + else if(classname == TQLABEL_OBJECT_NAME_STRING) { - QLabel *label = static_cast<QLabel*>(w); + TQLabel *label = static_cast<TQLabel*>(w); if(label->textFormat() == RichText) { //m_widget = w; @@ -505,42 +505,42 @@ StdWidgetFactory::startEditing(const QCString &classname, QWidget *w, KFormDesig editText(); } else - createEditor(classname, label->text(), label, container, label->geometry(), label->alignment()); + createEditor(classname, label->text(), label, container, label->tqgeometry(), label->tqalignment()); return true; } else if(classname == "KPushButton") { KPushButton *push = static_cast<KPushButton*>(w); - QRect r = w->style().subRect(QStyle::SR_PushButtonContents, w); - QRect editorRect = QRect(push->x() + r.x(), push->y() + r.y(), r.width(), r.height()); + TQRect r = w->tqstyle().subRect(TQStyle::SR_PushButtonContents, w); + TQRect editorRect = TQRect(push->x() + r.x(), push->y() + r.y(), r.width(), r.height()); //r.setX(r.x() + 5); //r.setY(r.y() + 5); //r.setWidth(r.width()-10); //r.setHeight(r.height() - 10); - createEditor(classname, push->text(), push, container, editorRect, Qt::AlignCenter, false, false, Qt::PaletteButton); + createEditor(classname, push->text(), push, container, editorRect, TQt::AlignCenter, false, false, TQt::PaletteButton); return true; } - else if(classname == "QRadioButton") + else if(classname == TQRADIOBUTTON_OBJECT_NAME_STRING) { - QRadioButton *radio = static_cast<QRadioButton*>(w); - QRect r = w->style().subRect(QStyle::SR_RadioButtonContents, w); - QRect editorRect = QRect(radio->x() + r.x(), radio->y() + r.y(), r.width(), r.height()); - createEditor(classname, radio->text(), radio, container, editorRect, Qt::AlignAuto); + TQRadioButton *radio = static_cast<TQRadioButton*>(w); + TQRect r = w->tqstyle().subRect(TQStyle::SR_RadioButtonContents, w); + TQRect editorRect = TQRect(radio->x() + r.x(), radio->y() + r.y(), r.width(), r.height()); + createEditor(classname, radio->text(), radio, container, editorRect, TQt::AlignAuto); return true; } - else if(classname == "QCheckBox") + else if(classname == TQCHECKBOX_OBJECT_NAME_STRING) { - QCheckBox *check = static_cast<QCheckBox*>(w); - //QRect r(check->geometry()); + TQCheckBox *check = static_cast<TQCheckBox*>(w); + //TQRect r(check->tqgeometry()); //r.setX(r.x() + 20); - QRect r = w->style().subRect(QStyle::SR_CheckBoxContents, w); - QRect editorRect = QRect(check->x() + r.x(), check->y() + r.y(), r.width(), r.height()); - createEditor(classname, check->text(), check, container, editorRect, Qt::AlignAuto); + TQRect r = w->tqstyle().subRect(TQStyle::SR_CheckBoxContents, w); + TQRect editorRect = TQRect(check->x() + r.x(), check->y() + r.y(), r.width(), r.height()); + createEditor(classname, check->text(), check, container, editorRect, TQt::AlignAuto); return true; } else if((classname == "KComboBox") || (classname == "KListBox")) { - QStringList list; + TQStringList list; if(classname == "KListBox") { KListBox *listbox = (KListBox*)w; @@ -578,7 +578,7 @@ StdWidgetFactory::startEditing(const QCString &classname, QWidget *w, KFormDesig } bool -StdWidgetFactory::clearWidgetContent(const QCString &classname, QWidget *w) +StdWidgetFactory::clearWidgetContent(const TQCString &classname, TQWidget *w) { if(classname == "KLineEdit") ((KLineEdit*)w)->clear(); @@ -596,35 +596,35 @@ StdWidgetFactory::clearWidgetContent(const QCString &classname, QWidget *w) } bool -StdWidgetFactory::changeText(const QString &text) +StdWidgetFactory::changeText(const TQString &text) { - QCString n = WidgetFactory::widget()->className(); - QWidget *w = WidgetFactory::widget(); + TQCString n = WidgetFactory::widget()->className(); + TQWidget *w = WidgetFactory::widget(); if(n == "KIntSpinBox") ((KIntSpinBox*)w)->setValue(text.toInt()); else changeProperty("text", text, m_container->form()); - /* By-hand method not needed as sizeHint() can do that for us - QFontMetrics fm = w->fontMetrics(); - QSize s(fm.width( text ), fm.height()); + /* By-hand method not needed as tqsizeHint() can do that for us + TQFontMetrics fm = w->fontMetrics(); + TQSize s(fm.width( text ), fm.height()); int width; - if(n == "QLabel") // labels are resized to fit the text + if(n == TQLABEL_OBJECT_NAME_STRING) // labels are resized to fit the text { - w->resize(w->sizeHint()); + w->resize(w->tqsizeHint()); WidgetFactory::m_editor->resize(w->size()); return; } // and other widgets are just enlarged if needed else if(n == "KPushButton") - width = w->style().sizeFromContents( QStyle::CT_PushButton, w, s).width(); - else if(n == "QCheckBox") - width = w->style().sizeFromContents( QStyle::CT_CheckBox, w, s).width(); - else if(n == "QRadioButton") - width = w->style().sizeFromContents( QStyle::CT_RadioButton, w, s).width(); + width = w->style().sizeFromContents( TQStyle::CT_PushButton, w, s).width(); + else if(n == TQCHECKBOX_OBJECT_NAME_STRING) + width = w->style().sizeFromContents( TQStyle::CT_CheckBox, w, s).width(); + else if(n == TQRADIOBUTTON_OBJECT_NAME_STRING) + width = w->style().sizeFromContents( TQStyle::CT_RadioButton, w, s).width(); else return; - int width = w->sizeHint().width();*/ + int width = w->tqsizeHint().width();*/ #if 0 //not needed here, size hint is used on creation in InsertWidgetCommand::execute() if(w->width() < width) @@ -637,27 +637,27 @@ StdWidgetFactory::changeText(const QString &text) } void -StdWidgetFactory::resizeEditor(QWidget *editor, QWidget *widget, const QCString &classname) +StdWidgetFactory::resizeEditor(TQWidget *editor, TQWidget *widget, const TQCString &classname) { - QSize s = widget->size(); - QPoint p = widget->pos(); - QRect r; + TQSize s = widget->size(); + TQPoint p = widget->pos(); + TQRect r; - if(classname == "QRadioButton") + if(classname == TQRADIOBUTTON_OBJECT_NAME_STRING) { - r = widget->style().subRect(QStyle::SR_RadioButtonContents, widget); + r = widget->tqstyle().subRect(TQStyle::SR_RadioButtonContents, widget); p += r.topLeft(); s.setWidth(r.width()); } - else if(classname == "QCheckBox") + else if(classname == TQCHECKBOX_OBJECT_NAME_STRING) { - r = widget->style().subRect(QStyle::SR_CheckBoxContents, widget); + r = widget->tqstyle().subRect(TQStyle::SR_CheckBoxContents, widget); p += r.topLeft(); s.setWidth(r.width()); } else if(classname == "KPushButton") { - r = widget->style().subRect(QStyle::SR_PushButtonContents, widget); + r = widget->tqstyle().subRect(TQStyle::SR_PushButtonContents, widget); p += r.topLeft(); s = r.size(); } @@ -667,16 +667,16 @@ StdWidgetFactory::resizeEditor(QWidget *editor, QWidget *widget, const QCString } bool -StdWidgetFactory::saveSpecialProperty(const QCString &classname, const QString &name, const QVariant &, QWidget *w, QDomElement &parentNode, QDomDocument &domDoc) +StdWidgetFactory::saveSpecialProperty(const TQCString &classname, const TQString &name, const TQVariant &, TQWidget *w, TQDomElement &tqparentNode, TQDomDocument &domDoc) { if(name == "list_items" && classname == "KComboBox") { KComboBox *combo = (KComboBox*)w; for(int i=0; i < combo->count(); i++) { - QDomElement item = domDoc.createElement("item"); + TQDomElement item = domDoc.createElement("item"); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", combo->text(i)); - parentNode.appendChild(item); + tqparentNode.appendChild(item); } return true; } @@ -685,9 +685,9 @@ StdWidgetFactory::saveSpecialProperty(const QCString &classname, const QString & KListBox *listbox = (KListBox*)w; for(uint i=0; i < listbox->count(); i++) { - QDomElement item = domDoc.createElement("item"); + TQDomElement item = domDoc.createElement("item"); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", listbox->text(i)); - parentNode.appendChild(item); + tqparentNode.appendChild(item); } return true; } @@ -697,20 +697,20 @@ StdWidgetFactory::saveSpecialProperty(const QCString &classname, const QString & // First we save the columns for(int i = 0; i < listview->columns(); i++) { - QDomElement item = domDoc.createElement("column"); + TQDomElement item = domDoc.createElement("column"); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "text", listview->columnText(i)); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "width", listview->columnWidth(i)); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "resizable", listview->header()->isResizeEnabled(i)); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "clickable", listview->header()->isClickEnabled(i)); KFormDesigner::FormIO::savePropertyElement(item, domDoc, "property", "fullwidth", listview->header()->isStretchEnabled(i)); - parentNode.appendChild(item); + tqparentNode.appendChild(item); } // Then we save the list view items - QListViewItem *item = listview->firstChild(); + TQListViewItem *item = listview->firstChild(); while(item) { - saveListItem(item, parentNode, domDoc); + saveListItem(item, tqparentNode, domDoc); item = item->nextSibling(); } return true; @@ -720,17 +720,17 @@ StdWidgetFactory::saveSpecialProperty(const QCString &classname, const QString & } void -StdWidgetFactory::saveListItem(QListViewItem *item, QDomNode &parentNode, QDomDocument &domDoc) +StdWidgetFactory::saveListItem(TQListViewItem *item, TQDomNode &tqparentNode, TQDomDocument &domDoc) { - QDomElement element = domDoc.createElement("item"); - parentNode.appendChild(element); + TQDomElement element = domDoc.createElement("item"); + tqparentNode.appendChild(element); // We save the text of each column for(int i = 0; i < item->listView()->columns(); i++) KFormDesigner::FormIO::savePropertyElement(element, domDoc, "property", "text", item->text(i)); // Then we save every sub items - QListViewItem *child = item->firstChild(); + TQListViewItem *child = item->firstChild(); while(child) { saveListItem(child, element, domDoc); @@ -739,16 +739,16 @@ StdWidgetFactory::saveListItem(QListViewItem *item, QDomNode &parentNode, QDomDo } bool -StdWidgetFactory::readSpecialProperty(const QCString &classname, QDomElement &node, QWidget *w, KFormDesigner::ObjectTreeItem *) +StdWidgetFactory::readSpecialProperty(const TQCString &classname, TQDomElement &node, TQWidget *w, KFormDesigner::ObjectTreeItem *) { - QString tag = node.tagName(); - QString name = node.attribute("name"); + TQString tag = node.tagName(); + TQString name = node.attribute("name"); if((tag == "item") && (classname == "KComboBox")) { KComboBox *combo = (KComboBox*)w; - QVariant val = KFormDesigner::FormIO::readPropertyValue(node.firstChild().firstChild(), w, name); - if(val.canCast(QVariant::Pixmap)) + TQVariant val = KFormDesigner::FormIO::readPropertyValue(node.firstChild().firstChild(), TQT_TQOBJECT(w), name); + if(val.canCast(TQVariant::Pixmap)) combo->insertItem(val.toPixmap()); else combo->insertItem(val.toString()); @@ -758,8 +758,8 @@ StdWidgetFactory::readSpecialProperty(const QCString &classname, QDomElement &no if((tag == "item") && (classname == "KListBox")) { KListBox *listbox = (KListBox*)w; - QVariant val = KFormDesigner::FormIO::readPropertyValue(node.firstChild().firstChild(), w, name); - if(val.canCast(QVariant::Pixmap)) + TQVariant val = KFormDesigner::FormIO::readPropertyValue(node.firstChild().firstChild(), TQT_TQOBJECT(w), name); + if(val.canCast(TQVariant::Pixmap)) listbox->insertItem(val.toPixmap()); else listbox->insertItem(val.toString()); @@ -770,10 +770,10 @@ StdWidgetFactory::readSpecialProperty(const QCString &classname, QDomElement &no { KListView *listview = (KListView*)w; int id=0; - for(QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { - QString prop = n.toElement().attribute("name"); - QVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), w, name); + TQString prop = n.toElement().attribute("name"); + TQVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), TQT_TQOBJECT(w), name); if(prop == "text") id = listview->addColumn(val.toString()); else if(prop == "width") @@ -798,18 +798,18 @@ StdWidgetFactory::readSpecialProperty(const QCString &classname, QDomElement &no } void -StdWidgetFactory::readListItem(QDomElement &node, QListViewItem *parent, KListView *listview) +StdWidgetFactory::readListItem(TQDomElement &node, TQListViewItem *tqparent, KListView *listview) { - QListViewItem *item; - if(parent) - item = new KListViewItem(parent); + TQListViewItem *item; + if(tqparent) + item = new KListViewItem(tqparent); else item = new KListViewItem(listview); // We need to move the item at the end of the list - QListViewItem *last; - if(parent) - last = parent->firstChild(); + TQListViewItem *last; + if(tqparent) + last = tqparent->firstChild(); else last = listview->firstChild(); @@ -818,11 +818,11 @@ StdWidgetFactory::readListItem(QDomElement &node, QListViewItem *parent, KListVi item->moveItem(last); int i = 0; - for(QDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) + for(TQDomNode n = node.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement childEl = n.toElement(); - QString prop = childEl.attribute("name"); - QString tag = childEl.tagName(); + TQDomElement childEl = n.toElement(); + TQString prop = childEl.attribute("name"); + TQString tag = childEl.tagName(); // We read sub items if(tag == "item") @@ -833,7 +833,7 @@ StdWidgetFactory::readListItem(QDomElement &node, QListViewItem *parent, KListVi // and column texts else if((tag == "property") && (prop == "text")) { - QVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), listview, "item"); + TQVariant val = KFormDesigner::FormIO::readPropertyValue(n.firstChild(), TQT_TQOBJECT(listview), "item"); item->setText(i, val.toString()); i++; } @@ -841,8 +841,8 @@ StdWidgetFactory::readListItem(QDomElement &node, QListViewItem *parent, KListVi } bool -StdWidgetFactory::isPropertyVisibleInternal(const QCString &classname, - QWidget *w, const QCString &property, bool isTopLevel) +StdWidgetFactory::isPropertyVisibleInternal(const TQCString &classname, + TQWidget *w, const TQCString &property, bool isTopLevel) { bool ok = true; if(classname == "FormWidgetBase") @@ -860,10 +860,10 @@ StdWidgetFactory::isPropertyVisibleInternal(const QCString &classname, } else if(classname == "KexiPictureLabel") { - if((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "alignment")) + if((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "tqalignment")) return false; } - else if(classname == "QLabel") + else if(classname == TQLABEL_OBJECT_NAME_STRING) { if(property == "pixmap") return false; @@ -890,11 +890,11 @@ StdWidgetFactory::isPropertyVisibleInternal(const QCString &classname, if((property == "frameShape") || (property == "font") || (property == "margin")) return false; } - else if(classname=="QCheckBox") + else if(classname==TQCHECKBOX_OBJECT_NAME_STRING) { ok = m_showAdvancedProperties || (property != "autoRepeat"); } - else if(classname=="QRadioButton") + else if(classname==TQRADIOBUTTON_OBJECT_NAME_STRING) { ok = m_showAdvancedProperties || (property != "autoRepeat"); } @@ -906,12 +906,12 @@ StdWidgetFactory::isPropertyVisibleInternal(const QCString &classname, return ok && WidgetFactory::isPropertyVisibleInternal(classname, w, property, isTopLevel); } -QValueList<QCString> -StdWidgetFactory::autoSaveProperties(const QCString &classname) +TQValueList<TQCString> +StdWidgetFactory::autoSaveProperties(const TQCString &classname) { - QValueList<QCString> l; + TQValueList<TQCString> l; - if(classname == "QLabel") + if(classname == TQLABEL_OBJECT_NAME_STRING) l << "text"; if(classname == "KPushButton") l << "text"; @@ -942,12 +942,12 @@ StdWidgetFactory::autoSaveProperties(const QCString &classname) void StdWidgetFactory::editText() { - QCString classname = widget()->className(); - QString text; + TQCString classname = widget()->className(); + TQString text; if(classname == "KTextEdit") text = ((KTextEdit*)widget())->text(); - else if(classname == "QLabel") - text = ((QLabel*)widget())->text(); + else if(classname == TQLABEL_OBJECT_NAME_STRING) + text = ((TQLabel*)widget())->text(); if(editRichText(widget(), text)) { @@ -955,24 +955,24 @@ StdWidgetFactory::editText() changeProperty("text", text, m_container->form()); } - if(classname == "QLabel") - widget()->resize(widget()->sizeHint()); + if(classname == TQLABEL_OBJECT_NAME_STRING) + widget()->resize(widget()->tqsizeHint()); } void StdWidgetFactory::editListContents() { - if(widget()->inherits("QListView")) - editListView((QListView*)widget()); + if(widget()->inherits(TQLISTVIEW_OBJECT_NAME_STRING)) + editListView((TQListView*)widget()); } void -StdWidgetFactory::setPropertyOptions( KFormDesigner::WidgetPropertySet& buf, const KFormDesigner::WidgetInfo& info, QWidget *w ) +StdWidgetFactory::setPropertyOptions( KFormDesigner::WidgetPropertySet& buf, const KFormDesigner::WidgetInfo& info, TQWidget *w ) { Q_UNUSED( info ); Q_UNUSED( w ); - if (buf.contains("indent")) { + if (buf.tqcontains("indent")) { buf["indent"].setOption("min", -1); buf["indent"].setOption("minValueText", i18n("default indent value", "default")); } |