From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- parts/texttools/texttoolspart.cpp | 12 ++-- parts/texttools/texttoolspart.h | 6 +- parts/texttools/texttoolswidget.cpp | 114 ++++++++++++++++++------------------ parts/texttools/texttoolswidget.h | 16 ++--- 4 files changed, 74 insertions(+), 74 deletions(-) (limited to 'parts/texttools') diff --git a/parts/texttools/texttoolspart.cpp b/parts/texttools/texttoolspart.cpp index 7eb439da..332d97e3 100644 --- a/parts/texttools/texttoolspart.cpp +++ b/parts/texttools/texttoolspart.cpp @@ -11,7 +11,7 @@ #include "texttoolspart.h" -#include +#include #include #include #include @@ -28,7 +28,7 @@ typedef KDevGenericFactory TextToolsFactory; static const KDevPluginInfo data("kdevtexttools"); K_EXPORT_COMPONENT_FACTORY( libkdevtexttools, TextToolsFactory( data ) ) -TextToolsPart::TextToolsPart(QObject *parent, const char *name, const QStringList &) +TextToolsPart::TextToolsPart(TQObject *parent, const char *name, const TQStringList &) : KDevPlugin(&data, parent, name ? name : "TextToolsPart") { setInstance(TextToolsFactory::instance()); @@ -36,8 +36,8 @@ TextToolsPart::TextToolsPart(QObject *parent, const char *name, const QStringLis m_widget = 0; - connect( partController(), SIGNAL(activePartChanged(KParts::Part*)), - this, SLOT(activePartChanged(KParts::Part*)) ); + connect( partController(), TQT_SIGNAL(activePartChanged(KParts::Part*)), + this, TQT_SLOT(activePartChanged(KParts::Part*)) ); } @@ -59,7 +59,7 @@ void TextToolsPart::createWidget() m_widget = new TextToolsWidget(this); m_widget->setCaption(i18n("Text Structure")); - QWhatsThis::add(m_widget, i18n("Text Structure

" + TQWhatsThis::add(m_widget, i18n("Text Structure

" "This browser shows the structure of the text.")); mainWindow()->embedSelectView(m_widget, i18n("Text Structure"), i18n("Text structure")); } @@ -75,7 +75,7 @@ void TextToolsPart::activePartChanged(KParts::Part *part) KParts::ReadWritePart *rwpart = dynamic_cast(part); if (!rwpart) return; - QString url = rwpart->url().url(); + TQString url = rwpart->url().url(); if (url.endsWith(".html")) { kdDebug(9030) << "set mode html" << endl; diff --git a/parts/texttools/texttoolspart.h b/parts/texttools/texttoolspart.h index 7e7bf9c5..ce348f6d 100644 --- a/parts/texttools/texttoolspart.h +++ b/parts/texttools/texttoolspart.h @@ -12,7 +12,7 @@ #ifndef _TEXTTOOLSPART_H_ #define _TEXTTOOLSPART_H_ -#include +#include #include #include "kdevplugin.h" @@ -24,7 +24,7 @@ class TextToolsPart : public KDevPlugin Q_OBJECT public: - TextToolsPart( QObject *parent, const char *name, const QStringList & ); + TextToolsPart( TQObject *parent, const char *name, const TQStringList & ); ~TextToolsPart(); private slots: @@ -33,7 +33,7 @@ private slots: private: void createWidget(); - QGuardedPtr m_widget; + TQGuardedPtr m_widget; }; #endif diff --git a/parts/texttools/texttoolswidget.cpp b/parts/texttools/texttoolswidget.cpp index ff85d0f0..630609c5 100644 --- a/parts/texttools/texttoolswidget.cpp +++ b/parts/texttools/texttoolswidget.cpp @@ -11,9 +11,9 @@ #include "texttoolswidget.h" -#include -#include -#include +#include +#include +#include #include #include #include @@ -30,52 +30,52 @@ class TextStructItem : public QListViewItem { public: - TextStructItem(QListView *parent) - : QListViewItem(parent) + TextStructItem(TQListView *parent) + : TQListViewItem(parent) {} - TextStructItem(QListViewItem *parent) - : QListViewItem(parent) + TextStructItem(TQListViewItem *parent) + : TQListViewItem(parent) { - QListViewItem *item = this; + TQListViewItem *item = this; while (item->nextSibling()) item = item->nextSibling(); if (item != this) moveItem(item); } - QString text(int) const + TQString text(int) const { - return extra.isNull()? tag : QString("%1: %2").arg(tag).arg(extra); + return extra.isNull()? tag : TQString("%1: %2").arg(tag).arg(extra); } TextStructItem *parentStructItem() { return static_cast(parent()); } - QString tag; - QString extra; + TQString tag; + TQString extra; int pos; int endpos; }; -TextToolsWidget::TextToolsWidget(TextToolsPart *part, QWidget *parent, const char *name) +TextToolsWidget::TextToolsWidget(TextToolsPart *part, TQWidget *parent, const char *name) : KListView(parent, name) { - setResizeMode(QListView::LastColumn); + setResizeMode(TQListView::LastColumn); setSorting(-1); header()->hide(); - addColumn(QString::null); + addColumn(TQString::null); m_part = part; - m_timer = new QTimer(this); - connect( this, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int)), - this, SLOT(slotItemPressed(int,QListViewItem*)) ); - // connect( this, SIGNAL(doubleClicked(QListViewItem*)), - // this, SLOT(slotItemPressed(int,QListViewItem*)) ); - connect( this, SIGNAL(returnPressed(QListViewItem*)), - this, SLOT(slotReturnPressed(QListViewItem*)) ); - connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), - this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) ); + m_timer = new TQTimer(this); + connect( this, TQT_SIGNAL(mouseButtonPressed(int, TQListViewItem*, const TQPoint&, int)), + this, TQT_SLOT(slotItemPressed(int,TQListViewItem*)) ); + // connect( this, TQT_SIGNAL(doubleClicked(TQListViewItem*)), + // this, TQT_SLOT(slotItemPressed(int,TQListViewItem*)) ); + connect( this, TQT_SIGNAL(returnPressed(TQListViewItem*)), + this, TQT_SLOT(slotReturnPressed(TQListViewItem*)) ); + connect( this, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), + this, TQT_SLOT(slotContextMenu(KListView*, TQListViewItem*, const TQPoint&)) ); } @@ -83,7 +83,7 @@ TextToolsWidget::~TextToolsWidget() {} -void TextToolsWidget::slotItemPressed(int button, QListViewItem *item) +void TextToolsWidget::slotItemPressed(int button, TQListViewItem *item) { if (!item) return; @@ -107,7 +107,7 @@ void TextToolsWidget::slotItemPressed(int button, QListViewItem *item) } if (pos == searchedEndpos) break; - QChar ch = m_cachedText[pos]; + TQChar ch = m_cachedText[pos]; if (ch == '\n') { ++endline; endcol = 0; @@ -119,7 +119,7 @@ void TextToolsWidget::slotItemPressed(int button, QListViewItem *item) KParts::Part *rwpart = dynamic_cast(m_part->partController()->activePart()); - QWidget *view = m_part->partController()->activeWidget(); + TQWidget *view = m_part->partController()->activeWidget(); KTextEditor::ViewCursorInterface *cursorIface = dynamic_cast(view); @@ -142,13 +142,13 @@ void TextToolsWidget::slotItemPressed(int button, QListViewItem *item) } -void TextToolsWidget::slotReturnPressed(QListViewItem *item) +void TextToolsWidget::slotReturnPressed(TQListViewItem *item) { slotItemPressed(LeftButton, item); } -void TextToolsWidget::slotContextMenu(KListView *, QListViewItem *item, const QPoint &) +void TextToolsWidget::slotContextMenu(KListView *, TQListViewItem *item, const TQPoint &) { if (!item) return; @@ -165,14 +165,14 @@ void TextToolsWidget::stop() disconnect( m_timer ); m_relevantTags.clear(); m_emptyTags.clear(); - m_cachedText = QString::null; + m_cachedText = TQString::null; } void TextToolsWidget::setMode(Mode mode, KParts::Part *part) { - connect( part, SIGNAL(textChanged()), - this, SLOT(startTimer()) ); + connect( part, TQT_SIGNAL(textChanged()), + this, TQT_SLOT(startTimer()) ); m_editIface = dynamic_cast(part); switch (mode) { @@ -181,18 +181,18 @@ void TextToolsWidget::setMode(Mode mode, KParts::Part *part) << "table" << "tr"; m_emptyTags << "br" << "hr" << "img" << "input" << "p" << "meta"; - connect( m_timer, SIGNAL(timeout()), - this, SLOT(parseXML()) ); + connect( m_timer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(parseXML()) ); break; case Docbook: m_relevantTags << "chapter" << "sect1" << "sect2" << "para" << "formalpara"; - connect( m_timer, SIGNAL(timeout()), - this, SLOT(parseXML()) ); + connect( m_timer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(parseXML()) ); break; case LaTeX: - connect( m_timer, SIGNAL(timeout()), - this, SLOT(parseLaTeX()) ); + connect( m_timer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(parseLaTeX()) ); break; default: ; } @@ -212,7 +212,7 @@ void TextToolsWidget::parseXML() { kdDebug(9030) << "Starting to parse XML" << endl; clear(); - QString text = m_editIface->text(); + TQString text = m_editIface->text(); m_cachedText = text; TextStructItem *currentItem = new TextStructItem(this); @@ -222,18 +222,18 @@ void TextToolsWidget::parseXML() int len = text.length(); for (int pos=0; pos+1 < len; ++pos) { - QChar ch1 = text[pos]; - QChar ch2 = text[pos+1]; + TQChar ch1 = text[pos]; + TQChar ch2 = text[pos+1]; if (ch1 == '<' && ch2 == '?') { // PHP and other similar stuff - QString tag; + TQString tag; int endpos = pos+2; bool foundspace = false; while (endpos+1 < len) { - QChar ch3 = text[endpos]; - QChar ch4 = text[endpos+1]; + TQChar ch3 = text[endpos]; + TQChar ch4 = text[endpos+1]; if ((ch3 == ' ' || ch3 == '\t' || ch3 == '\n') && !foundspace) { tag = text.mid(pos+2, endpos-pos-2).lower(); foundspace = true; @@ -255,11 +255,11 @@ void TextToolsWidget::parseXML() } else if (ch1 == '<' && ch2 == '!') { // Processing instructions like !DOCTYPE - QString tag; + TQString tag; int endpos = pos+2; bool foundspace = false; while (endpos+1 < len) { - QChar ch3 = text[endpos]; + TQChar ch3 = text[endpos]; if ((ch3 == ' ' || ch3 == '\t' || ch3 == '\n') && !foundspace) { tag = text.mid(pos+2, endpos-pos-2).lower(); foundspace = true; @@ -280,10 +280,10 @@ void TextToolsWidget::parseXML() } else if (ch1 == '<' && ch2 == '/') { - QString tag; + TQString tag; int endpos = pos+2; while (endpos < len) { - QChar ch3 = text[endpos]; + TQChar ch3 = text[endpos]; if (ch3 == '>') { tag = text.mid(pos+2, endpos-pos-2).lower(); break; @@ -310,11 +310,11 @@ void TextToolsWidget::parseXML() } else if (ch1 == '<') { - QString tag; + TQString tag; int endpos = pos+1; bool foundspace = false; while (endpos < len) { - QChar ch3 = text[endpos]; + TQChar ch3 = text[endpos]; if ((ch3 == ' ' || ch3 == '\t' || ch3 == '\n') && !foundspace) { tag = text.mid(pos+1, endpos-pos-1).lower(); foundspace = true; @@ -347,7 +347,7 @@ void TextToolsWidget::parseXML() } // firstChild()->setOpen(true); - QListViewItemIterator it(this); + TQListViewItemIterator it(this); for (; it.current(); ++it) it.current()->setOpen(true); } @@ -357,7 +357,7 @@ void TextToolsWidget::parseLaTeX() { kdDebug(9030) << "Starting to parse LaTeX" << endl; clear(); - QString text = m_editIface->text(); + TQString text = m_editIface->text(); m_cachedText = text; TextStructItem *currentItem = new TextStructItem(this); @@ -365,16 +365,16 @@ void TextToolsWidget::parseLaTeX() currentItem->pos = -1; currentItem->endpos = -1; - QString hierarchyLevels = "Root,chapter,section,subsection,subsubsection"; - QRegExp re("\n[ \t]*s*\\\\(chapter|section|subsection|subsubsection)\\{([^}]*)\\}"); + TQString hierarchyLevels = "Root,chapter,section,subsection,subsubsection"; + TQRegExp re("\n[ \t]*s*\\\\(chapter|section|subsection|subsubsection)\\{([^}]*)\\}"); int pos=0; for (;;) { pos = re.search(text, pos); if (pos == -1) break; - QString tag = re.cap(1); - QString title = re.cap(2); + 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)) @@ -392,7 +392,7 @@ void TextToolsWidget::parseLaTeX() pos = pos+re.matchedLength(); } - QListViewItemIterator it(this); + TQListViewItemIterator it(this); for (; it.current(); ++it) it.current()->setOpen(true); } diff --git a/parts/texttools/texttoolswidget.h b/parts/texttools/texttoolswidget.h index 680adb34..4db3d2fe 100644 --- a/parts/texttools/texttoolswidget.h +++ b/parts/texttools/texttoolswidget.h @@ -13,7 +13,7 @@ #define _TEXTTOOLSWIDGET_H_ #include -#include +#include class TextToolsPart; class QTimer; @@ -28,16 +28,16 @@ class TextToolsWidget : public KListView public: enum Mode { HTML, Docbook, LaTeX }; - TextToolsWidget( TextToolsPart *part, QWidget *parent=0, const char *name=0 ); + TextToolsWidget( TextToolsPart *part, TQWidget *parent=0, const char *name=0 ); ~TextToolsWidget(); void setMode(Mode mode, KParts::Part *part); void stop(); private slots: - void slotItemPressed(int button, QListViewItem *item); - void slotReturnPressed(QListViewItem *item); - void slotContextMenu(KListView *, QListViewItem *item, const QPoint &p); + void slotItemPressed(int button, TQListViewItem *item); + void slotReturnPressed(TQListViewItem *item); + void slotContextMenu(KListView *, TQListViewItem *item, const TQPoint &p); void startTimer(); void parseXML(); @@ -45,10 +45,10 @@ private slots: private: TextToolsPart *m_part; - QTimer *m_timer; - QString m_cachedText; + TQTimer *m_timer; + TQString m_cachedText; KTextEditor::EditInterface *m_editIface; - QStringList m_relevantTags, m_emptyTags; + TQStringList m_relevantTags, m_emptyTags; }; #endif -- cgit v1.2.3