diff options
Diffstat (limited to 'quanta/dialogs/tagdialogs/tagxml.cpp')
-rw-r--r-- | quanta/dialogs/tagdialogs/tagxml.cpp | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/quanta/dialogs/tagdialogs/tagxml.cpp b/quanta/dialogs/tagdialogs/tagxml.cpp index c9114d62..5c07b341 100644 --- a/quanta/dialogs/tagdialogs/tagxml.cpp +++ b/quanta/dialogs/tagdialogs/tagxml.cpp @@ -21,22 +21,22 @@ #include <kdebug.h> #include <klocale.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qtooltip.h> -#include <qwhatsthis.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqtooltip.h> +#include <tqwhatsthis.h> #include "styleeditor.h" -Tagxml::Tagxml( QDomNode &d, QTag *dtdTag, QWidget *parent, const char *name) - :QWidget(parent,name), TagWidget(parent,name), doc(d) +Tagxml::Tagxml( TQDomNode &d, QTag *dtdTag, TQWidget *parent, const char *name) + :TQWidget(parent,name), TagWidget(parent,name), doc(d) { initialize(d, dtdTag); } -Tagxml::Tagxml( QDomNode &d, QTag *dtdTag, const QString& selection, QWidget *parent, const char *name) - : QWidget(parent,name), TagWidget(parent,name), doc(d), m_selection(selection) +Tagxml::Tagxml( TQDomNode &d, QTag *dtdTag, const TQString& selection, TQWidget *parent, const char *name) + : TQWidget(parent,name), TagWidget(parent,name), doc(d), m_selection(selection) { initialize(d, dtdTag); } @@ -45,24 +45,24 @@ Tagxml::~Tagxml() { } -void Tagxml::initialize(QDomNode &d, QTag *dtdTag) +void Tagxml::initialize(TQDomNode &d, QTag *dtdTag) { m_dtd = dtdTag->parentDTD; m_dtdTag = dtdTag; - QGridLayout *grid = new QGridLayout( this ); + TQGridLayout *grid = new TQGridLayout( this ); grid->setSpacing( 13 ); grid->setMargin( 11 ); m_firstItem = 0L; //parse the tag XML file, in order to build up the dialog - for ( QDomNode n = d.firstChild(); !n.isNull(); n = n.nextSibling() ) + for ( TQDomNode n = d.firstChild(); !n.isNull(); n = n.nextSibling() ) { - QDomNode location = findChild(n,"location"); + TQDomNode location = findChild(n,"location"); if ( location.isNull() ) continue; //debug( n.nodeName() ); - QDomElement el = location.toElement(); + TQDomElement el = location.toElement(); int row = el.attribute("row","0").toInt(); int col = el.attribute("col","0").toInt(); @@ -78,34 +78,34 @@ void Tagxml::initialize(QDomNode &d, QTag *dtdTag) // qDebug("%s col:%d row:%d cs:%d, rs:%d", n.nodeName().data(), col,row,colspan,rowspan ); - QString tip; - QDomNode tooltip = findChild( n ,"tooltip" ); + TQString tip; + TQDomNode tooltip = findChild( n ,"tooltip" ); if ( !tooltip.isNull() ) { if ( tooltip.firstChild().isText() ) { - QDomText text = tooltip.firstChild().toText(); + TQDomText text = tooltip.firstChild().toText(); tip = text.data(); } } - QString whatsThis; - QDomNode what = findChild( n ,"whatsthis" ); + TQString whatsThis; + TQDomNode what = findChild( n ,"whatsthis" ); if ( !what.isNull() ) { if ( what.firstChild().isText() ) { - QDomText text = what.firstChild().toText(); + TQDomText text = what.firstChild().toText(); whatsThis = text.data(); } } if ( n.nodeName() == "label" ) //a static label { - QLabel *label = new QLabel(this); - QDomElement ltext = findChild(n,"text").toElement(); + TQLabel *label = new TQLabel(this); + TQDomElement ltext = findChild(n,"text").toElement(); if ( !ltext.isNull() ) - label->setText( ltext.text().isEmpty() ? QString("") : (ltext.text()+":") ); + label->setText( ltext.text().isEmpty() ? TQString("") : (ltext.text()+":") ); if ( !tip.isNull() ) - QToolTip::add( label, tip ); + TQToolTip::add( label, tip ); if ( !whatsThis.isNull() ) - QWhatsThis::add( label, whatsThis ); + TQWhatsThis::add( label, whatsThis ); grid->addMultiCellWidget( label, row, row+rowspan, col, col+colspan ); } @@ -113,19 +113,19 @@ void Tagxml::initialize(QDomNode &d, QTag *dtdTag) if ( n.nodeName() == "attr" ) //an attribute { - QDomElement el(n.toElement()); - QString type = el.attribute("type","input"); + TQDomElement el(n.toElement()); + TQString type = el.attribute("type","input"); - QDomElement ltext = findChild(n,"text").toElement(); + TQDomElement ltext = findChild(n,"text").toElement(); if ( !ltext.isNull() && (type != "check") ) //if there is a text label for the attribute { - QLabel *label = new QLabel(this); - label->setText( ltext.text().isEmpty() ? QString("") : (ltext.text()+":") ); + TQLabel *label = new TQLabel(this); + label->setText( ltext.text().isEmpty() ? TQString("") : (ltext.text()+":") ); if ( !tip.isNull() ) - QToolTip::add( label, tip ); + TQToolTip::add( label, tip ); if ( !whatsThis.isNull() ) - QWhatsThis::add( label, whatsThis ); + TQWhatsThis::add( label, whatsThis ); grid->addMultiCellWidget( label, textrow, textrow+textrowspan, textcol, textcol+textcolspan ); } @@ -137,9 +137,9 @@ void Tagxml::initialize(QDomNode &d, QTag *dtdTag) grid->addMultiCellWidget( w, row, row+rowspan, col, col+colspan ); if ( !tip.isNull() ) - QToolTip::add( w, tip ); + TQToolTip::add( w, tip ); if ( !whatsThis.isNull() ) - QWhatsThis::add( w, whatsThis ); + TQWhatsThis::add( w, whatsThis ); Attr_line *attr = new Attr_line(el, w, m_dtdTag); attributes.append(attr); @@ -149,16 +149,16 @@ void Tagxml::initialize(QDomNode &d, QTag *dtdTag) else if ( type == "check" ) { - QCheckBox *w = new QCheckBox(this); + TQCheckBox *w = new TQCheckBox(this); grid->addMultiCellWidget( w, row, row+rowspan, col, col+colspan ); - QDomElement ltext = findChild(n,"text").toElement(); + TQDomElement ltext = findChild(n,"text").toElement(); if ( !ltext.isNull() ) w->setText( ltext.text() ); if ( !tip.isNull() ) - QToolTip::add( w, tip ); + TQToolTip::add( w, tip ); if ( !whatsThis.isNull() ) - QWhatsThis::add( w, whatsThis ); + TQWhatsThis::add( w, whatsThis ); Attr_check *attr = new Attr_check(el, w, m_dtdTag); attributes.append(attr); @@ -167,12 +167,12 @@ void Tagxml::initialize(QDomNode &d, QTag *dtdTag) } else if ( type == "list" ) { - QComboBox *w = new QComboBox(true, this); + TQComboBox *w = new TQComboBox(true, this); grid->addMultiCellWidget( w, row, row+rowspan, col, col+colspan ); if ( !tip.isNull() ) - QToolTip::add( w, tip ); + TQToolTip::add( w, tip ); if ( !whatsThis.isNull() ) - QWhatsThis::add( w, whatsThis ); + TQWhatsThis::add( w, whatsThis ); Attr_list *attr = new Attr_list(el, w, dtdTag); attributes.append(attr); if (!m_firstItem) @@ -184,9 +184,9 @@ void Tagxml::initialize(QDomNode &d, QTag *dtdTag) grid->addMultiCellWidget( w, row, row+rowspan, col, col+colspan ); if ( !tip.isNull() ) - QToolTip::add( w, tip ); + TQToolTip::add( w, tip ); if ( !whatsThis.isNull() ) - QWhatsThis::add( w, whatsThis ); + TQWhatsThis::add( w, whatsThis ); Attr_color *attr = new Attr_color(el, w, m_dtdTag); attributes.append(attr); @@ -199,9 +199,9 @@ void Tagxml::initialize(QDomNode &d, QTag *dtdTag) grid->addMultiCellWidget( w, row, row+rowspan, col, col+colspan ); if ( !tip.isNull() ) - QToolTip::add( w, tip ); + TQToolTip::add( w, tip ); if ( !whatsThis.isNull() ) - QWhatsThis::add( w, whatsThis ); + TQWhatsThis::add( w, whatsThis ); Attr_file *attr = new Attr_file(el, w, m_dtdTag); attributes.append(attr); if (!m_firstItem) @@ -215,9 +215,9 @@ void Tagxml::initialize(QDomNode &d, QTag *dtdTag) grid->addMultiCellWidget( w, row, row+rowspan, col, col+colspan ); if ( !tip.isNull() ) - QToolTip::add( w, tip ); + TQToolTip::add( w, tip ); if ( !whatsThis.isNull() ) - QWhatsThis::add( w, whatsThis ); + TQWhatsThis::add( w, whatsThis ); Attr_line *attr = new Attr_line(el, w->lineEdit(), m_dtdTag); attributes.append(attr); @@ -231,14 +231,14 @@ void Tagxml::initialize(QDomNode &d, QTag *dtdTag) if ( n.nodeName() == "spacer") { - QDomElement el = n.toElement(); + TQDomElement el = n.toElement(); - QSpacerItem* spacer; + TQSpacerItem* spacer; if ( el.attribute("orientation","v") == "v" ) - spacer = new QSpacerItem( 5, 10, QSizePolicy::Fixed, QSizePolicy::Expanding ); + spacer = new TQSpacerItem( 5, 10, TQSizePolicy::Fixed, TQSizePolicy::Expanding ); else - spacer = new QSpacerItem( 10, 5, QSizePolicy::Expanding, QSizePolicy::Fixed ); + spacer = new TQSpacerItem( 10, 5, TQSizePolicy::Expanding, TQSizePolicy::Fixed ); grid->addItem(spacer,row,col); } @@ -251,9 +251,9 @@ void Tagxml::focusToFirstItem() m_firstItem->setFocus(); } -void Tagxml::readAttributes( QDict<QString> *d ) +void Tagxml::readAttributes( TQDict<TQString> *d ) { - QString name,value; + TQString name,value; Attr * attr = attributes.first(); while ( attr ) { @@ -270,10 +270,10 @@ void Tagxml::readAttributes( QDict<QString> *d ) { if (m_dtd->booleanAttributes == "simple") { - d->replace(name, new QString("") ); + d->replace(name, new TQString("") ); } else { - d->replace(name, new QString(m_dtd->booleanTrue)); //it seems that browsers don't like <input disabled="false">, so if a checkbox is false, don't put in the tag at all + d->replace(name, new TQString(m_dtd->booleanTrue)); //it seems that browsers don't like <input disabled="false">, so if a checkbox is false, don't put in the tag at all } } else @@ -283,16 +283,16 @@ void Tagxml::readAttributes( QDict<QString> *d ) /* } else { value = (value == "checked")?m_dtd->booleanTrue:m_dtd->booleanFalse; - d->replace(name, new QString(value)); + d->replace(name, new TQString(value)); } */ } else if (dynamic_cast<Attr_file *>(attr)) { // value = KURL::encode_string(value); - d->replace(name, new QString(value)); + d->replace(name, new TQString(value)); } else { - value.replace(QRegExp("&(?!amp;)"), "&"); - d->replace(name, new QString(value) ); + value.replace(TQRegExp("&(?!amp;)"), "&"); + d->replace(name, new TQString(value) ); } } @@ -302,9 +302,9 @@ void Tagxml::readAttributes( QDict<QString> *d ) } -void Tagxml::writeAttributes( QDict<QString> *d ) +void Tagxml::writeAttributes( TQDict<TQString> *d ) { - QString name,value; + TQString name,value; Attr * attr = attributes.first(); @@ -313,7 +313,7 @@ void Tagxml::writeAttributes( QDict<QString> *d ) name = attr->attrName(); - QString *v = d->find(name); + TQString *v = d->find(name); if ( v ) { v->replace("&","&"); if ( dynamic_cast<Attr_check *>(attr) ) // checkbox |