31 #include "templates/mlearning/basicmlearningsimulator.h"
33 #include "templates/mlearning/basicmlearningeditor.h"
34 #include "core/templatecore.h"
37 BasicmLearningSimulator::BasicmLearningSimulator(
TemplateCore *core, QWidget *parent) :
41 connect(m_ui->m_listItems, SIGNAL(itemClicked(QListWidgetItem*)),
42 this, SLOT(displayDescription(QListWidgetItem*)));
45 BasicmLearningSimulator::~BasicmLearningSimulator() {
49 bool BasicmLearningSimulator::startSimulation() {
59 m_ui->m_listItems->clear();
63 QListWidgetItem *list_item =
new QListWidgetItem(item.title(), m_ui->m_listItems);
64 list_item->setData(Qt::UserRole, QVariant::fromValue(item));
67 m_ui->m_phoneWidget->setCurrentIndex(1);
72 bool BasicmLearningSimulator::stopSimulation() {
73 m_ui->m_phoneWidget->setCurrentIndex(0);
80 bool BasicmLearningSimulator::goBack() {
81 if (m_ui->m_phoneWidget->currentIndex() == 2) {
82 m_ui->m_phoneWidget->setCurrentIndex(1);
83 m_ui->m_listItems->setCurrentRow(-1);
94 void BasicmLearningSimulator::displayDescription(QListWidgetItem *list_item) {
95 m_ui->m_lblDetails->setText(list_item->data(Qt::UserRole).value<
BasicmLearningItem>().description());
96 m_ui->m_phoneWidget->setCurrentIndex(2);
virtual TemplateEditor * editor() const
Access to editor widget of the template.
void canGoBackChanged(bool can_go_back)
Emitted if "can go back" status of simulator changes.
bool canGenerateApplications()
Specifies if template can generate applications or not.
TemplateCore * core() const
Access to associated template core.
The core class container for single template.
Base widget which represents simulator of the template.