This commit is contained in:
恍兮惚兮 2024-07-28 23:29:11 +08:00
parent 480dc6b049
commit 8b8f117e70
5 changed files with 5 additions and 7 deletions

View File

@ -1085,9 +1085,7 @@ class MAINUI:
== Qt.WindowType.FramelessWindowHint
):
return
if isinstance(widget, QMenu):
return
if isinstance(widget, QFrame):
if isinstance(widget, (QMenu, QFrame)):
return
if (
isinstance(widget, QWidget)

View File

@ -37,7 +37,7 @@ class Textbrowser(QLabel):
"错误",
"can't find Webview2 runtime!",
)
elif isinstance(e, ImportError) or isinstance(e, ModuleNotFoundError):
elif isinstance(e, (ImportError, ModuleNotFoundError)):
getQMessageBox(
None,
"错误",

View File

@ -1392,7 +1392,7 @@ def makeforms(lay: LFormLayout, lis, args):
name, wid = None, line[0]
else:
name, wid = line
if isinstance(wid, tuple) or isinstance(wid, list):
if isinstance(wid, (tuple, list)):
hb = QHBoxLayout()
hb.setContentsMargins(0, 0, 0, 0)
if Stretch:

View File

@ -220,7 +220,7 @@ for uid in savehook_new_data:
for k in _dfsavehook:
if k not in savehook_new_data[uid]:
__v = _dfsavehook[k]
if isinstance(_dfsavehook[k], list) or isinstance(_dfsavehook[k], dict):
if isinstance(_dfsavehook[k], (list, dict)):
__v = __v.copy()
savehook_new_data[uid][k] = __v

View File

@ -321,7 +321,7 @@ class Requester_common:
disposition = b'Content-Disposition: form-data; name="'
disposition += name.encode("utf8")
disposition += b'"'
if isinstance(data, tuple) or isinstance(data, list):
if isinstance(data, (tuple, list)):
if len(data) == 3:
filename, data, type_ = data
elif len(data) == 2: