-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use global property to store QtWebKit availability
- Loading branch information
1 parent
9fd5d40
commit 64c37f2
Showing
3 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
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
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
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,16 @@ | ||
|
||
_WITH_QTWEBKIT = None | ||
|
||
|
||
def with_qt_web_kit() -> bool: | ||
global _WITH_QTWEBKIT | ||
if _WITH_QTWEBKIT is None: | ||
try: | ||
from PyQt5.QtWebKit import QWebSettings | ||
from PyQt5.QtWebKitWidgets import QWebView, QWebPage | ||
except ModuleNotFoundError: | ||
_WITH_QTWEBKIT = False | ||
else: | ||
_WITH_QTWEBKIT = True | ||
|
||
return _WITH_QTWEBKIT |