mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-07-14 00:53:49 -07:00
code release
This commit is contained in:
parent
b941ba41a3
commit
a902f11f74
354 changed files with 826570 additions and 1 deletions
27
xlib/qt/widgets/QXFileDialog.py
Normal file
27
xlib/qt/widgets/QXFileDialog.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from PyQt6.QtWidgets import *
|
||||
|
||||
|
||||
class QXFileDialog(QFileDialog):
|
||||
def __init__(self, parent=None,
|
||||
multi_files=False,
|
||||
existing_only=False,
|
||||
is_save=False,
|
||||
filter=None,
|
||||
accepted=None):
|
||||
|
||||
super().__init__(parent=parent, filter=filter)
|
||||
self.setOption(QFileDialog.Option.DontUseNativeDialog)
|
||||
|
||||
if is_save:
|
||||
self.setAcceptMode(QFileDialog.AcceptMode.AcceptSave)
|
||||
|
||||
if multi_files:
|
||||
self.setFileMode(QFileDialog.FileMode.ExistingFiles)
|
||||
else:
|
||||
if existing_only:
|
||||
self.setFileMode(QFileDialog.FileMode.ExistingFile)
|
||||
else:
|
||||
self.setFileMode(QFileDialog.FileMode.AnyFile)
|
||||
|
||||
if accepted is not None:
|
||||
self.accepted.connect(accepted)
|
Loading…
Add table
Add a link
Reference in a new issue