AskChest::AskChest() : QDialog( 0, Qt::Dialog ) { _result = 0; QLabel * chooseLabel = new QLabel( this ); chooseLabel->setText( tr( "Choose between earning Gold or Experience" ) ); FIXEDSIZE( chooseLabel ); QLabel * goldLabel = new QLabel(this); goldLabel->setText( QString::number( 1000 ) ); QLabel * experienceLabel = new QLabel(this); experienceLabel->setText( QString::number( 2500 ) ); QPushButton * goldButton = new QPushButton( this ); goldButton->setText( tr( "Gold" ) ); FIXEDSIZE( goldButton ); QPushButton * experienceButton = new QPushButton( this ); experienceButton->setText( tr( "Experience" ) ); FIXEDSIZE( experienceButton ); Icon * goldIcon = new Icon( this ); goldIcon->setPixmap( QPixmap( *ImageTheme.getResourceIcon( 0 ) ) ); Icon * experienceIcon = new Icon( this ); experienceIcon->setPixmap( QPixmap( *ImageTheme.getWidgetPixmap( ICO_EXPERIENCE ) ) ); QGridLayout * layout = new QGridLayout(this); layout->addWidget(chooseLabel, 0, 0, 1, 2, Qt::AlignHCenter); layout->addWidget(goldIcon, 1, 0, Qt::AlignHCenter); layout->addWidget(experienceIcon, 1, 1, Qt::AlignHCenter); layout->addWidget(goldLabel, 2, 0, Qt::AlignHCenter); layout->addWidget(experienceLabel, 2, 1, Qt::AlignHCenter); layout->addWidget(goldButton, 3, 0, Qt::AlignHCenter); layout->addWidget(experienceButton, 3, 1, Qt::AlignHCenter); connect( goldButton, SIGNAL( clicked() ), SLOT( slot_gold() ) ); connect( experienceButton, SIGNAL( clicked() ), SLOT( slot_experience() ) ); }
void CasualtiesList::addCasualty( GenericFightUnit * unit ) { if( unit ) { _none->hide(); QString f; f.sprintf( "units/face_%i_%i.png", unit->getRace(), unit->getLevel() ); Icon * photo = new Icon( _present, "photo" ); photo->setPixmap( QPixmap( IMAGE_PATH + f ) ); _layPresent->addWidget( photo ); _layPresent->addStretch( 2 ); } }