From 84f5a315c3429b47a7eff15e626e2efdbe4f6e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 8 Oct 2013 00:13:25 +0200 Subject: Initial TQt conversion --- src/searchlist.cpp | 76 +++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'src/searchlist.cpp') diff --git a/src/searchlist.cpp b/src/searchlist.cpp index ccff869..867807d 100644 --- a/src/searchlist.cpp +++ b/src/searchlist.cpp @@ -25,25 +25,25 @@ * ***************************************************************************/ -#include +#include #include "searchlist.h" /** - * Intercepting additional key events of QLineEdit to browse the list + * Intercepting additional key events of TQLineEdit to browse the list * @param pKey The pressed key event */ -void SearchLineEdit::keyPressEvent(QKeyEvent* pKey) +void SearchLineEdit::keyPressEvent(TQKeyEvent* pKey) { switch(pKey->key()) { - case Qt::Key_Up: - case Qt::Key_Down: - case Qt::Key_PageUp: - case Qt::Key_PageDown: + case TQt::Key_Up: + case TQt::Key_Down: + case TQt::Key_PageUp: + case TQt::Key_PageDown: emit keyPressed(pKey); break; default: - QLineEdit::keyPressEvent(pKey); + TQLineEdit::keyPressEvent(pKey); break; } } @@ -53,7 +53,7 @@ void SearchLineEdit::keyPressEvent(QKeyEvent* pKey) * @param pParent Owner list view widget */ ListToolTip::ListToolTip(SearchList* pParent) : - QToolTip(pParent->getList()->viewport()), + TQToolTip(pParent->getList()->viewport()), m_pList(pParent) { } @@ -63,11 +63,11 @@ ListToolTip::ListToolTip(SearchList* pParent) : * pointer. * @param pt The mouse pointer coordinates */ -void ListToolTip::maybeTip(const QPoint& pt) +void ListToolTip::maybeTip(const TQPoint& pt) { - QString str; - QListView* pList; - QListViewItem* pItem; + TQString str; + TQListView* pList; + TQListViewItem* pItem; // Get the item at the given point pList = m_pList->getList(); @@ -80,17 +80,17 @@ void ListToolTip::maybeTip(const QPoint& pt) return; // Get the bounding rectangle of the item - const QRect rcItem = pList->itemRect(pItem); + const TQRect rcItem = pList->itemRect(pItem); if (!rcItem.isValid()) return; // Get the header coordinates - const QRect rcHead = pList->header()->rect(); + const TQRect rcHead = pList->header()->rect(); if (!rcHead.isValid()) return; // Calculate the tool-tip rectangle - QRect rcCell(rcHead.left(), rcItem.top(), rcItem.width(), rcItem.height()); + TQRect rcCell(rcHead.left(), rcItem.top(), rcItem.width(), rcItem.height()); // Display the tool-tip tip(rcCell, str); @@ -102,28 +102,28 @@ void ListToolTip::maybeTip(const QPoint& pt) * @param pParent The parent widget * @param szName The widget's name */ -SearchList::SearchList(int nSearchCol, QWidget* pParent, const char* szName) : - QVBox(pParent, szName), +SearchList::SearchList(int nSearchCol, TQWidget* pParent, const char* szName) : + TQVBox(pParent, szName), m_nSearchCol(nSearchCol) { // Create the child widgets m_pEdit = new SearchLineEdit(this); - m_pList = new QListView(this); + m_pList = new TQListView(this); // Set up the tooltip generator - QToolTip::remove(m_pList); + TQToolTip::remove(m_pList); m_pToolTip = new ListToolTip(this); - connect(m_pEdit, SIGNAL(textChanged(const QString&)), this, - SLOT(slotFindItem(const QString&))); - connect(m_pList, SIGNAL(doubleClicked(QListViewItem*)), this, - SLOT(slotItemSelected(QListViewItem*))); - connect(m_pList, SIGNAL(returnPressed(QListViewItem*)), this, - SLOT(slotItemSelected(QListViewItem*))); + connect(m_pEdit, SIGNAL(textChanged(const TQString&)), this, + SLOT(slotFindItem(const TQString&))); + connect(m_pList, SIGNAL(doubleClicked(TQListViewItem*)), this, + SLOT(slotItemSelected(TQListViewItem*))); + connect(m_pList, SIGNAL(returnPressed(TQListViewItem*)), this, + SLOT(slotItemSelected(TQListViewItem*))); connect(m_pEdit, SIGNAL(returnPressed()), this, SLOT(slotItemSelected())); - connect(m_pEdit, SIGNAL(keyPressed(QKeyEvent*)), this, - SLOT(slotKeyPressed(QKeyEvent*))); + connect(m_pEdit, SIGNAL(keyPressed(TQKeyEvent*)), this, + SLOT(slotKeyPressed(TQKeyEvent*))); } /** @@ -148,9 +148,9 @@ void SearchList::slotSetFocus() * This slot is connected to the textChanged() signal of the line edit widget. * @param sText The new text in the edit widget */ -void SearchList::slotFindItem(const QString& sText) +void SearchList::slotFindItem(const TQString& sText) { - QListViewItem* pItem; + TQListViewItem* pItem; // Try to find an item that contains this text // Priority to exactly matched, @@ -172,7 +172,7 @@ void SearchList::slotFindItem(const QString& sText) * This slot is connected to the doubleClicked() and returnPressed() * signals of the list widget. */ -void SearchList::slotItemSelected(QListViewItem* pItem) +void SearchList::slotItemSelected(TQListViewItem* pItem) { processItemSelected(pItem); m_pEdit->setText(""); @@ -185,7 +185,7 @@ void SearchList::slotItemSelected(QListViewItem* pItem) */ void SearchList::slotItemSelected() { - QListViewItem* pItem; + TQListViewItem* pItem; if ((pItem = m_pList->selectedItem()) != NULL) { m_pEdit->setText(pItem->text(m_nSearchCol)); @@ -203,9 +203,9 @@ void SearchList::slotItemSelected() * This slot is connected to the keyPressed() signal of the edit widget. * @param pKey The key evant passed by the edit box */ -void SearchList::slotKeyPressed(QKeyEvent* pKey) +void SearchList::slotKeyPressed(TQKeyEvent* pKey) { - QListViewItem* pItem, * pNewItem; + TQListViewItem* pItem, * pNewItem; int nPageSize, nPos; // Select the current item, or the first one if there is no current item @@ -213,7 +213,7 @@ void SearchList::slotKeyPressed(QKeyEvent* pKey) // Set a new current item based on the pressed key switch (pKey->key()) { - case Qt::Key_Up: + case TQt::Key_Up: if (pItem) { for (pNewItem = pItem->itemAbove(); pNewItem && !SEARCH_MATCH(pNewItem); @@ -224,7 +224,7 @@ void SearchList::slotKeyPressed(QKeyEvent* pKey) } break; - case Qt::Key_Down: + case TQt::Key_Down: if (pItem) { for (pNewItem = pItem->itemBelow(); pNewItem && !SEARCH_MATCH(pNewItem); @@ -235,7 +235,7 @@ void SearchList::slotKeyPressed(QKeyEvent* pKey) } break; - case Qt::Key_PageUp: + case TQt::Key_PageUp: nPageSize = m_pList->visibleHeight() / pItem->height(); for (nPos = 0; pItem && pItem->itemAbove() && (nPos < nPageSize); @@ -243,7 +243,7 @@ void SearchList::slotKeyPressed(QKeyEvent* pKey) pItem = pItem->itemAbove(); break; - case Qt::Key_PageDown: + case TQt::Key_PageDown: nPageSize = m_pList->visibleHeight() / pItem->height(); for (nPos = 0; pItem && pItem->itemBelow() && (nPos < nPageSize); -- cgit v1.2.1