summaryrefslogtreecommitdiffstats
path: root/src/kchmsearchwindow.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 19:00:37 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 19:00:37 +0000
commit25794f504692e5a36c490438814e9dfda8aaa2dd (patch)
tree8061e6d27b5bc9042afdff177872779c4e8c9015 /src/kchmsearchwindow.cpp
parent35ff2a942f63b5201c04f41c3097e61cdd7817e9 (diff)
downloadkchmviewer-25794f504692e5a36c490438814e9dfda8aaa2dd.tar.gz
kchmviewer-25794f504692e5a36c490438814e9dfda8aaa2dd.zip
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
Diffstat (limited to 'src/kchmsearchwindow.cpp')
-rw-r--r--src/kchmsearchwindow.cpp80
1 files changed, 40 insertions, 40 deletions
diff --git a/src/kchmsearchwindow.cpp b/src/kchmsearchwindow.cpp
index 790cc62..7cd8659 100644
--- a/src/kchmsearchwindow.cpp
+++ b/src/kchmsearchwindow.cpp
@@ -31,36 +31,36 @@
#include "kchmsearchwindow.moc"
-KCHMSearchWindow::KCHMSearchWindow( QWidget * parent, const char * name, WFlags f )
- : QWidget (parent, name, f)
+KCHMSearchWindow::KCHMSearchWindow( TQWidget * tqparent, const char * name, WFlags f )
+ : TQWidget (tqparent, name, f)
{
- QVBoxLayout * layout = new QVBoxLayout (this);
- layout->setMargin(6);
- layout->setSpacing(6);
+ TQVBoxLayout * tqlayout = new TQVBoxLayout (this);
+ tqlayout->setMargin(6);
+ tqlayout->setSpacing(6);
// Labels <type words to search> and <help>
- QHBoxLayout * labellayout = new QHBoxLayout();
- labellayout->addWidget( new QLabel( i18n( "Type in word(s) to search for:"), this) );
- labellayout->addStretch( 10 );
+ TQHBoxLayout * labeltqlayout = new TQHBoxLayout();
+ labeltqlayout->addWidget( new TQLabel( i18n( "Type in word(s) to search for:"), this) );
+ labeltqlayout->addStretch( 10 );
KCHMClickableLabel * helplink = new KCHMClickableLabel( i18n( "<a href=\"q\"><b>Help</b></a>"), this );
- connect( helplink, SIGNAL( clicked() ), this, SLOT( onHelpClicked() ) );
- helplink->setCursor( QCursor( Qt::PointingHandCursor ) );
+ connect( helplink, TQT_SIGNAL( clicked() ), this, TQT_SLOT( onHelpClicked() ) );
+ helplink->setCursor( TQCursor( TQt::PointingHandCursor ) );
- labellayout->addWidget ( helplink );
- layout->addLayout( labellayout );
+ labeltqlayout->addWidget ( helplink );
+ tqlayout->addLayout( labeltqlayout );
- m_searchQuery = new QComboBox (TRUE, this);
+ m_searchQuery = new TQComboBox (TRUE, this);
m_searchQuery->setFocus();
m_searchQuery->setMaxCount (10);
- m_searchQuery->setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ m_searchQuery->tqsetSizePolicy ( TQSizePolicy ( TQSizePolicy::Expanding, TQSizePolicy::Fixed ) );
- QPushButton * searchButton = new QPushButton ( i18n("Go"), this);
- searchButton->setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Fixed ) );
+ TQPushButton * searchButton = new TQPushButton ( i18n("Go"), this);
+ searchButton->tqsetSizePolicy ( TQSizePolicy ( TQSizePolicy::Minimum, TQSizePolicy::Fixed ) );
- QHBoxLayout * hlayout = new QHBoxLayout ( layout );
- hlayout->addWidget ( m_searchQuery );
- hlayout->addWidget ( searchButton );
+ TQHBoxLayout * htqlayout = new TQHBoxLayout ( tqlayout );
+ htqlayout->addWidget ( m_searchQuery );
+ htqlayout->addWidget ( searchButton );
m_searchList = new KQListView (this);
m_searchList->addColumn( i18n( "Title" ) );
@@ -68,34 +68,34 @@ KCHMSearchWindow::KCHMSearchWindow( QWidget * parent, const char * name, WFlags
m_searchList->setShowToolTips(true);
connect( searchButton,
- SIGNAL( clicked () ),
+ TQT_SIGNAL( clicked () ),
this,
- SLOT( onReturnPressed() ) );
+ TQT_SLOT( onReturnPressed() ) );
connect( m_searchQuery->lineEdit(),
- SIGNAL( returnPressed() ),
+ TQT_SIGNAL( returnPressed() ),
this,
- SLOT( onReturnPressed() ) );
+ TQT_SLOT( onReturnPressed() ) );
connect( m_searchList,
- 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_searchList,
- 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 ) ) );
- //layout->addSpacing (10);
- layout->addWidget (m_searchList);
+ //tqlayout->addSpacing (10);
+ tqlayout->addWidget (m_searchList);
new KCHMListItemTooltip( m_searchList );
m_contextMenu = 0;
m_searchEngine = 0;
}
-void KCHMSearchWindow::invalidate( )
+void KCHMSearchWindow::tqinvalidate( )
{
m_searchList->clear();
m_searchQuery->clear();
@@ -107,8 +107,8 @@ void KCHMSearchWindow::invalidate( )
void KCHMSearchWindow::onReturnPressed( )
{
- QStringList results;
- QString text = m_searchQuery->lineEdit()->text();
+ TQStringList results;
+ TQString text = m_searchQuery->lineEdit()->text();
if ( text.isEmpty() )
return;
@@ -137,7 +137,7 @@ void KCHMSearchWindow::onReturnPressed( )
}
-void KCHMSearchWindow::onDoubleClicked( QListViewItem *item, const QPoint &, int)
+void KCHMSearchWindow::onDoubleClicked( TQListViewItem *item, const TQPoint &, int)
{
if ( !item )
return;
@@ -165,19 +165,19 @@ void KCHMSearchWindow::onHelpClicked( )
{
if ( appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE )
{
- QMessageBox::information ( this,
+ TQMessageBox::information ( this,
i18n( "How to use search"),
- i18n( "<html><p>The improved search engine allows you to search for a word, symbol or phrase, which is set of words and symbols included in quotes. Only the documents which include all the terms speficide in th search query are shown; no prefixes needed.<p>Unlike MS CHM internal search index, my improved search engine indexes everything, including special symbols. Therefore it is possible to search (and find!) for something like <i>$q = new ChmFile();</i>. This search also fully supports Unicode, which means that you can search in non-English documents.<p>If you want to search for a quote symbol, use quotation mark instead. The engine treats a quote and a quotation mark as the same symbol, which allows to use them in phrases.</html>") );
+ i18n( "<html><p>The improved search engine allows you to search for a word, symbol or phrase, which is set of words and symbols included in quotes. Only the documents which include all the terms speficide in th search query are shown; no prefixes needed.<p>Unlike MS CHM internal search index, my improved search engine indexes everything, including special symbols. Therefore it is possible to search (and tqfind!) for something like <i>$q = new ChmFile();</i>. This search also fully supports Unicode, which means that you can search in non-English documents.<p>If you want to search for a quote symbol, use quotation mark instead. The engine treats a quote and a quotation mark as the same symbol, which allows to use them in phrases.</html>") );
}
else
{
- QMessageBox::information ( this,
+ TQMessageBox::information ( this,
i18n( "How to use search"),
i18n( "The search query can contain a few prefixes.\nA set of words inside the quote marks mean that you are searching for exact phrase.\nA word with minus sign means that it should be absent in the search result.\nA word with plus mark or without any mark means that it must be present in the search result.\n\nNote that only letters and digits are indexed.\nYou cannot search for non-character symbols other than underscope, and those symbols will be removed from the search query.\nFor example, search for 'C' will give the same result as searching for 'C++'.") );
}
}
-void KCHMSearchWindow::slotContextMenuRequested( QListViewItem * item, const QPoint & point, int )
+void KCHMSearchWindow::slotContextMenuRequested( TQListViewItem * item, const TQPoint & point, int )
{
if ( !m_contextMenu )
m_contextMenu = ::mainWindow->currentBrowser()->createListItemContextMenu( this );
@@ -206,14 +206,14 @@ bool KCHMSearchWindow::initSearchEngine( )
}
-void KCHMSearchWindow::execSearchQueryInGui( const QString & query )
+void KCHMSearchWindow::execSearchQueryInGui( const TQString & query )
{
m_searchQuery->lineEdit()->setText( query );
onReturnPressed();
}
-bool KCHMSearchWindow::searchQuery( const QString & query, QStringList * results )
+bool KCHMSearchWindow::searchQuery( const TQString & query, TQStringList * results )
{
if ( appConfig.m_useSearchEngine == KCHMConfig::SEARCH_USE_MINE )
{
@@ -222,7 +222,7 @@ bool KCHMSearchWindow::searchQuery( const QString & query, QStringList * results
}
else if ( !::mainWindow->chmFile()->hasSearchTable() )
{
- QMessageBox::information ( this,
+ TQMessageBox::information ( this,
i18n( "Search is not available" ),
i18n( "<p>The search feature is not avaiable for this chm file."
"<p>The old search engine depends on indexes present in chm files itself. Not every chm file has an index; it is set up"