summaryrefslogtreecommitdiffstats
path: root/src/queryview.cpp
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2013-10-08 00:13:25 +0200
committerSlávek Banko <[email protected]>2013-10-08 05:14:53 +0200
commit84f5a315c3429b47a7eff15e626e2efdbe4f6e5e (patch)
tree770861aa9033e1dc6c5168358194ff85b32dd429 /src/queryview.cpp
parent57d8bb3d12aed373eee08915f0ff19f5233aabe3 (diff)
downloadkscope-84f5a315c3429b47a7eff15e626e2efdbe4f6e5e.tar.gz
kscope-84f5a315c3429b47a7eff15e626e2efdbe4f6e5e.zip
Initial TQt conversion
Diffstat (limited to 'src/queryview.cpp')
-rw-r--r--src/queryview.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/src/queryview.cpp b/src/queryview.cpp
index c56a2b0..f791b5d 100644
--- a/src/queryview.cpp
+++ b/src/queryview.cpp
@@ -25,8 +25,8 @@
*
***************************************************************************/
-#include <qapplication.h>
-#include <qclipboard.h>
+#include <ntqapplication.h>
+#include <ntqclipboard.h>
#include <klocale.h>
#include "queryview.h"
#include "queryresultsmenu.h"
@@ -39,8 +39,8 @@
* @param pParent The parent widget
* @param szName The name of the widget
*/
-QueryView::QueryView(QWidget* pParent, const char* szName) :
- QListView(pParent, szName),
+QueryView::QueryView(TQWidget* pParent, const char* szName) :
+ TQListView(pParent, szName),
m_pLastItem(NULL)
{
// Create the popup-menu
@@ -52,34 +52,34 @@ QueryView::QueryView(QWidget* pParent, const char* szName) :
addColumn(i18n("File"));
addColumn(i18n("Line"));
addColumn(i18n("Text"));
- setColumnAlignment(2, Qt::AlignRight);
+ setColumnAlignment(2, TQt::AlignRight);
setShowSortIndicator(true);
// A record is selected if it is either double-clicked, or the ENTER
// key is pressed while the record is highlighted
- connect(this, SIGNAL(doubleClicked(QListViewItem*)), this,
- SLOT(slotRecordSelected(QListViewItem*)));
- connect(this, SIGNAL(returnPressed(QListViewItem*)), this,
- SLOT(slotRecordSelected(QListViewItem*)));
+ connect(this, SIGNAL(doubleClicked(TQListViewItem*)), this,
+ SLOT(slotRecordSelected(TQListViewItem*)));
+ connect(this, SIGNAL(returnPressed(TQListViewItem*)), this,
+ SLOT(slotRecordSelected(TQListViewItem*)));
// Show the popup-menu when requested
connect(this,
- SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)),
- m_pQueryMenu, SLOT(slotShow(QListViewItem*, const QPoint&, int)));
+ SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)),
+ m_pQueryMenu, SLOT(slotShow(TQListViewItem*, const TQPoint&, int)));
// Handle popup-menu commands
- connect(m_pQueryMenu, SIGNAL(viewSource(QListViewItem*)), this,
- SLOT(slotRecordSelected(QListViewItem*)));
- connect(m_pQueryMenu, SIGNAL(findDef(const QString&)), this,
- SLOT(slotFindDef(const QString&)));
- connect(m_pQueryMenu, SIGNAL(copy(QListViewItem*, int)), this,
- SLOT(slotCopy(QListViewItem*, int)));
+ connect(m_pQueryMenu, SIGNAL(viewSource(TQListViewItem*)), this,
+ SLOT(slotRecordSelected(TQListViewItem*)));
+ connect(m_pQueryMenu, SIGNAL(findDef(const TQString&)), this,
+ SLOT(slotFindDef(const TQString&)));
+ connect(m_pQueryMenu, SIGNAL(copy(TQListViewItem*, int)), this,
+ SLOT(slotCopy(TQListViewItem*, int)));
connect(m_pQueryMenu, SIGNAL(filter(int)), this, SLOT(slotFilter(int)));
connect(m_pQueryMenu, SIGNAL(showAll()), this,
SLOT(slotShowAll()));
- connect(m_pQueryMenu, SIGNAL(remove(QListViewItem*)), this,
- SLOT(slotRemoveItem(QListViewItem*)));
+ connect(m_pQueryMenu, SIGNAL(remove(TQListViewItem*)), this,
+ SLOT(slotRemoveItem(TQListViewItem*)));
}
/**
@@ -97,10 +97,10 @@ QueryView::~QueryView()
* @param sText The line's text
* @param pParent The parent item (ignored)
*/
-void QueryView::addRecord(const QString& sFunc, const QString& sFile,
- const QString& sLine, const QString& sText, QListViewItem* /* pParent */)
+void QueryView::addRecord(const TQString& sFunc, const TQString& sFile,
+ const TQString& sLine, const TQString& sText, TQListViewItem* /* pParent */)
{
- QListViewItem* pItem;
+ TQListViewItem* pItem;
pItem = new QueryViewItem(this, m_pLastItem, 2);
pItem->setText(0, sFunc);
@@ -119,7 +119,7 @@ void QueryView::addRecord(const QString& sFunc, const QString& sFile,
* selectNext() for example). It has nothing to do with user selection.
* @param pItem The list item to select
*/
-void QueryView::select(QListViewItem* pItem)
+void QueryView::select(TQListViewItem* pItem)
{
ensureItemVisible(pItem);
setSelected(pItem, true);
@@ -135,7 +135,7 @@ void QueryView::select(QListViewItem* pItem)
*/
void QueryView::selectNext()
{
- QListViewItem* pItem;
+ TQListViewItem* pItem;
// Do nothing if the list is empty
if (firstChild() == NULL)
@@ -165,7 +165,7 @@ void QueryView::selectNext()
*/
void QueryView::selectPrev()
{
- QListViewItem* pItem;
+ TQListViewItem* pItem;
// Do nothing if the list is empty
if (firstChild() == NULL)
@@ -201,7 +201,7 @@ void QueryView::queryProgress()
* Called when a query using this view terminates.
* @param nRecords Number of records generated by the query
*/
-void QueryView::queryFinished(uint nRecords, QListViewItem*)
+void QueryView::queryFinished(uint nRecords, TQListViewItem*)
{
// Auto-select a single record (no need to emit the show() signal in
// that case)
@@ -225,7 +225,7 @@ void QueryView::queryFinished(uint nRecords, QListViewItem*)
*/
QueryView::Iterator QueryView::getIterator()
{
- QListViewItem* pItem;
+ TQListViewItem* pItem;
for (pItem = firstChild(); pItem != NULL && !pItem->isVisible();
pItem = pItem->nextSibling());
@@ -235,14 +235,14 @@ QueryView::Iterator QueryView::getIterator()
/**
* Handles double-click events over the view.
- * NOTE: We override this method since the QListView implementation opens
+ * NOTE: We override this method since the TQListView implementation opens
* expandable items. This is undesired for tree-like query views (such as the
* call tree.
* @param pEvent Event description object
*/
-void QueryView::contentsMouseDoubleClickEvent(QMouseEvent* pEvent)
+void QueryView::contentsMouseDoubleClickEvent(TQMouseEvent* pEvent)
{
- QListViewItem* pItem;
+ TQListViewItem* pItem;
// Handle only left button double-clicks
if (pEvent == NULL || pEvent->button() != LeftButton)
@@ -263,9 +263,9 @@ void QueryView::contentsMouseDoubleClickEvent(QMouseEvent* pEvent)
* signals of the list view.
* @param pItem The selected item
*/
-void QueryView::slotRecordSelected(QListViewItem* pItem)
+void QueryView::slotRecordSelected(TQListViewItem* pItem)
{
- QString sFileName, sLine;
+ TQString sFileName, sLine;
// Get the file name and line number
sFileName = pItem->text(1);
@@ -282,7 +282,7 @@ void QueryView::slotRecordSelected(QListViewItem* pItem)
* This slot is connected to the findDef() signal emitted by the results menu.
* @param sFunc The function to look for
*/
-void QueryView::slotFindDef(const QString& sFunc)
+void QueryView::slotFindDef(const TQString& sFunc)
{
QueryViewDlg* pDlg;
@@ -290,8 +290,8 @@ void QueryView::slotFindDef(const QString& sFunc)
pDlg = new QueryViewDlg(QueryViewDlg::DestroyOnSelect, this);
// Display a line when it is selected in the dialogue
- connect(pDlg, SIGNAL(lineRequested(const QString&, uint)), this,
- SIGNAL(lineRequested(const QString&, uint)));
+ connect(pDlg, SIGNAL(lineRequested(const TQString&, uint)), this,
+ SIGNAL(lineRequested(const TQString&, uint)));
// Start the query
pDlg->query(CscopeFrontend::Definition, sFunc);
@@ -303,10 +303,10 @@ void QueryView::slotFindDef(const QString& sFunc)
* @param pItem The item from which to copy
* @param nCol The index of the item field to copy
*/
-void QueryView::slotCopy(QListViewItem* pItem, int nCol)
+void QueryView::slotCopy(TQListViewItem* pItem, int nCol)
{
- QApplication::clipboard()->setText(pItem->text(nCol),
- QClipboard::Clipboard);
+ TQApplication::clipboard()->setText(pItem->text(nCol),
+ TQClipboard::Clipboard);
}
/**
@@ -320,15 +320,15 @@ void QueryView::slotCopy(QListViewItem* pItem, int nCol)
void QueryView::slotFilter(int nCol)
{
SearchResultsDlg dlg(this);
- QRegExp re;
- QListViewItem* pItem;
+ TQRegExp re;
+ TQListViewItem* pItem;
bool bNegate;
// Prepare the dialogue
dlg.setColumn(nCol);
// Show the dialogue
- if (dlg.exec() != QDialog::Accepted)
+ if (dlg.exec() != TQDialog::Accepted)
return;
// Get the selected regular expression
@@ -362,7 +362,7 @@ void QueryView::slotFilter(int nCol)
*/
void QueryView::slotShowAll()
{
- QListViewItem* pItem;
+ TQListViewItem* pItem;
// Iterate over all items in the list
pItem = firstChild();
@@ -378,7 +378,7 @@ void QueryView::slotShowAll()
* object.
* @param pItem The item to remove
*/
-void QueryView::slotRemoveItem(QListViewItem* pItem)
+void QueryView::slotRemoveItem(TQListViewItem* pItem)
{
delete pItem;
}
@@ -399,7 +399,7 @@ void QueryView::Iterator::next()
/**
* @return The function associated with the list item the iterator points to
*/
-QString QueryView::Iterator::getFunc()
+TQString QueryView::Iterator::getFunc()
{
if (m_pItem == NULL)
return "";
@@ -410,7 +410,7 @@ QString QueryView::Iterator::getFunc()
/**
* @return The file associated with the list item the iterator points to
*/
-QString QueryView::Iterator::getFile()
+TQString QueryView::Iterator::getFile()
{
if (m_pItem == NULL)
return "";
@@ -422,7 +422,7 @@ QString QueryView::Iterator::getFile()
* @return The line number associated with the list item the iterator points
* to
*/
-QString QueryView::Iterator::getLine()
+TQString QueryView::Iterator::getLine()
{
if (m_pItem == NULL)
return "";
@@ -433,7 +433,7 @@ QString QueryView::Iterator::getLine()
/**
* @return The text associated with the list item the iterator points to
*/
-QString QueryView::Iterator::getText()
+TQString QueryView::Iterator::getText()
{
if (m_pItem == NULL)
return "";