/*
    函数名:setPixmap()
    参  数:无
    描  述:设置状态图片
*/
void test::setPixmap(bool pixmapStatus)
{
    if(pixmapStatus)
    {
        QPixmap *pixmap = new QPixmap(":/images/red_stone.png");
        ui->label_Pixmap->setPixmap(pixmap->scaled(QSize(12,12),
                                          Qt::IgnoreAspectRatio,
                                          Qt::SmoothTransformation));
    }else
    {
        QPixmap *pixmap = new QPixmap(":/images/green_stone.png");
        ui->label_Pixmap->setPixmap(pixmap->scaled(QSize(12,12),
                                          Qt::IgnoreAspectRatio,
                                          Qt::SmoothTransformation));
    }
}

 

相关文章:

  • 2021-05-13
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2022-12-23
  • 2021-07-26
  • 2021-07-16
  • 2021-07-17
猜你喜欢
  • 2021-11-04
  • 2021-07-20
  • 2022-12-23
  • 2023-03-20
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
相关资源
相似解决方案