本文整理汇总了C++中Icon::setPixmap方法的典型用法代码示例。如果您正苦于以下问题:C++ Icon::setPixmap方法的具体用法?C++ Icon::setPixmap怎么用?C++ Icon::setPixmap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Icon
的用法示例。
在下文中一共展示了Icon::setPixmap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
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() ) );
}
示例2: addCasualty
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 );
}
}