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 == Qt.WindowType.FramelessWindowHint
): ):
return return
if isinstance(widget, QMenu): if isinstance(widget, (QMenu, QFrame)):
return
if isinstance(widget, QFrame):
return return
if ( if (
isinstance(widget, QWidget) isinstance(widget, QWidget)

View File

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

View File

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

View File

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

View File

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