把一张两边带黑边的图片自然拉伸设置成背景壁纸,但是设成壁纸后黑边不能有,我弄的效果是这样的:
拉伸放大后人物没显示全,左边的黑边没了,但是右边的还在而且变成了白边,求大神指导下怎么才能达到我要的效果,我把代码贴上:
void HomeView::chgHomeBG()
{
if (m_pAppManageView == NULL)
{
ERROR("HomeView::chgHomeBG m_pAppManageView is NULL");
return;
}
QSettings setConf("./etc/conf",QSettings::IniFormat);
QString qstrTmp = setConf.value("home/current_homeBG","./share/homeBG/defaultHomeBG.svg").toString();
if(0 == QString::compare(qstrTmp,"./share/homeBG/currentHomeBG.png"))
{
m_pAppManageView->setBackgroundPixmap(QPixmap(QString::fromUtf8("./share/homeBG/currentHomeBG.png")));
}
else
{
m_pAppManageView->setBackgroundPixmap(QPixmap(QString::fromUtf8("./share/homeBG/defaultHomeBG.svg")));
}