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


Python QErrorMessage.qtHandler方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PyQt4.QtGui import QErrorMessage [as 别名]
# 或者: from PyQt4.QtGui.QErrorMessage import qtHandler [as 别名]
    def __init__(self, parent=None):
        super(DialogService, self).__init__(parent)

        # All-purpose error popup message:
        # Used by self.showErrorMsgByErrorCode(<errorCode>),
        # or self.showErrorMsg(<string>). Returns a
        # QErrorMessage without parent, but with QWindowFlags set
        # properly to be a dialog popup box:
        self.errorMsgPopup = QErrorMessage.qtHandler()
        # Re-parent the popup, retaining the window flags set
        # by the qtHandler:
        self.errorMsgPopup.setParent(parent, self.errorMsgPopup.windowFlags())
        # self.errorMsgPopup.setStyleSheet(SpeakEasyGUI.stylesheetAppBG);
        self.infoMsg = QMessageBox(parent=parent)
开发者ID:ros-visualization,项目名称:echo_tree,代码行数:16,代码来源:tester_gui.py

示例2: __init__

# 需要导入模块: from PyQt4.QtGui import QErrorMessage [as 别名]
# 或者: from PyQt4.QtGui.QErrorMessage import qtHandler [as 别名]
    def __init__(self, navdb):
        super(Gui, self).__init__([])
        self.acdata          = ACDataEvent()
        self.navdb           = navdb
        self.radarwidget     = []
        self.command_history = []
        self.cmdargs         = []
        self.history_pos     = 0
        self.command_mem     = ''
        self.command_line    = ''
        self.prev_cmdline    = ''
        self.simevent_target = 0
        self.mousepos        = (0, 0)
        self.prevmousepos    = (0, 0)
        self.panzoomchanged  = False

        # Register our custom pan/zoom event
        for etype in [PanZoomEventType, ACDataEventType, SimInfoEventType,
                      StackTextEventType, ShowDialogEventType,
                      DisplayFlagEventType, RouteDataEventType,
                      DisplayShapeEventType]:
            reg_etype = QEvent.registerEventType(etype)
            if reg_etype != etype:
                print('Warning: Registered event type differs from requested type id (%d != %d)' % (reg_etype, etype))

        self.splash = Splash()
        self.splash.show()

        self.splash.showMessage('Constructing main window')
        self.processEvents()

        # Install error message handler
        handler = QErrorMessage.qtHandler()
        handler.setWindowFlags(Qt.WindowStaysOnTopHint)

        # Check and set OpenGL capabilities
        if not QGLFormat.hasOpenGL():
            raise RuntimeError('No OpenGL support detected for this system!')
        else:
            f = QGLFormat()
            f.setVersion(3, 3)
            f.setProfile(QGLFormat.CoreProfile)
            f.setDoubleBuffer(True)
            QGLFormat.setDefaultFormat(f)
            print('QGLWidget initialized for OpenGL version %d.%d' % (f.majorVersion(), f.minorVersion()))

        # Create the main window and related widgets
        self.radarwidget = RadarWidget(navdb)
        self.win = MainWindow(self, self.radarwidget)
        self.nd  = ND(shareWidget=self.radarwidget)

        # Enable HiDPI support (Qt5 only)
        if QT_VERSION == 5:
            self.setAttribute(Qt.AA_UseHighDpiPixmaps)

        timer = QTimer(self)
        timer.timeout.connect(self.radarwidget.updateGL)
        timer.timeout.connect(self.nd.updateGL)
        timer.start(50)

        # Load geo data
        if False:
            pb = QProgressDialog('Binary buffer file not found, or file out of date: Constructing vertex buffers from geo data.', 'Cancel', 0, 100)
            pb.setWindowFlags(Qt.WindowStaysOnTopHint)
            pb.show()
            for i in range(101):
                pb.setValue(i)
                self.processEvents()
                QThread.msleep(100)
            pb.close()
开发者ID:junzis,项目名称:bluesky,代码行数:72,代码来源:gui.py


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