当前位置: 首页>>代码示例>>Python>>正文


Python Qt.WA_DeleteOnClose方法代码示例

本文整理汇总了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_() 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:18,代码来源:misccommands.py

示例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() 
开发者ID:codesardine,项目名称:Jade-Application-Kit,代码行数:21,代码来源:Widgets.py

示例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) 
开发者ID:afourmy,项目名称:pyNMS,代码行数:20,代码来源:site_panel.py

示例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) 
开发者ID:afourmy,项目名称:pyNMS,代码行数:21,代码来源:internal_node_creation_panel.py

示例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) 
开发者ID:afourmy,项目名称:pyNMS,代码行数:21,代码来源:network_node_creation_panel.py

示例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) 
开发者ID:hANSIc99,项目名称:Pythonic,代码行数:25,代码来源:dropbox.py

示例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() 
开发者ID:jopohl,项目名称:urh,代码行数:23,代码来源:CSVImportDialog.py

示例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())) 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:7,代码来源:webpage.py

示例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 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:36,代码来源:msgbox.py

示例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) 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:8,代码来源:crashdialog.py

示例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() 
开发者ID:ver228,项目名称:tierpsy-tracker,代码行数:17,代码来源:AnalysisProgress.py

示例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) 
开发者ID:ver228,项目名称:tierpsy-tracker,代码行数:8,代码来源:SelectApp.py

示例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() 
开发者ID:hANSIc99,项目名称:Pythonic,代码行数:12,代码来源:exceptwindow.py

示例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') 
开发者ID:hANSIc99,项目名称:Pythonic,代码行数:10,代码来源:elementeditor.py

示例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()) 
开发者ID:hANSIc99,项目名称:Pythonic,代码行数:8,代码来源:basic_stack_window.py


注:本文中的PyQt5.QtCore.Qt.WA_DeleteOnClose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。