1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
#include "RaceChoiceView.h"
RaceChoiceView::RaceChoiceView(QWidget *parent) : QDialog(parent)
{
ui.setupUi(this);
setModal(true);
human = QPixmap("img/human.gif");
elf = QPixmap("img/elf.gif");
dwarf = QPixmap("img/dwarf.gif");
ui.m_l_img->setPixmap ( human ); // On accède aux widgets de l'interface ainsi
}
QString RaceChoiceView::GetRaceName()
{
return ui.m_cb_race->currentText();
}
void RaceChoiceView::on_m_cb_race_activated(const QString &text)
{
if(text == "Humain")
{
ui.m_l_img->setPixmap ( human );
}
if(text == "Nain")
{
ui.m_l_img->setPixmap ( dwarf );
}
if(text == "Elfe")
{
ui.m_l_img->setPixmap ( elf );
}
} |