Exemple #1
0
void GUI::recommendation(const std::vector<std::string>& output)
{

	auto textEdit = getTextEdit("RecommendedOutputText");
	textEdit->clear();
	textEdit->append("Our Recommendation");
	textEdit->append("\n");
	if (output.size() == 0)
	{
		textEdit->append("Sorry no such Restaurants, Kindly try again..");
		return;
	}
	auto itr = output.begin();
	auto itrEnd = output.end();
	while (itr != itrEnd)
	{
		textEdit->append((*itr).c_str());
		//std::string label = itr->first;
		//label = "for " + label;
		//textEdit->append(label.c_str());
		/*textEdit->append("\n");
		auto itrVector = itr->second.begin();
		auto itrVectorEnd = itr->second.end();
		while (itrVector != itrVectorEnd)
		{
			textEdit->append((*itrVector).c_str());
			++itrVector;
		}*/

		++itr;
	}

}
Exemple #2
0
void MainWindow::onAppendText(QString tabRef, QString line)
{
   QPlainTextEdit *w = getTextEdit(tabRef);

   if (w) {
      w->appendPlainText(line);
   }
}
Exemple #3
0
void MainWindow::onClearText(const QString& tabRef)
{
   QPlainTextEdit *w = getTextEdit(tabRef);

   if (w) {
      w->clear();
   }
}
Exemple #4
0
void GUI::Display(const std::vector<std::string>& output)
{
	auto textEdit = getTextEdit("OutputText");
	textEdit->clear();
	textEdit->append("Based On the Search Result following are the restaurants we suggest");
	textEdit->append("\n");
	if (output.size() == 0)
	{
		textEdit->append("Sorry no such Restaurants, Kindly try again..");
		return;
	}
	auto itr = output.begin();
	auto itrEnd = output.end();
	while (itr != itrEnd)
	{
		textEdit->append((*itr).c_str());
		++itr;
	}
	
}