diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
commit | 48d4a26399959121f33d2bc3bfe51c7827b654fc (patch) | |
tree | 5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /parts/texttools/texttoolswidget.cpp | |
parent | 7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff) | |
download | tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip |
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/texttools/texttoolswidget.cpp')
-rw-r--r-- | parts/texttools/texttoolswidget.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/parts/texttools/texttoolswidget.cpp b/parts/texttools/texttoolswidget.cpp index 630609c5..1f7c9375 100644 --- a/parts/texttools/texttoolswidget.cpp +++ b/parts/texttools/texttoolswidget.cpp @@ -27,14 +27,14 @@ #include "texttoolspart.h" -class TextStructItem : public QListViewItem +class TextStructItem : public TQListViewItem { public: - TextStructItem(TQListView *parent) - : TQListViewItem(parent) + TextStructItem(TQListView *tqparent) + : TQListViewItem(tqparent) {} - TextStructItem(TQListViewItem *parent) - : TQListViewItem(parent) + TextStructItem(TQListViewItem *tqparent) + : TQListViewItem(tqparent) { TQListViewItem *item = this; while (item->nextSibling()) @@ -45,10 +45,10 @@ public: TQString text(int) const { - return extra.isNull()? tag : TQString("%1: %2").arg(tag).arg(extra); + return extra.isNull()? tag : TQString("%1: %2").tqarg(tag).tqarg(extra); } - TextStructItem *parentStructItem() - { return static_cast<TextStructItem*>(parent()); } + TextStructItem *tqparentStructItem() + { return static_cast<TextStructItem*>(tqparent()); } TQString tag; TQString extra; @@ -57,13 +57,13 @@ public: }; -TextToolsWidget::TextToolsWidget(TextToolsPart *part, TQWidget *parent, const char *name) - : KListView(parent, name) +TextToolsWidget::TextToolsWidget(TextToolsPart *part, TQWidget *tqparent, const char *name) + : KListView(tqparent, name) { setResizeMode(TQListView::LastColumn); setSorting(-1); header()->hide(); - addColumn(TQString::null); + addColumn(TQString()); m_part = part; @@ -128,7 +128,7 @@ void TextToolsWidget::slotItemPressed(int button, TQListViewItem *item) cursorIface->setCursorPosition(line, col); } - if (button == MidButton) { + if (button == Qt::MidButton) { KTextEditor::SelectionInterface *selectionIface = dynamic_cast<KTextEditor::SelectionInterface*>(rwpart); if (selectionIface) { @@ -144,7 +144,7 @@ void TextToolsWidget::slotItemPressed(int button, TQListViewItem *item) void TextToolsWidget::slotReturnPressed(TQListViewItem *item) { - slotItemPressed(LeftButton, item); + slotItemPressed(Qt::LeftButton, item); } @@ -165,7 +165,7 @@ void TextToolsWidget::stop() disconnect( m_timer ); m_relevantTags.clear(); m_emptyTags.clear(); - m_cachedText = TQString::null; + m_cachedText = TQString(); } @@ -291,17 +291,17 @@ void TextToolsWidget::parseXML() ++endpos; } - if (!m_relevantTags.contains(tag)) { + if (!m_relevantTags.tqcontains(tag)) { pos = endpos; continue; } TextStructItem *closingItem = currentItem; - while (closingItem->parent() && closingItem->tag != tag) - closingItem = closingItem->parentStructItem(); - if (closingItem->parent()) { + while (closingItem->tqparent() && closingItem->tag != tag) + closingItem = closingItem->tqparentStructItem(); + if (closingItem->tqparent()) { closingItem->endpos = endpos; - currentItem = closingItem->parentStructItem(); + currentItem = closingItem->tqparentStructItem(); } else { kdDebug(9030) << "found no opening tag " << tag << "." << endl; } @@ -327,7 +327,7 @@ void TextToolsWidget::parseXML() ++endpos; } - if (!m_relevantTags.contains(tag)) { + if (!m_relevantTags.tqcontains(tag)) { pos = endpos; continue; } @@ -337,7 +337,7 @@ void TextToolsWidget::parseXML() item->pos = pos; item->endpos = -1; - if (m_emptyTags.contains(tag)) + if (m_emptyTags.tqcontains(tag)) item->endpos = endpos; else currentItem = item; @@ -376,9 +376,9 @@ void TextToolsWidget::parseLaTeX() TQString tag = re.cap(1); TQString title = re.cap(2); kdDebug(9030) << "Match with " << tag << " and title " << title << endl; - int level = hierarchyLevels.find(tag); - while (currentItem->parent() && level <= hierarchyLevels.find(currentItem->tag)) - currentItem = currentItem->parentStructItem(); + int level = hierarchyLevels.tqfind(tag); + while (currentItem->tqparent() && level <= hierarchyLevels.tqfind(currentItem->tag)) + currentItem = currentItem->tqparentStructItem(); TextStructItem *item = new TextStructItem(currentItem); item->tag = tag; @@ -386,7 +386,7 @@ void TextToolsWidget::parseLaTeX() item->pos = pos+1; item->endpos = pos+re.matchedLength()-1; // lie - if (level > hierarchyLevels.find(currentItem->tag)) + if (level > hierarchyLevels.tqfind(currentItem->tag)) currentItem = item; pos = pos+re.matchedLength(); |