当前位置: 首页>>代码示例>>C++>>正文


C++ Search::query方法代码示例

本文整理汇总了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());
}
开发者ID:TiBeN,项目名称:museek-plus,代码行数:7,代码来源:searches.cpp

示例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);
	}
}
开发者ID:TiBeN,项目名称:museek-plus,代码行数:25,代码来源:searches.cpp

示例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);
}
开发者ID:TiBeN,项目名称:museek-plus,代码行数:46,代码来源:searches.cpp


注:本文中的Search::query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。