把一張兩邊帶黑邊的圖片自然拉伸設置成背景壁紙,但是設成壁紙後黑邊不能有,我弄的效果是這樣的:
拉伸放大後人物沒顯示全,左邊的黑邊沒了,但是右邊的還在而且變成了白邊,求大神指導下怎麼才能達到我要的效果,我把代碼貼上:
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")));
}
http://blog.csdn.net/kuanshu456/article/details/8515887