*/
void CarMainWindow::setCategoryCompoBox()
{
- ui->comboBoxTopCategory->addItems(xmlreader->getTop10List());
+ ui->comboBoxTopCategory->addItems(xmlreader->getCategoryList());
}
/**
*This function is used to set items to labelTopList. Top-tab view.
*@param QString category
*/
-void CarMainWindow::setListViewTopList(QString category)
+void CarMainWindow::setListViewTopList(QString category, int size)
{
QString topList;
-
- if (category == "acceleration-0-100")
- {
- topList.append(xmlreader->getTop10AccelerationList());
- }
-
- else if (category == "Speed")
- {
- topList.append(xmlreader->getTop10SpeedList());
- }
-
- else if (category == "G-force")
- {
- topList.append(xmlreader->getTop10GforceList());
- }
+ topList.append( xmlreader->getTopList(category, size));
ui->labelTopList->setText(topList);
}
QString limit = QString::number(limitNr);
category = "acceleration-0-100"; //replace with real value from category list/top window
requestTopList(category, limit);
- setListViewTopList(category);
+ setListViewTopList(category,10);
}
/**
*/
void CarMainWindow::on_comboBoxTopCategory_activated(QString category)
{
- setListViewTopList(category);
+ setListViewTopList(category,10);
}
/**
void setComboBoxStartTabUnits(QStringList units); //Start-tab view
void setListViewStartTabAccelerationCategories(QStringList numbers); //Start-tab view
- void setListViewTopList(QString category); //Top-tab view
+ void setListViewTopList(QString category, int size); //Top-tab view
void setCategoryCompoBox(); //Top-tab
protected:
XmlReader::XmlReader()
{
xmlShow();
+ // Remove next line from final code
+ categoryList << "Speed" << "acceleration-0-40" << "acceleration-0-100" << "G-force";
}
/**
/**
*This is return function.
+ *@todo Read real category list
+ *@return QStringList categoryList
+ */
+QStringList XmlReader::getCategoryList()
+{
+ return categoryList;
+}
+
+/**
+ *This is return function.
*@todo Read real top 10 category list
*@return QStringList top10List
*/
return top10List;
}
-/**
- *This is return function.
- *@return QString top10AccelerationList
- */
-QString XmlReader::getTop10AccelerationList()
-{
- return top10AccelerationList;
-}
-
-/**
- *This is return function.
- *@return QString top10SpeedList
- */
-QString XmlReader::getTop10SpeedList()
+QString XmlReader::getTopList( QString category, int size)
{
- return top10SpeedList;
-}
-
-/**
- *This is return function.
- *@return QString top10GforceList
- */
-QString XmlReader::getTop10GforceList()
-{
- return top10GforceList;
+ if (category == "acceleration-0-100")
+ {
+ //return top10AccelerationList;
+ return "acc-tulos1\nacc-tulos2\nacc-tulos3\nacc-tulos4\nacc-tulos5\nacc-tulos6\nacc-tulos7\nacc-tulos8\nacc-tulos9\nacc-tulos10";
+ }
+ else if (category == "acceleration-0-40")
+ {
+ //return top10AccelerationList;
+ return "acc-40-tulos1\nacc-40-tulos2\nacc-40-tulos3\nacc-40-tulos4\nacc-40-tulos5\nacc-40-tulos6\nacc-40-tulos7\nacc-40-tulos8\nacc-40-tulos9\nacc-40-tulos10";
+ }
+ else if (category == "Speed")
+ {
+ //return top10SpeedList;
+ return "speed-tulos1\nspeed-tulos2\nspeed-tulos3\nspeed-tulos4\nspeed-tulos5\nspeed-tulos6\nspeed-tulos7\nspeed-tulos8\nspeed-tulos9\nspeed-tulos10";
+ }
+ else if (category == "G-force")
+ {
+ //return top10GforceList;
+ return "g-tulos1\ng-tulos2\ng-tulos3\ng-tulos4\ng-tulos5\ng-tulos6\ng-tulos7\ng-tulos8\ng-tulos9\ng-tulos10";
+ }
}
XmlReader();
~XmlReader();
QStringList getTop10List();
- QString getTop10AccelerationList();
- QString getTop10SpeedList();
- QString getTop10GforceList();
+ QStringList getCategoryList();
+ QString getTopList( QString category, int size);
private:
QXmlStreamReader xmlreader;
QStringList top10List;
+ QStringList categoryList;
QString top10AccelerationList;
QString top10SpeedList;
QString top10GforceList;