本文整理汇总了C++中Search::query方法的典型用法代码示例。如果您正苦于以下问题:C++ Search::query方法的具体用法?C++ Search::query怎么用?C++ Search::query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Search
的用法示例。
在下文中一共展示了Search::query方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tabSelected
void Searches::tabSelected(QWidget* searchwidget) {
if (mSearchTabWidget->currentIndex() <= 1)
return;
Search * uw = dynamic_cast<Search*>(searchwidget);
if (uw)
setSearchText(uw->query());
}
示例2: setToken
void Searches::setToken(const QString& query, uint token) {
int i;
for(i = 2; i < mSearchTabWidget->count(); ++i) {
Search* search = dynamic_cast<Search*>(mSearchTabWidget->widget(i));
if(search && search->query() == QString(query)) {
search->setToken(token);
return;
}
}
// Create the tab if it's a wishlist result
if ((i == mSearchTabWidget->count()) && museeq->isInWishlist(query)) {
Search* s = new Search(query, mSearchTabWidget, false);
mSearchTabWidget->addTab(s, query);
// Highlight the search icon so that the user know that there are some new search results
connect(s, SIGNAL(highlight(int, QWidget*)), SIGNAL(highlight(int)));
// Highlight the tab where we have received new search results
connect(s, SIGNAL(highlight(int, QWidget*)), mSearchTabWidget, SLOT(setHighlight(int, QWidget*)));
mSearchTabWidget->setCurrentWidget(s);
s->setToken(token);
}
}
示例3: doSearch
void Searches::doSearch(const QString& q) {
if(q.isEmpty())
return;
QString user;
if (mUser->isChecked ()) {
if ( mUserEntry->currentText().isEmpty() )
return;
else {
user = mUserEntry->currentText();
}
}
mEntry->setCurrentIndex(0);
int i;
for(i = 2; i < mSearchTabWidget->count(); ++i) {
Search* search = dynamic_cast<Search*>(mSearchTabWidget->widget(i));
if(search && search->query() == q) {
mSearchTabWidget->setCurrentIndex(i);
break;
}
}
if(i == mSearchTabWidget->count()) {
Search* s = new Search(q, mSearchTabWidget, false);
mSearchTabWidget->addTab(s, q);
// Highlight the search icon so that the user know that there are some new search results
connect(s, SIGNAL(highlight(int, QWidget*)), SIGNAL(highlight(int)));
// Highlight the tab where we have received new search results
connect(s, SIGNAL(highlight(int, QWidget*)), mSearchTabWidget, SLOT(setHighlight(int, QWidget*)));
mSearchTabWidget->setCurrentWidget(s);
}
if(mBuddies->isChecked())
museeq->buddySearch(q);
else if (mRooms->isChecked ())
museeq->roomSearch (q);
else if (mGlobal->isChecked ())
museeq->search(q);
else if (mUser->isChecked ()) {
if ( ! user.isEmpty() )
museeq->userSearch(user, q);
} else if (mWishList->isChecked ())
museeq->wishListSearch(q);
}