Skip to content

Commit

Permalink
웹 요구, 플러그인(플래쉬등) 사용 허가
Browse files Browse the repository at this point in the history
  • Loading branch information
RavenKyu committed Aug 15, 2018
1 parent 06f9a75 commit ba3dace
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python
# coding: utf-8

# 예제 내용
# * QWebEngineView 창 닫기 요구

import sys

from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QDir
from PyQt5.QtCore import QUrl
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtWebEngineWidgets import QWebEngineSettings

__author__ = "Deokyu Lim <hong18s@gmail.com>"


class WebView(QWebEngineView):
def __init__(self):
QWebEngineView.__init__(self)

# Flash 등을 사용하기 위해서 Plugin 사용을 허락
QWebEngineSettings.globalSettings().setAttribute(
QWebEngineSettings.PluginsEnabled, True);

# 로컬파일 사용시 절대경로만 사용해야 함
url = QDir().current().filePath(
"html/QWebEngineView_10_plugin_enabled.html")
url = QUrl.fromLocalFile(url)
self.setUrl(url)


if __name__ == "__main__":
app = QApplication(sys.argv)
form = WebView()
form.show()
exit(app.exec_())
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>


<object>
<param name="movie" value="snow.swf">
<embed src="snow.swf">
<!--<embed src="snow.swf" width="100" height="100">-->
</embed>
</object>


</body>
</html>
Binary file added QtFramework/QtWidgets/QWebEngineView/html/snow.swf
Binary file not shown.

0 comments on commit ba3dace

Please sign in to comment.