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


Python Qt.WA_DeleteOnClose方法代码示例

本文整理汇总了Python中qtpy.QtCore.Qt.WA_DeleteOnClose方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.WA_DeleteOnClose方法的具体用法?Python Qt.WA_DeleteOnClose怎么用?Python Qt.WA_DeleteOnClose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qtpy.QtCore.Qt的用法示例。


在下文中一共展示了Qt.WA_DeleteOnClose方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, w, parent=None):
        QWidget.__init__(self, parent)

        self._w = w
        self.setupUi()

        contentLayout = QHBoxLayout()
        contentLayout.setContentsMargins(0, 0, 0, 0)
        contentLayout.addWidget(w)

        self.windowContent.setLayout(contentLayout)

        self.setWindowTitle(w.windowTitle())
        self.setGeometry(w.geometry())

        # Adding attribute to clean up the parent window when the child is closed
        self._w.setAttribute(Qt.WA_DeleteOnClose, True)
        self._w.destroyed.connect(self.__child_was_closed) 
开发者ID:gmarull,项目名称:qtmodern,代码行数:20,代码来源:windows.py

示例2: show_dialog

# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import WA_DeleteOnClose [as 别名]
def show_dialog(parent, title, text, icon):
    m = QMessageBox(parent)
    m.setWindowModality(Qt.NonModal)
    m.setText(text)
    m.setWindowTitle(title)
    m.setAttribute(Qt.WA_DeleteOnClose, True)
    m.setIcon(icon)
    m.show()
    center_widget_on_screen(m) 
开发者ID:busimus,项目名称:cutelog,代码行数:11,代码来源:utils.py

示例3: settings_dialog

# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import WA_DeleteOnClose [as 别名]
def settings_dialog(self):
        d = SettingsDialog(self)
        d.setWindowModality(Qt.ApplicationModal)
        d.setAttribute(Qt.WA_DeleteOnClose, True)
        d.open() 
开发者ID:busimus,项目名称:cutelog,代码行数:7,代码来源:main_window.py

示例4: pop_out_tab

# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import WA_DeleteOnClose [as 别名]
def pop_out_tab(self):
        logger, index = self.current_logger_and_index()
        if not logger:
            return
        self.log.debug("Tab pop out requested: {}".format(int(index)))

        logger.destroyed.connect(logger.closeEvent)
        logger.setAttribute(Qt.WA_DeleteOnClose, True)
        logger.setWindowFlags(Qt.Window)
        logger.setWindowTitle('cutelog: "{}"'.format(self.loggerTabWidget.tabText(index)))
        self.popped_out_loggers[logger.name] = logger
        self.loggerTabWidget.removeTab(index)
        logger.popped_out = True
        logger.show()
        center_widget_on_screen(logger) 
开发者ID:busimus,项目名称:cutelog,代码行数:17,代码来源:main_window.py

示例5: pop_in_tab

# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import WA_DeleteOnClose [as 别名]
def pop_in_tab(self, logger):
        logger.setWindowFlags(Qt.Widget)
        logger.setAttribute(Qt.WA_DeleteOnClose, False)
        logger.destroyed.disconnect(logger.closeEvent)
        logger.setWindowTitle(logger.name)
        logger.popped_out = False
        del self.popped_out_loggers[logger.name]
        index = self.loggerTabWidget.addTab(logger, logger.windowTitle())
        self.loggerTabWidget.setCurrentIndex(index) 
开发者ID:busimus,项目名称:cutelog,代码行数:11,代码来源:main_window.py

示例6: __init__

# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, parent, plugin_manager=None):
        super().__init__(parent)
        if not plugin_manager:
            from ..plugins import plugin_manager

        self.setMaximumHeight(800)
        self.setMaximumWidth(1280)
        layout = QVBoxLayout()
        # maybe someday add a search bar here?
        title = QLabel("Installed Plugins")
        title.setObjectName("h2")
        layout.addWidget(title)
        # get metadata for successfully registered plugins
        plugin_manager.discover()
        data = plugin_manager.list_plugin_metadata()
        data = list(filter(lambda x: x['plugin_name'] != 'builtins', data))
        # create a table for it
        self.table = QtDictTable(
            parent,
            data,
            headers=[
                'plugin_name',
                'package',
                'version',
                'url',
                'author',
                'license',
            ],
            min_section_width=60,
        )
        self.table.setObjectName("pluginTable")
        self.table.horizontalHeader().setObjectName("pluginTableHeader")
        self.table.verticalHeader().setObjectName("pluginTableHeader")
        self.table.setGridStyle(Qt.NoPen)
        # prevent editing of table
        self.table.setEditTriggers(QAbstractItemView.NoEditTriggers)
        layout.addWidget(self.table)
        self.setLayout(layout)
        self.setAttribute(Qt.WA_DeleteOnClose) 
开发者ID:napari,项目名称:napari,代码行数:41,代码来源:qt_plugin_table.py

示例7: __init__

# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self):
        super(MainWindowABC, self).__init__()
        self.setupUi(self)
        self.setAttribute(Qt.WA_DeleteOnClose) 
开发者ID:KmolYuan,项目名称:Pyslvs-UI,代码行数:6,代码来源:main_abc.py

示例8: show_error_message

# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import WA_DeleteOnClose [as 别名]
def show_error_message(self, message):
        """Show error message."""
        messageBox = QMessageBox(self)
        messageBox.setWindowModality(Qt.NonModal)
        messageBox.setAttribute(Qt.WA_DeleteOnClose)
        messageBox.setWindowTitle('Render Report Error')
        messageBox.setText(message)
        messageBox.setStandardButtons(QMessageBox.Ok)
        messageBox.show() 
开发者ID:spyder-ide,项目名称:spyder-reports,代码行数:11,代码来源:reportsplugin.py

示例9: __init__

# 需要导入模块: from qtpy.QtCore import Qt [as 别名]
# 或者: from qtpy.QtCore.Qt import WA_DeleteOnClose [as 别名]
def __init__(self, vtype, control, path, fgprintindex):
        if fgprintindex is None:
            fgprintindex = -1
        if Q7Window._icons == {}:
            Q7Window.initClassConstants()
        QWidget.__init__(self, None)
        self._stylesheet = None
        if vtype == Q7Window.VIEW_TREE:
            self._stylesheet = Q7TREEVIEWSTYLESHEET
        if vtype == Q7Window.VIEW_CONTROL:
            self._stylesheet = Q7CONTROLVIEWSTYLESHEET
        self.setupUi(self)
        # self.setAttribute(Qt.WA_DeleteOnClose)
        if self._stylesheet is not None:
            self.setStyleSheet(self._stylesheet)
        self.getOptions()
        self._timercount = 0
        self._vtype = vtype
        self._path = path
        self._control = control
        self._application = None
        self._fgindex = fgprintindex
        self._index = self.addChildWindow()
        self._lockableWidgets = []
        self._lockedWidgets = []
        fn = ''
        if self._fgindex != -1:
            fn = Q7FingerPrint.getByIndex(self._fgindex).filename
        if self._index != 0:
            tit = "%s: %s%.3d" % (OCTXT._ToolName, self._vtype, self._index)
        else:
            if vtype in self._title:
                tit = "%s: %s" % (OCTXT._ToolName, self._title[vtype])
            else:
                tit = "%s: ---" % OCTXT._ToolName
        self.setWindowTitle(tit)
        try:
            self.bBackControl.clicked.connect(self.backcontrol)
        except AttributeError:
            pass
        self._readonly = False
        if not control.verbose:
            sys.stdout = self.control_log
            sys.stderr = self.control_log 
开发者ID:pyCGNS,项目名称:pyCGNS,代码行数:46,代码来源:wfingerprint.py


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