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


Python QDialog.setModal方法代码示例

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


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

示例1: _showpostviewerdialog

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import setModal [as 别名]
 def _showpostviewerdialog(self, post):
     d = QDialog(self)
     d.resize(1024, 768)
     l = QVBoxLayout()
     w = PostViewerWidget(post, self._backend, self._masterobserver, self)
     w.nextpostrequested.connect(self._putnextpost)
     w.previouspostrequested.connect(self._putpreviouspost)
     w.closing.connect(d.close)
     l.addWidget(w)
     d.setLayout(l)
     d.setModal(False)
     d.show()
开发者ID:Hydrael,项目名称:4ca,代码行数:14,代码来源:mainwindow.py

示例2: UiMain

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import setModal [as 别名]

#.........这里部分代码省略.........

        super(UiMain, self).changeEvent(event)

    def on_systray_activated(self, reason):
        if reason == QSystemTrayIcon.DoubleClick:
            self.show()

    @staticmethod
    def toggle_split(event):
        # 0 = Qt.Unchecked The item is unchecked.
        # 1 = Qt.PartiallyChecked The item is partially checked. Items in
        # hierarchical models may be partially checked if some, but not all,
        # of
        # their children are checked.
        # 2 = Qt.Checked The item is checked.
        if event == 0:
            Constants.OPTIONS['splitText'] = False
        elif event == 2:
            Constants.OPTIONS['splitText'] = True

    def update(self):
        """ Checks a webpage for current version, compares this to built-in
        current versions, and shows update dialog if necessary
        """
        try:
            ver = urlopen('http://league-insanity.tk/Azeirah_content/version')\
                .read()
        except IOError:
            # if for some reason it couldn't retrieve the version, set it to
            # automatically ignore the update: False
            ver = False
        if not float(VERSION) >= float(ver):
            self.popup = QDialog(self)
            self.popup.setModal(True)
            self.popup.setGeometry(200, 100, 500, 100)
            self.popup.show()

            self.popup_text = QLabel(self.popup)
            self.popup_text.setGeometry(5, 5, 500, 30)
            self.popup_text.setOpenExternalLinks(True)
            self.popup_text.show()
            self.popup_text.setText(
                """There is an update available. Run update.exe or <a href='https://sourceforge.net/projects/obsmusicstreamd'>download the update manually</a>""")
            # reply = QMessageBox.question(Constants.UI, 'Message',
            #                              "Do you want to update?", QMessageBox.Yes | QMessageBox.No, QMessageBox.No)
            # if reply == QMessageBox.Yes:
            #     import atexit
            #     import subprocess

            #     def runUpdater():
            #         import time
            #         time.sleep(3)
            #         subprocess.Popen(resource_path('update.exe'))
            #     atexit.register(runUpdater)
            #     sys.exit()

            #     Constants.update_dialog = QWidget()
            #     Constants.update_dialog.resize(350, 100)
            #     Constants.update_dialog.setWindowIcon(QIcon(resource_path\
            #         ('icon.png')))
            #     Constants.update_dialog.setWindowTitle('Updater')
            #     Constants.update_dialog_lbl = QLabel(Constants.update_dialog)
            #     Constants.update_dialog_lbl.setGeometry(10, 40, 340, 12)
            #     Constants.update_dialog.show()

            #     updateThread = Thread(target = update.update)
开发者ID:dylziez,项目名称:SMG,代码行数:70,代码来源:guiv2.py


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