将本地html文件加载到Pyside QwebView中

时间:2016-12-15 16:07:12

标签: python pyside qwebview

我想将一个本地HTML文件(带有相对的css和js文件)加载到我的QwebView Pyside Widget中,但它没有显示任何内容。 这是我的代码:

Aggregation.match(new Criteria().orOperator(Criteria.where("event_‌​state") .is("scheduled").and("schedule.start_time").gt(d), Criteria.where("event_state").is("live")))

我该如何解决这个问题?

我的html文件位于项目根目录的资源文件夹中

1 个答案:

答案 0 :(得分:0)

解决了刚刚替换:

self.view.load(QUrl("file://"+cwd+"\\resource\\Splash.html"))

为:

self.view.load(QUrl.fromLocalFile(cwd+"\\resource\\Splash.html"))