From ffe8a83e053396df448e9413828527613ca3bd46 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:46:43 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdeui/kxmlguibuilder.cpp | 146 +++++++++++++++++++++++------------------------ 1 file changed, 73 insertions(+), 73 deletions(-) (limited to 'kdeui/kxmlguibuilder.cpp') diff --git a/kdeui/kxmlguibuilder.cpp b/kdeui/kxmlguibuilder.cpp index d3a19b77b..305ce135c 100644 --- a/kdeui/kxmlguibuilder.cpp +++ b/kdeui/kxmlguibuilder.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include class KXMLGUIBuilderPrivate { @@ -40,54 +40,54 @@ public: ~KXMLGUIBuilderPrivate() { } - QWidget *m_widget; + TQWidget *m_widget; - QString tagMainWindow; - QString tagMenuBar; - QString tagMenu; - QString tagToolBar; - QString tagStatusBar; + TQString tagMainWindow; + TQString tagMenuBar; + TQString tagMenu; + TQString tagToolBar; + TQString tagStatusBar; - QString tagSeparator; - QString tagTearOffHandle; - QString tagMenuTitle; + TQString tagSeparator; + TQString tagTearOffHandle; + TQString tagMenuTitle; - QString attrName; - QString attrLineSeparator; + TQString attrName; + TQString attrLineSeparator; - QString attrText1; - QString attrText2; - QString attrContext; + TQString attrText1; + TQString attrText2; + TQString attrContext; - QString attrIcon; + TQString attrIcon; KInstance *m_instance; KXMLGUIClient *m_client; }; -KXMLGUIBuilder::KXMLGUIBuilder( QWidget *widget ) +KXMLGUIBuilder::KXMLGUIBuilder( TQWidget *widget ) { d = new KXMLGUIBuilderPrivate; d->m_widget = widget; - d->tagMainWindow = QString::fromLatin1( "mainwindow" ); - d->tagMenuBar = QString::fromLatin1( "menubar" ); - d->tagMenu = QString::fromLatin1( "menu" ); - d->tagToolBar = QString::fromLatin1( "toolbar" ); - d->tagStatusBar = QString::fromLatin1( "statusbar" ); + d->tagMainWindow = TQString::fromLatin1( "mainwindow" ); + d->tagMenuBar = TQString::fromLatin1( "menubar" ); + d->tagMenu = TQString::fromLatin1( "menu" ); + d->tagToolBar = TQString::fromLatin1( "toolbar" ); + d->tagStatusBar = TQString::fromLatin1( "statusbar" ); - d->tagSeparator = QString::fromLatin1( "separator" ); - d->tagTearOffHandle = QString::fromLatin1( "tearoffhandle" ); - d->tagMenuTitle = QString::fromLatin1( "title" ); + d->tagSeparator = TQString::fromLatin1( "separator" ); + d->tagTearOffHandle = TQString::fromLatin1( "tearoffhandle" ); + d->tagMenuTitle = TQString::fromLatin1( "title" ); - d->attrName = QString::fromLatin1( "name" ); - d->attrLineSeparator = QString::fromLatin1( "lineseparator" ); + d->attrName = TQString::fromLatin1( "name" ); + d->attrLineSeparator = TQString::fromLatin1( "lineseparator" ); - d->attrText1 = QString::fromLatin1( "text" ); - d->attrText2 = QString::fromLatin1( "Text" ); - d->attrContext = QString::fromLatin1( "context" ); + d->attrText1 = TQString::fromLatin1( "text" ); + d->attrText2 = TQString::fromLatin1( "Text" ); + d->attrContext = TQString::fromLatin1( "context" ); - d->attrIcon = QString::fromLatin1( "icon" ); + d->attrIcon = TQString::fromLatin1( "icon" ); d->m_instance = 0; d->m_client = 0; @@ -98,20 +98,20 @@ KXMLGUIBuilder::~KXMLGUIBuilder() delete d; } -QWidget *KXMLGUIBuilder::widget() +TQWidget *KXMLGUIBuilder::widget() { return d->m_widget; } -QStringList KXMLGUIBuilder::containerTags() const +TQStringList KXMLGUIBuilder::containerTags() const { - QStringList res; + TQStringList res; res << d->tagMenu << d->tagToolBar << d->tagMainWindow << d->tagMenuBar << d->tagStatusBar; return res; } -QWidget *KXMLGUIBuilder::createContainer( QWidget *parent, int index, const QDomElement &element, int &id ) +TQWidget *KXMLGUIBuilder::createContainer( TQWidget *parent, int index, const TQDomElement &element, int &id ) { id = -1; if ( element.tagName().lower() == d->tagMainWindow ) @@ -144,23 +144,23 @@ QWidget *KXMLGUIBuilder::createContainer( QWidget *parent, int index, const QDom // the popup won't be hidden if it is used as a standalone menu as well. // And we don't want to set the parent for a standalone popupmenu, // otherwise its shortcuts appear. - QWidget* p = parent; + TQWidget* p = parent; while ( p && !::qt_cast( p ) ) p = p->parentWidget(); - QCString name = element.attribute( d->attrName ).utf8(); + TQCString name = element.attribute( d->attrName ).utf8(); if (!kapp->authorizeKAction(name)) return 0; KPopupMenu *popup = new KPopupMenu( p, name); - QString i18nText; - QDomElement textElem = element.namedItem( d->attrText1 ).toElement(); + TQString i18nText; + TQDomElement textElem = element.namedItem( d->attrText1 ).toElement(); if ( textElem.isNull() ) // try with capital T textElem = element.namedItem( d->attrText2 ).toElement(); - QCString text = textElem.text().utf8(); - QCString context = textElem.attribute(d->attrContext).utf8(); + TQCString text = textElem.text().utf8(); + TQCString context = textElem.attribute(d->attrContext).utf8(); if ( text.isEmpty() ) // still no luck i18nText = i18n( "No text!" ); @@ -169,8 +169,8 @@ QWidget *KXMLGUIBuilder::createContainer( QWidget *parent, int index, const QDom else i18nText = i18n( context, text ); - QString icon = element.attribute( d->attrIcon ); - QIconSet pix; + TQString icon = element.attribute( d->attrIcon ); + TQIconSet pix; if ( !icon.isEmpty() ) { @@ -188,12 +188,12 @@ QWidget *KXMLGUIBuilder::createContainer( QWidget *parent, int index, const QDom else id = static_cast(parent)->insertItem( i18nText, popup, -1, index ); } - else if ( parent && ::qt_cast( parent ) ) + else if ( parent && ::qt_cast( parent ) ) { if ( !icon.isEmpty() ) - id = static_cast(parent)->insertItem( pix, i18nText, popup, -1, index ); + id = static_cast(parent)->insertItem( pix, i18nText, popup, -1, index ); else - id = static_cast(parent)->insertItem( i18nText, popup, -1, index ); + id = static_cast(parent)->insertItem( i18nText, popup, -1, index ); } return popup; @@ -203,7 +203,7 @@ QWidget *KXMLGUIBuilder::createContainer( QWidget *parent, int index, const QDom { bool honor = (element.attribute( d->attrName ) == "mainToolBar"); - QCString name = element.attribute( d->attrName ).utf8(); + TQCString name = element.attribute( d->attrName ).utf8(); KToolBar *bar = static_cast(d->m_widget->child( name, "KToolBar" )); if( !bar ) @@ -237,18 +237,18 @@ QWidget *KXMLGUIBuilder::createContainer( QWidget *parent, int index, const QDom return 0L; } -void KXMLGUIBuilder::removeContainer( QWidget *container, QWidget *parent, QDomElement &element, int id ) +void KXMLGUIBuilder::removeContainer( TQWidget *container, TQWidget *parent, TQDomElement &element, int id ) { // Warning parent can be 0L - if ( ::qt_cast( container ) ) + if ( ::qt_cast( container ) ) { if ( parent ) { if ( ::qt_cast( parent ) ) static_cast(parent)->removeItem( id ); - else if ( ::qt_cast( parent ) ) - static_cast(parent)->removeItem( id ); + else if ( ::qt_cast( parent ) ) + static_cast(parent)->removeItem( id ); } delete container; @@ -266,7 +266,7 @@ void KXMLGUIBuilder::removeContainer( QWidget *container, QWidget *parent, QDomE mb->hide(); // Don't delete menubar - it can be reused by createContainer. // If you decide that you do need to delete the menubar, make - // sure that QMainWindow::d->mb does not point to a deleted + // sure that TQMainWindow::d->mb does not point to a deleted // menubar object. } else if ( ::qt_cast( container ) ) @@ -280,21 +280,21 @@ void KXMLGUIBuilder::removeContainer( QWidget *container, QWidget *parent, QDomE kdWarning() << "Unhandled container to remove : " << container->className() << endl; } -QStringList KXMLGUIBuilder::customTags() const +TQStringList KXMLGUIBuilder::customTags() const { - QStringList res; + TQStringList res; res << d->tagSeparator << d->tagTearOffHandle << d->tagMenuTitle; return res; } -int KXMLGUIBuilder::createCustomElement( QWidget *parent, int index, const QDomElement &element ) +int KXMLGUIBuilder::createCustomElement( TQWidget *parent, int index, const TQDomElement &element ) { if ( element.tagName().lower() == d->tagSeparator ) { - if ( ::qt_cast( parent ) ) + if ( ::qt_cast( parent ) ) { // Don't insert multiple separators in a row - QPopupMenu *menu = static_cast(parent); + TQPopupMenu *menu = static_cast(parent); int count = menu->count(); if (count) { @@ -317,22 +317,22 @@ int KXMLGUIBuilder::createCustomElement( QWidget *parent, int index, const QDomE else return menu->insertSeparator( index ); } - else if ( ::qt_cast( parent ) ) - return static_cast(parent)->insertSeparator( index ); + else if ( ::qt_cast( parent ) ) + return static_cast(parent)->insertSeparator( index ); else if ( ::qt_cast( parent ) ) { KToolBar *bar = static_cast( parent ); bool isLineSep = true; - QDomNamedNodeMap attributes = element.attributes(); + TQDomNamedNodeMap attributes = element.attributes(); unsigned int i = 0; for (; i < attributes.length(); i++ ) { - QDomAttr attr = attributes.item( i ).toAttr(); + TQDomAttr attr = attributes.item( i ).toAttr(); if ( attr.name().lower() == d->attrLineSeparator && - attr.value().lower() == QString::fromLatin1("false") ) + attr.value().lower() == TQString::fromLatin1("false") ) { isLineSep = false; break; @@ -351,23 +351,23 @@ int KXMLGUIBuilder::createCustomElement( QWidget *parent, int index, const QDomE } else if ( element.tagName().lower() == d->tagTearOffHandle ) { - if ( ::qt_cast( parent ) && KGlobalSettings::insertTearOffHandle()) - return static_cast(parent)->insertTearOffHandle( -1, index ); + if ( ::qt_cast( parent ) && KGlobalSettings::insertTearOffHandle()) + return static_cast(parent)->insertTearOffHandle( -1, index ); } else if ( element.tagName().lower() == d->tagMenuTitle ) { if ( ::qt_cast( parent ) ) { - QString i18nText; - QCString text = element.text().utf8(); + TQString i18nText; + TQCString text = element.text().utf8(); if ( text.isEmpty() ) i18nText = i18n( "No text!" ); else i18nText = i18n( text ); - QString icon = element.attribute( d->attrIcon ); - QPixmap pix; + TQString icon = element.attribute( d->attrIcon ); + TQPixmap pix; if ( !icon.isEmpty() ) { @@ -387,12 +387,12 @@ int KXMLGUIBuilder::createCustomElement( QWidget *parent, int index, const QDomE return 0; } -void KXMLGUIBuilder::removeCustomElement( QWidget *parent, int id ) +void KXMLGUIBuilder::removeCustomElement( TQWidget *parent, int id ) { - if ( ::qt_cast( parent ) ) - static_cast(parent)->removeItem( id ); - else if ( ::qt_cast( parent ) ) - static_cast(parent)->removeItem( id ); + if ( ::qt_cast( parent ) ) + static_cast(parent)->removeItem( id ); + else if ( ::qt_cast( parent ) ) + static_cast(parent)->removeItem( id ); else if ( ::qt_cast( parent ) ) static_cast(parent)->removeItemDelayed( id ); } -- cgit v1.2.1