Python qtpy.PYQT4 Examples

The following are 3 code examples of qtpy.PYQT4(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module qtpy , or try the search function .
Example #1
Source File: terminalplugin.py    From spyder-terminal with MIT License 6 votes vote down vote up
def check_compatibility(self):
        """Check if current Qt backend version is greater or equal to 5."""
        message = ''
        valid = True
        if PYQT4 or PYSIDE:
            message = _('<b>spyder-terminal</b> doesn\'t work with Qt 4. '
                        'Therefore, this plugin will be deactivated.')
            valid = False
        if WINDOWS:
            try:
                import winpty
                del winpty
            except:
                message = _('Unfortunately, the library that <b>spyder-termina'
                            'l</b> uses to create terminals is failing to '
                            'work in your system. Therefore, this plugin will '
                            'be deactivated.<br><br> This usually happens on '
                            'Windows 7 systems. If that\'s the case, please '
                            'consider updating to a newer Windows version.')
                valid = False
        return valid, message

    # ------ SpyderPluginWidget API ------------------------------ 
Example #2
Source File: datatree.py    From spyder-unittest with MIT License 5 votes vote down vote up
def dataChanged(self, topLeft, bottomRight, roles=[]):
        """Called when data in model has changed."""
        if PYQT4:
            QTreeView.dataChanged(self, topLeft, bottomRight)
        else:
            QTreeView.dataChanged(self, topLeft, bottomRight, roles)
        self.resizeColumns()
        while topLeft.parent().isValid():
            topLeft = topLeft.parent()
        while bottomRight.parent().isValid():
            bottomRight = bottomRight.parent()
        self.spanFirstColumn(topLeft.row(), bottomRight.row()) 
Example #3
Source File: reportsplugin.py    From spyder-reports with MIT License 5 votes vote down vote up
def check_compatibility(self):
        """
        Check plugin requirements.

        - PyQt version is greater or equal to 5.
        """
        messages = []
        valid = True
        if PYQT4 or PYSIDE:
            messages.append('Spyder-reports does not work with Qt4')
            valid = False
        return valid, ", ".join(messages)

    # -------------------------------------------------------------------------