本文整理汇总了Python中PyQt5.QtCore.Qt.WA_DeleteOnClose方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.WA_DeleteOnClose方法的具体用法?Python Qt.WA_DeleteOnClose怎么用?Python Qt.WA_DeleteOnClose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.WA_DeleteOnClose方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _print_preview
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def _print_preview(tab: apitypes.Tab) -> None:
"""Show a print preview."""
def print_callback(ok: bool) -> None:
if not ok:
message.error("Printing failed!")
tab.printing.check_preview_support()
diag = QPrintPreviewDialog(tab)
diag.setAttribute(Qt.WA_DeleteOnClose)
diag.setWindowFlags(
diag.windowFlags() | # type: ignore[operator, arg-type]
Qt.WindowMaximizeButtonHint |
Qt.WindowMinimizeButtonHint)
diag.paintRequested.connect(functools.partial(
tab.printing.to_printer, callback=print_callback))
diag.exec_()
示例2: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, parent, title, msg, on_confirm):
"""
* :param parent: Parent window
* :param window_title:str
* :param msg:str
* :param on_confirm: Function to execute use parenthesis ()
"""
super().__init__(parent)
reply = QMessageBox.question(self, title, msg, QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
self.setAttribute(Qt.WA_DeleteOnClose, True)
self.setWindowTitle(title)
view = Instance.retrieve("view")
if view:
self.setWindowIcon(view.icon())
if reply == QMessageBox.Yes:
on_confirm()
else:
self.destroy()
self.show()
示例3: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, controller):
super().__init__(controller)
self.controller = controller
self.setTitle('Site management')
self.setMinimumSize(300, 300)
self.setAcceptDrops(True)
# exit connection lost because of the following lines
layout = QtWidgets.QGridLayout(self)
pixmap = controller.pixmaps['default']['site']
label = QLabel(self)
label.setMaximumSize(200, 200)
label.subtype = 'site'
label.setPixmap(pixmap)
label.setScaledContents(True)
label.show()
label.setAttribute(Qt.WA_DeleteOnClose)
layout.addWidget(label, 0, 0)
示例4: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, controller):
super().__init__(controller)
self.controller = controller
self.setTitle('Object creation')
self.setMinimumSize(300, 300)
self.setAcceptDrops(True)
# exit connection lost because of the following lines
layout = QtWidgets.QGridLayout(self)
for index, subtype in enumerate(internal_node_subtype):
pixmap = controller.pixmaps['default'][subtype]
label = QLabel(self)
label.setMaximumSize(100, 100)
label.subtype = subtype
label.setPixmap(pixmap)
label.setScaledContents(True)
label.show()
label.setAttribute(Qt.WA_DeleteOnClose)
layout.addWidget(label, index // 2, index % 2)
示例5: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, controller):
super().__init__(controller)
self.controller = controller
self.setTitle('Node creation')
self.setMinimumSize(300, 300)
self.setAcceptDrops(True)
# exit connection lost because of the following lines
layout = QtWidgets.QGridLayout(self)
for index, subtype in enumerate(network_node_subtype):
pixmap = controller.pixmaps['default'][subtype]
label = QLabel(self)
label.setMaximumSize(50, 50)
label.subtype = subtype
label.setPixmap(pixmap)
label.setScaledContents(True)
label.show()
label.setAttribute(Qt.WA_DeleteOnClose)
layout.addWidget(label, index // 4, index % 4)
示例6: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, parent):
super().__init__()
self.mod_path = os.path.dirname(Pythonic.__file__)
self.setAttribute(Qt.WA_DeleteOnClose)
self.parent = parent
self.label = QLabel()
self.label.setPixmap(QPixmap(join(self.mod_path, 'images/tmp.png')).scaled(160, 80))
self.setAcceptDrops(True)
self.type = None
self.config = None
self.layout = QHBoxLayout()
self.layout.setContentsMargins(20, 30, 30, 30)
self.icon_bar = IconBar()
self.icon_bar.setVisible(False)
self.layout.addWidget(self.label)
self.layout.addWidget(self.icon_bar)
self.setLayout(self.layout)
示例7: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, filename="", parent=None):
super().__init__(parent)
self.ui = Ui_DialogCSVImport()
self.ui.setupUi(self)
self.setAttribute(Qt.WA_DeleteOnClose)
self.setWindowFlags(Qt.Window)
self.ui.btnAutoDefault.hide()
completer = QCompleter()
completer.setModel(QDirModel(completer))
self.ui.lineEditFilename.setCompleter(completer)
self.filename = None # type: str
self.ui.lineEditFilename.setText(filename)
self.update_file()
self.ui.tableWidgetPreview.setColumnHidden(self.COLUMNS["T"], True)
self.update_preview()
self.create_connects()
示例8: on_print_requested
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def on_print_requested(self, frame):
"""Handle printing when requested via javascript."""
printdiag = QPrintDialog()
printdiag.setAttribute(Qt.WA_DeleteOnClose)
printdiag.open(lambda: frame.print(printdiag.printer()))
示例9: msgbox
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def msgbox(parent, title, text, *, icon, buttons=QMessageBox.Ok,
on_finished=None, plain_text=None):
"""Display a QMessageBox with the given icon.
Args:
parent: The parent to set for the message box.
title: The title to set.
text: The text to set.
buttons: The buttons to set (QMessageBox::StandardButtons)
on_finished: A slot to connect to the 'finished' signal.
plain_text: Whether to force plain text (True) or rich text (False).
None (the default) uses Qt's auto detection.
Return:
A new QMessageBox.
"""
if objects.args.no_err_windows:
print('Message box: {}; {}'.format(title, text), file=sys.stderr)
return DummyBox()
box = QMessageBox(parent)
box.setAttribute(Qt.WA_DeleteOnClose)
box.setIcon(icon)
box.setStandardButtons(buttons)
if on_finished is not None:
box.finished.connect(on_finished)
if plain_text:
box.setTextFormat(Qt.PlainText)
elif plain_text is not None:
box.setTextFormat(Qt.RichText)
box.setWindowTitle(title)
box.setText(text)
box.show()
return box
示例10: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, debug, text, parent=None):
super().__init__(debug, parent)
self._log = text
self.setAttribute(Qt.WA_DeleteOnClose)
self._set_crash_info()
self._type, self._func = parse_fatal_stacktrace(self._log)
示例11: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, process_thread):
super(AnalysisProgress, self).__init__()
self.ui = Ui_AnalysisProgress()
self.ui.setupUi(self)
self.ui.progressBar.setValue(0)
self.setAttribute(Qt.WA_DeleteOnClose)
self.process_thread = process_thread
self.startRecieverThread()
self.process_thread.task_done.connect(self.task_done)
self.process_thread.task_done.connect(self.reciever.break_run)
self.process_thread.start()
示例12: appCall
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def appCall(self, name):
appFun, label = widget_lists[name]
ui = appFun()
ui.setWindowTitle(label)
ui.show()
ui.setAttribute(Qt.WA_DeleteOnClose)
示例13: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, message, position):
super().__init__()
self.setMinimumSize(400, 300)
self.setWindowFlags(Qt.Window)
self.setAttribute(Qt.WA_DeleteOnClose, True)
self.message = message
self.position = position
self.initUI()
self.raiseWindow()
示例14: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, parent):
super().__init__(parent)
self.setMinimumSize(400, 500)
self.setWindowFlags(Qt.Window)
self.setWindowModality(Qt.WindowModal)
self.setAttribute(Qt.WA_DeleteOnClose, True)
logging.debug('ElementEditor::__init__() called')
示例15: __init__
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, parent):
super().__init__(parent)
self.parent = parent
self.setAttribute(Qt.WA_DeleteOnClose, True)
self.timestamp = strftime('%H:%M:%S', localtime())