def setTargetTableSizeConstraints(self): if int(qt.qVersion()[0]) < 5: self.targetTable.horizontalHeader().setResizeMode( qt.QHeaderView.Stretch) self.targetTable.horizontalHeader().setResizeMode( 0, qt.QHeaderView.Fixed) self.targetTable.horizontalHeader().setResizeMode( 1, qt.QHeaderView.ResizeToContents) self.targetTable.horizontalHeader().setResizeMode( 2, qt.QHeaderView.Stretch) self.targetTable.horizontalHeader().setResizeMode( 3, qt.QHeaderView.ResizeToContents) self.targetTable.horizontalHeader().setResizeMode( 4, qt.QHeaderView.ResizeToContents) elif int(qt.qVersion()[0]) >= 5: self.targetTable.horizontalHeader().setSectionResizeMode( qt.QHeaderView.Stretch) self.targetTable.horizontalHeader().setSectionResizeMode( 0, qt.QHeaderView.Fixed) self.targetTable.horizontalHeader().setSectionResizeMode( 1, qt.QHeaderView.ResizeToContents) self.targetTable.horizontalHeader().setSectionResizeMode( 2, qt.QHeaderView.Stretch) self.targetTable.horizontalHeader().setSectionResizeMode( 3, qt.QHeaderView.ResizeToContents) self.targetTable.horizontalHeader().setSectionResizeMode( 4, qt.QHeaderView.ResizeToContents)
def print_versions(): """Print all the versions of software that ViTables relies on.""" print '-=' * 38 print 'ViTables version: %s' % vitables.preferences.vtconfig.getVersion() print "PyTables version: %s" % tables.__version__ print "Qt version: %s" % qt.qVersion() print "PyQt version: %s" % qt.PYQT_VERSION_STR print 'Python version: %s' % sys.version if os.name == 'posix': (sysname, nodename, release, version, machine) = os.uname() print 'Platform: %s-%s' % (sys.platform, machine) print '-=' * 38
def print_(self): printer = Qt.QPrinter(Qt.QPrinter.HighResolution) #docName = self.plot.title.text(). printer.setOrientation(Qt.QPrinter.Landscape) printer.setColorMode(Qt.QPrinter.Color) printer.setOutputToFile(True) printer.setOutputFileName('bode-example-%s.ps' % Qt.qVersion()) if printer.setup(): filter = PrintFilter() if (Qt.QPrinter.GrayScale == printer.colorMode()): filter.setOptions( Qwt.QwtPlotPrintFilter.PrintAll & ~Qwt.QwtPlotPrintFilter.PrintCanvasBackground) self.plot.print_(printer, filter)
def get_installed_version(self): # This only works when PyQt is installed import qt return qt.qVersion()
sys.exit(1) ui_toolkit = sys_conf.get('ui_toolkit', 'qt4') if ui_toolkit == 'qt3': log.info() log.info(log.bold("Checking PyQt 3.x version...")) # PyQt 3 try: import qt except ImportError: num_errors += 1 log.error("NOT FOUND OR FAILED TO LOAD!") else: # check version of Qt qtMajor = int(qt.qVersion().split('.')[0]) if qtMajor < MINIMUM_QT_MAJOR_VER: log.error( "Incorrect version of Qt installed. Ver. 3.0.0 or greater required." ) else: #check version of PyQt try: pyqtVersion = qt.PYQT_VERSION_STR except AttributeError: pyqtVersion = qt.PYQT_VERSION while pyqtVersion.count('.') < 2: pyqtVersion += '.0'
def qVersion(): """ Returns the qt version in an integer. """ return int(qt.qVersion()[0])
sys.exit(1) ui_toolkit = sys_conf.get('ui_toolkit', 'qt4') if ui_toolkit == 'qt3': log.info() log.info(log.bold("Checking PyQt 3.x version...")) # PyQt 3 try: import qt except ImportError: num_errors += 1 log.error("NOT FOUND OR FAILED TO LOAD!") else: # check version of Qt qtMajor = int(qt.qVersion().split('.')[0]) if qtMajor < MINIMUM_QT_MAJOR_VER: log.error("Incorrect version of Qt installed. Ver. 3.0.0 or greater required.") else: #check version of PyQt try: pyqtVersion = qt.PYQT_VERSION_STR except AttributeError: pyqtVersion = qt.PYQT_VERSION while pyqtVersion.count('.') < 2: pyqtVersion += '.0' (maj_ver, min_ver, pat_ver) = pyqtVersion.split('.')