Skip to content

Commit

Permalink
修复 QWebEngineView 父级问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyiYo committed Oct 29, 2023
1 parent 834ce4b commit 3f9be5c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion qframelesswindow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
:license: GPLv3, see LICENSE for more details.
"""

__version__ = "0.3.4"
__version__ = "0.3.5"

import sys

Expand Down
1 change: 1 addition & 0 deletions qframelesswindow/linux/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def setTitleBar(self, titleBar):
title bar
"""
self.titleBar.deleteLater()
self.titleBar.hide()
self.titleBar = titleBar
self.titleBar.setParent(self)
self.titleBar.raise_()
Expand Down
1 change: 1 addition & 0 deletions qframelesswindow/mac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def setTitleBar(self, titleBar):
title bar
"""
self.titleBar.deleteLater()
self.titleBar.hide()
self.titleBar = titleBar
self.titleBar.setParent(self)
self.titleBar.raise_()
Expand Down
10 changes: 9 additions & 1 deletion qframelesswindow/webengine/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# coding: utf-8
import sys

from PyQt5.QtCore import Qt
from PyQt5.QtWebEngineWidgets import QWebEngineView
from qframelesswindow import AcrylicWindow


class FramelessWebEngineView(QWebEngineView):
""" Frameless web engine view """

def __init__(self, parent=None):
def __init__(self, parent):
if sys.platform == "win32" and isinstance(parent.window(), AcrylicWindow):
parent.window().setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)

super().__init__(parent=parent)
self.setHtml("")
self.window().updateFrameless()
1 change: 1 addition & 0 deletions qframelesswindow/windows/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def setTitleBar(self, titleBar):
title bar
"""
self.titleBar.deleteLater()
self.titleBar.hide()
self.titleBar = titleBar
self.titleBar.setParent(self)
self.titleBar.raise_()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name="PyQt5-Frameless-Window",
version="0.3.4",
version="0.3.5",
keywords="pyqt frameless",
author="zhiyiYo",
author_email="[email protected]",
Expand Down

0 comments on commit 3f9be5c

Please sign in to comment.