diff options
author | Slávek Banko <[email protected]> | 2016-03-26 12:35:35 +0100 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2016-03-26 14:10:15 +0100 |
commit | 38dca4b75c471ddf950e2f9f03801c550d7d26fd (patch) | |
tree | f5923ce5d84971f1f394baf7411146f078c02fab /part/kxe_treeviewitem.cpp | |
parent | e28665ce3b2e9ec6f09b4c021db7443cac3c4128 (diff) | |
download | kxmleditor-38dca4b75c471ddf950e2f9f03801c550d7d26fd.tar.gz kxmleditor-38dca4b75c471ddf950e2f9f03801c550d7d26fd.zip |
Initial TQt conversion
Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'part/kxe_treeviewitem.cpp')
-rw-r--r-- | part/kxe_treeviewitem.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/part/kxe_treeviewitem.cpp b/part/kxe_treeviewitem.cpp index 0107bee..c6537b0 100644 --- a/part/kxe_treeviewitem.cpp +++ b/part/kxe_treeviewitem.cpp @@ -23,14 +23,14 @@ #include "qdom_add.h" -#include <qregexp.h> +#include <tqregexp.h> #include <klistview.h> #include <kdebug.h> #include <kiconloader.h> -KXE_TreeViewItem::KXE_TreeViewItem( const QDomNode & xmlNode, QListViewItem * pParent ) - : QListViewItem(pParent), +KXE_TreeViewItem::KXE_TreeViewItem( const TQDomNode & xmlNode, TQListViewItem * pParent ) + : TQListViewItem(pParent), m_xmlNode(xmlNode), m_pPrevSibling(0), m_bBookmarked(false), @@ -41,8 +41,8 @@ KXE_TreeViewItem::KXE_TreeViewItem( const QDomNode & xmlNode, QListViewItem * pP initChilds(); } -KXE_TreeViewItem::KXE_TreeViewItem( const QDomNode & xmlNode, KListView * pParent, QListViewItem* pAfter) - : QListViewItem(pParent,pAfter), +KXE_TreeViewItem::KXE_TreeViewItem( const TQDomNode & xmlNode, KListView * pParent, TQListViewItem* pAfter) + : TQListViewItem(pParent,pAfter), m_xmlNode(xmlNode), m_pPrevSibling(0), m_bBookmarked(false), @@ -53,8 +53,8 @@ KXE_TreeViewItem::KXE_TreeViewItem( const QDomNode & xmlNode, KListView * pParen initChilds(); } -KXE_TreeViewItem::KXE_TreeViewItem( const QDomNode & xmlNode, QListViewItem * pParent, QListViewItem * pAfter ) - : QListViewItem( pParent, pAfter ), +KXE_TreeViewItem::KXE_TreeViewItem( const TQDomNode & xmlNode, TQListViewItem * pParent, TQListViewItem * pAfter ) + : TQListViewItem( pParent, pAfter ), m_xmlNode(xmlNode), m_pPrevSibling(0), m_bBookmarked(false), @@ -98,16 +98,16 @@ void KXE_TreeViewItem::setTexts() { switch ( m_xmlNode.nodeType() ) { - case QDomNode::ElementNode: + case TQDomNode::ElementNode: setText( 0, m_xmlNode.toElement().nodeName() ); if ( KXMLEditorFactory::configuration()->treeview()->elemDisplMode() == KXETreeViewSettings::NoAttributes ) - setText( 1, QString() ); + setText( 1, TQString() ); else { // parse all attributes to fill the second column - QString str2ndCol; + TQString str2ndCol; for ( uint i=0; i < m_xmlNode.toElement().attributes().length(); i++ ) { if ( i > 0 ) @@ -120,15 +120,15 @@ void KXE_TreeViewItem::setTexts() } break; - case QDomNode::TextNode: - case QDomNode::CDATASectionNode: - case QDomNode::CommentNode: + case TQDomNode::TextNode: + case TQDomNode::CDATASectionNode: + case TQDomNode::CommentNode: { // set name - QString strText = m_xmlNode.toCharacterData().data(); - strText = strText.replace( QRegExp("\n"), " " ); // replace every newline by a space - strText = strText.replace( QRegExp("\t"), "" ); // removes every tab - strText = strText.replace( QRegExp("\r"), "" ); // removes every return + TQString strText = m_xmlNode.toCharacterData().data(); + strText = strText.replace( TQRegExp("\n"), " " ); // replace every newline by a space + strText = strText.replace( TQRegExp("\t"), "" ); // removes every tab + strText = strText.replace( TQRegExp("\r"), "" ); // removes every return strText = strText.simplifyWhiteSpace(); if( strText.length() > 30 ) // reduce name length, if necessary strText = strText.left(30) + "..."; @@ -137,7 +137,7 @@ void KXE_TreeViewItem::setTexts() break; } - case QDomNode::ProcessingInstructionNode: + case TQDomNode::ProcessingInstructionNode: setText( 0, m_xmlNode.toProcessingInstruction().target() ); break; @@ -169,12 +169,12 @@ bool KXE_TreeViewItem::toggleBookmark() KXE_TreeViewItem * KXE_TreeViewItem::lastChild() const { // take the first child - QListViewItem * pTmpItem = firstChild(); + TQListViewItem * pTmpItem = firstChild(); // if there are no childs return 0 if ( ! pTmpItem ) return 0; - QListViewItem * pTmpItem2; + TQListViewItem * pTmpItem2; while ( (pTmpItem2 = pTmpItem->nextSibling()) != 0 ) // traversing all childs { pTmpItem = pTmpItem2; @@ -200,7 +200,7 @@ KXE_TreeViewItem * KXE_TreeViewItem::prevItem() KXE_TreeViewItem * KXE_TreeViewItem::nextItem() { // checking for a child - QListViewItem * pTmp = firstChild(); + TQListViewItem * pTmp = firstChild(); if (pTmp) return static_cast <KXE_TreeViewItem*> (pTmp); @@ -210,7 +210,7 @@ KXE_TreeViewItem * KXE_TreeViewItem::nextItem() return static_cast <KXE_TreeViewItem*> (pTmp); // there is no next sibling -> checking for parents' next sibling(s) - QListViewItem * pParent = parent(); + TQListViewItem * pParent = parent(); while (pParent) { pTmp = pParent->nextSibling(); @@ -286,7 +286,7 @@ void KXE_TreeViewItem::ensureChildItemsCreated() { if ( ! m_bChildsCreated ) { - QDomNode tmpNode = m_xmlNode.lastChild(); + TQDomNode tmpNode = m_xmlNode.lastChild(); while ( ! tmpNode.isNull() ) { @@ -326,5 +326,5 @@ void KXE_TreeViewItem::startRename( int iCol ) // we can start renaming in-place. // Remember: This function is only reached for items representing XML elements. if ( (reinterpret_cast<KListView*> ( listView() ))->isRenameable( iCol ) ) - QListViewItem::startRename( iCol ); + TQListViewItem::startRename( iCol ); } |