-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
QtFramework/QtWidgets/QWebEngineView/QWebEngineView_10_plugin_enabled.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_()) |
19 changes: 19 additions & 0 deletions
19
QtFramework/QtWidgets/QWebEngineView/html/QWebEngineView_10_plugin_enabled.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.