Exemple #1
0
void PokeEdit::on_pokemonFrame_clicked()
{
    PokeTableModel *model = (PokeTableModel*) pokemonModel;
    model->setGen(poke().gen());
    PokeSelection *p = new PokeSelection(poke().num(), pokemonModel);
    p->setParent(this, Qt::Popup);
    QPoint pos = ui->pokemonFrame->mapToGlobal(ui->pokemonFrame->pos());
    p->move(pos.x() + ui->pokemonFrame->width()+10, pos.y()-ui->pokemonFrame->height()/2);
    p->setAttribute(Qt::WA_DeleteOnClose, true);
    p->show();

    connect(p, SIGNAL(pokemonChosen(Pokemon::uniqueId)), SLOT(setNum(Pokemon::uniqueId)));
}
void TB_PokemonBody::setWidget(PokeBodyWidget *widget)
{
    this->widget = widget;
    widget->setMovesModel(movesModel);
    widget->loadPokemon(*poke());
    widget->setWidgetNum(num());

    connect(widget, SIGNAL(pokemonChosen(Pokemon::uniqueId)), SLOT(setNum(Pokemon::uniqueId)));
    connect(widget, SIGNAL(nickChosen(QString)), SLOT(setNick(QString)));
    connect(widget, SIGNAL(natureChanged(int)), SLOT(setNature(int)));
    connect(widget, SIGNAL(natureChanged(int)), SIGNAL(natureChanged()));
    connect(widget, SIGNAL(moveChosen(int)), SLOT(setMove(int)));
    connect(widget, SIGNAL(moveChosen(int,int)), SLOT(setMove(int,int)));
    connect(widget, SIGNAL(itemChanged(int)), SLOT(setItem(int)));
    connect(widget, SIGNAL(EVChanged(int)), SIGNAL(EVChanged(int)));
}