From 25794f504692e5a36c490438814e9dfda8aaa2dd Mon Sep 17 00:00:00 2001 From: tpearson Date: Sun, 29 May 2011 19:00:37 +0000 Subject: TQt4 port kchmviewer This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kchmviewer@1234150 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/kchmindexwindow.cpp | 56 ++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'src/kchmindexwindow.cpp') diff --git a/src/kchmindexwindow.cpp b/src/kchmindexwindow.cpp index 6cc2a92..4853f13 100644 --- a/src/kchmindexwindow.cpp +++ b/src/kchmindexwindow.cpp @@ -19,8 +19,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#include -#include +#include +#include #include "libchmfile.h" @@ -31,13 +31,13 @@ #include "kchmindexwindow.moc" -KCHMIndexWindow::KCHMIndexWindow ( QWidget * parent, const char * name, WFlags f ) - : QWidget (parent, name, f) +KCHMIndexWindow::KCHMIndexWindow ( TQWidget * tqparent, const char * name, WFlags f ) + : TQWidget (tqparent, name, f) { - QVBoxLayout * layout = new QVBoxLayout (this); - layout->setMargin (5); + TQVBoxLayout * tqlayout = new TQVBoxLayout (this); + tqlayout->setMargin (5); - m_indexFinder = new QLineEdit (this); + m_indexFinder = new TQLineEdit (this); m_indexFinder->setFocus(); m_indexList = new KQListView (this); @@ -47,29 +47,29 @@ KCHMIndexWindow::KCHMIndexWindow ( QWidget * parent, const char * name, WFlags f m_indexList->setShowToolTips(true); //m_indexList->setSorting( 0, true ); - layout->addWidget (m_indexFinder); - layout->addSpacing (10); - layout->addWidget (m_indexList); + tqlayout->addWidget (m_indexFinder); + tqlayout->addSpacing (10); + tqlayout->addWidget (m_indexList); connect( m_indexFinder, - SIGNAL( textChanged (const QString &) ), + TQT_SIGNAL( textChanged (const TQString &) ), this, - SLOT( onTextChanged(const QString &) ) ); + TQT_SLOT( onTextChanged(const TQString &) ) ); connect( m_indexFinder, - SIGNAL( returnPressed() ), + TQT_SIGNAL( returnPressed() ), this, - SLOT( onReturnPressed() ) ); + TQT_SLOT( onReturnPressed() ) ); connect( m_indexList, - SIGNAL( doubleClicked ( QListViewItem *, const QPoint &, int) ), + TQT_SIGNAL( doubleClicked ( TQListViewItem *, const TQPoint &, int) ), this, - SLOT( onDoubleClicked ( QListViewItem *, const QPoint &, int) ) ); + TQT_SLOT( onDoubleClicked ( TQListViewItem *, const TQPoint &, int) ) ); connect( m_indexList, - SIGNAL( contextMenuRequested( QListViewItem *, const QPoint& , int ) ), + TQT_SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint& , int ) ), this, - SLOT( slotContextMenuRequested ( QListViewItem *, const QPoint &, int ) ) ); + TQT_SLOT( slotContextMenuRequested ( TQListViewItem *, const TQPoint &, int ) ) ); m_indexListFilled = false; m_lastSelectedItem = 0; @@ -78,9 +78,9 @@ KCHMIndexWindow::KCHMIndexWindow ( QWidget * parent, const char * name, WFlags f new KCHMListItemTooltip( m_indexList ); } -void KCHMIndexWindow::onTextChanged ( const QString & newvalue) +void KCHMIndexWindow::onTextChanged ( const TQString & newvalue) { - m_lastSelectedItem = m_indexList->findItem (newvalue, 0, Qt::BeginsWith); + m_lastSelectedItem = m_indexList->tqfindItem (newvalue, 0, TQt::BeginsWith); if ( m_lastSelectedItem ) { @@ -89,7 +89,7 @@ void KCHMIndexWindow::onTextChanged ( const QString & newvalue) } } -void KCHMIndexWindow::showEvent( QShowEvent * ) +void KCHMIndexWindow::showEvent( TQShowEvent * ) { if ( !::mainWindow->chmFile() || m_indexListFilled ) return; @@ -104,27 +104,27 @@ void KCHMIndexWindow::onReturnPressed( ) } -void KCHMIndexWindow::invalidate( ) +void KCHMIndexWindow::tqinvalidate( ) { m_indexList->clear(); m_indexListFilled = false; } -void KCHMIndexWindow::onDoubleClicked( QListViewItem *item, const QPoint &, int ) +void KCHMIndexWindow::onDoubleClicked( TQListViewItem *item, const TQPoint &, int ) { if ( !item ) return; KCHMIndTocItem * treeitem = (KCHMIndTocItem*) item; - QString url = treeitem->getUrl(); + TQString url = treeitem->getUrl(); if ( !url ) return; if ( url[0] == ':' ) // 'see also' link { - m_lastSelectedItem = m_indexList->findItem (url.mid(1), 0); + m_lastSelectedItem = m_indexList->tqfindItem (url.mid(1), 0); if ( m_lastSelectedItem ) { m_indexList->ensureItemVisible (m_lastSelectedItem); @@ -135,7 +135,7 @@ void KCHMIndexWindow::onDoubleClicked( QListViewItem *item, const QPoint &, int ::mainWindow->openPage( url, OPF_CONTENT_TREE | OPF_ADD2HISTORY ); } -void KCHMIndexWindow::slotContextMenuRequested( QListViewItem * item, const QPoint & point, int ) +void KCHMIndexWindow::slotContextMenuRequested( TQListViewItem * item, const TQPoint & point, int ) { if ( !m_contextMenu ) m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this ); @@ -151,7 +151,7 @@ void KCHMIndexWindow::slotContextMenuRequested( QListViewItem * item, const QPoi void KCHMIndexWindow::refillIndex( ) { - QValueVector< LCHMParsedEntry > data; + TQValueVector< LCHMParsedEntry > data; if ( !::mainWindow->chmFile()->parseIndex( &data ) || data.size() == 0 ) @@ -163,7 +163,7 @@ void KCHMIndexWindow::refillIndex( ) kchmFillListViewWithParsedData( m_indexList, data, 0 ); } -void KCHMIndexWindow::search( const QString & index ) +void KCHMIndexWindow::search( const TQString & index ) { if ( !::mainWindow->chmFile() ) return; -- cgit v1.2.1