博客园 首页 私信博主 显示目录 隐藏目录 管理 动画

QLable 显示图片

1,各种对就是不显示,因为路径中有其它符号如\n\r什么的

 1 QStringList FileOpeartion::PathCombine (const QString strPath, QStringList strListTemp)
 2 {
 3     QStringList strReturn;
 4     
 5     foreach (const QString &str, strListTemp)
 6     {
 7         if (!str.isEmpty())
 8         {
 9             strReturn << strPath.trimmed() + str.trimmed();
10         }
11     }
12     
13     return strReturn;
14 }
15 
16 
17 QPixmap FileOpeartion::GetPicture (QString strPath, int mWidth, int mHeight)
18 {
19     QPixmap pictureimg;
20     //"D:dataFolder/2015/03/15/AIA094/20150315_001402_1024_0094.jpg"
21     
22     if (pictureimg.load (strPath))
23     {
24         pictureimg = pictureimg.scaled (mWidth, mHeight, Qt::KeepAspectRatio);
25     }
26     
27     return pictureimg;
28 }
View Code

 

posted @ 2016-09-19 07:38  ants_double  阅读(213)  评论(0编辑  收藏  举报