找回密码
 立即注册
收起左侧

Ubuntu下用qss方式显示背景图片没效果

1
回复
7112
查看
[复制链接]
累计签到:5 天
连续签到:1 天
来源: 2016-9-3 22:07:17 显示全部楼层 |阅读模式
1Qter豆
[img]file:///D:\用户目录\我的文档\Tencent Files\644846309\Image\Group\_$)}CXBS9732[{3`2ST1UCT.jpg[/img][img=0,1]file:///D:\用户目录\我的文档\Tencent Files\644846309\Image\Group\_$)}CXBS9732[{3`2ST1UCT.jpg[/img][img=0,1]file:///D:\用户目录\我的文档\Tencent Files\644846309\Image\Group\_$)}CXBS9732[{3`2ST1UCT.jpg[/img]
采用qss的方式,使登录界面显示背景图片,编译后没有错误,运行后没有出现背景图片,效果如下:

我的welcome.cpp中设置如下:
#include <QtGui/QApplication>
#include "welcome.h"
#include "ui_welcome.h"
#include <QFile>
#include <QFrame>
welcome::welcome(QWidget *parent) :
    QFrame(parent),
    ui(new Ui::welcome)
{
    ui->setupUi(this);
    Warning = new warning;
    smartHome = new smarthome ;
}
....


welcome.h设置如下:
#ifndef WELCOME_H
#define WELCOME_H
#include <QFrame>
#include <smarthome.h>
#include <warning.h>
namespace Ui {
class welcome;
}

class welcome : public QFrame
{
    Q_OBJECT

public:
    explicit welcome(QWidget *parent = 0);
    ~welcome();
...

welcome.ui如下:

请问怎么把右边welcome的class变成QFrame?

附件: 您需要 登录 才可以下载或查看,没有帐号?立即注册
回复

使用道具 举报

尚未签到

2016-9-4 01:17:56 显示全部楼层
图片没显示多半是因为路径写错了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

公告
可以关注我们的微信公众号yafeilinux_friends获取最新动态,或者加入QQ会员群进行交流:190741849、186601429(已满) 我知道了