DeepFaceLive/xlib/qt/widgets/QXDirDialog.py
2021-07-23 17:34:49 +04:00

15 lines
556 B
Python

from PyQt6.QtWidgets import *
class QXDirDialog(QFileDialog):
def __init__(self, parent=None, caption : str = None, directory : str = None, accepted=None):
super().__init__(parent=parent, directory=directory)
self.setOption(QFileDialog.Option.DontUseNativeDialog)
self.setOption(QFileDialog.Option.ShowDirsOnly, True)
self.setFileMode(QFileDialog.FileMode.Directory)
if caption is not None:
self.setWindowTitle(caption)
if accepted is not None:
self.accepted.connect(accepted)