本文整理汇总了Python中PyQt4.QtCore.qVersion方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.qVersion方法的具体用法?Python QtCore.qVersion怎么用?Python QtCore.qVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore
的用法示例。
在下文中一共展示了QtCore.qVersion方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def main():
print QtCore.qVersion()
print QtCore.PYQT_VERSION_STR
import sys
app = QtGui.QApplication(sys.argv)
vsl = VideoSegmentSelector('/home/caioviel/Videos/sample-480.mp4',
(0,7000), (0,7000))
vsl.show()
sys.exit(app.exec_())
示例2: main
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def main():
# Debug info
print 'Python version: '+str(sys.version_info)
print 'PyQt4 version: '+QtCore.PYQT_VERSION_STR
print 'Qt version: '+QtCore.qVersion()
print 'xml version: '+xml.__version__
# Create the application and enter the main message loop.
createQApp = QtGui.QApplication.startingUp()
if createQApp:
app = QtGui.QApplication([' '])
else:
app = QtGui.qApp
# Create wizard dialog
wiz = commonqt.Wizard()
wiz.setWindowTitle('Result visualizer')
wiz.resize(800, 600)
seq = [PageOpen,PageChooseAction,PageVisualize,PageReportGenerator,PageSave,PageFinal]
# Get NetCDF file to open from command line or from FileOpen dialog.
if len(sys.argv)>1:
result = None
try:
result = loadResult(sys.argv[1])
except Exception,e:
QtGui.QMessageBox.critical(self, 'Unable to load result', unicode(e), QtGui.QMessageBox.Ok, QtGui.QMessageBox.NoButton)
if result!=None:
seq.pop(0)
wiz.shared['result'] = result
wiz.shared['scenario'] = result.scenario
示例3: __init__
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def __init__(self,parent=None):
commonqt.WizardPage.__init__(self, parent)
# For version only:
import matplotlib,numpy,gotm,pynetcdf
#import Numeric,pycdf
versions = []
versions.append(('Python','%i.%i.%i %s %i' % sys.version_info))
versions.append(('Qt4',QtCore.qVersion()))
versions.append(('PyQt4',QtCore.PYQT_VERSION_STR))
versions.append(('numpy',numpy.__version__))
versions.append(('matplotlib',matplotlib.__version__))
#versions.append(('Numeric',Numeric.__version__))
#versions.append(('pycdf',pycdf.pycdfVersion()))
versions.append(('gotm',gotm.gui_util.getversion().rstrip()))
strversions = '<table cellspacing="0" cellpadding="0">'
for v in versions:
strversions += '<tr><td>%s</td><td> </td><td>%s</td></tr>' % v
strversions += '</table>'
layout = QtGui.QVBoxLayout()
self.label = QtGui.QLabel( \
"""<p>This is the Graphical User Interface to the <a href="http://www.gotm.net">General Ocean Turbulence Model (GOTM)</a>.</p>
<p>GOTM is a one-dimensional water column model for natural (marine and limnic) waters based on the Reynolds-averaged Navier-Stokes equations. Vertical mixing is included through an extensive library of state-of-the-art turbulence closure models. The hydrodynamics may be forced by wind stresses, surface heat and buoyancy fluxes, solar radiation and prescribed external and internal pressure gradients.</p>
<p>GOTM includes also a library of ecosystem models, ranging from simple settling of suspended matter to low-, medium- and high-complexity biogeochemical formulations.</p>
<p>There is a number of ready-to-use scenarios available for GOTM, with coastal, shelf sea, open ocean and limnic applications, a few of them including ecosystem modelling. These can be downloaded from <a href="http://www.gotm.net/index.php?go=software&page=testcases">the GOTM web site</a>.</p>
<p>This program offers a user-friendly interface to all options supported by GOTM. It allows you to run existing test cases, or to create and configure a custom scenario. The program will guide you step by step through the process of setting up a scenario, doing the calculations and displaying the results.</p>
<p>For any questions, please consult <a href="http://www.gotm.net">www.gotm.net</a> or write an email to <a href="mailto:[email protected]">[email protected]</a>.<br></p>
<p>This program was developed by <a href="mailto:[email protected]">Jorn Bruggeman</a> from funding by <a href="http://www.bolding-burchard.com">Bolding & Burchard Hydrodynamics</a>.<br></p>
""",self)
self.label.setWordWrap(True)
self.label.setOpenExternalLinks(True)
layout.addWidget(self.label)
layout.addStretch()
#strversions = '\n'.join(['%s %s' % v for v in versions])
#self.labelVersions = QtGui.QLabel('Module versions:\n'+strversions,self)
#layout.addWidget(self.labelVersions)
layout.addStretch(1)
self.labelVersions = QtGui.QLabel('Module versions:',self)
layout.addWidget(self.labelVersions)
self.textVersions = QtGui.QTextEdit(strversions,self)
self.textVersions.setMaximumHeight(100)
self.textVersions.setReadOnly(True)
layout.addWidget(self.textVersions)
self.setLayout(layout)
示例4: __init__
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def __init__(self, iface):
super(TSTools, self).__init__()
# Save reference to the QGIS interface
self.iface = iface
self.canvas = self.iface.mapCanvas()
self.previous_tool = None
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QtCore.QSettings().value("locale/userLocale")[0:2]
localePath = os.path.join(self.plugin_dir,
'i18n',
'tstools_{}.qm'.format(locale))
if os.path.exists(localePath):
self.translator = QtCore.QTranslator()
self.translator.load(localePath)
if QtCore.qVersion() > '4.3.3':
QtCore.QCoreApplication.installTranslator(self.translator)
# Initialize rest of GUI
self.init_controls()
self.init_plots()
# Init controller
self.controller = controller.Controller(self.controls, self.plots)
示例5: __init__
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def __init__(self, iface):
# Save reference to the QGIS interface
self.iface = iface
# initialize plugin directory
self.plugin_dir = QtCore.QFileInfo(QgsApplication.qgisUserDbFilePath()).path() + "/python/plugins/DataDrivenInputMask"
self.app = QgsApplication.instance()
try:
self.app.ddManager
except AttributeError:
ddManager = DdManager(self.iface)
self.app.ddManager = ddManager
# initialize locale
localePath = ""
locale = QtCore.QSettings().value("locale/userLocale")[0:2]
libPath = os.path.dirname(__file__)
libPathFound = False
for p in sys.path:
if p == libPath:
libPathFound = True
break
if not libPathFound:
sys.path.append(libPath)
if QtCore.QFileInfo(self.plugin_dir).exists():
localePath = self.plugin_dir + "/i18n/datadriveninputmask_" + locale + ".qm"
if QtCore.QFileInfo(localePath).exists():
self.translator = QtCore.QTranslator()
self.translator.load(localePath)
if QtCore.qVersion() > '4.3.3':
QtCore.QCoreApplication.installTranslator(self.translator)
示例6: __init__
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def __init__(self, iface):
""" Initialize plugin
:param iface: An interface instance that will be passed to this class
which provides th
:param iface: An interface instance that will be passed to this class
which e hook by which you can manipulate the QGIS
application at run time.
:type iface: QgsInterface
"""
# Save reference to the QGIS interface
self.iface = iface
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QtCore.QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'ImageComposite_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QtCore.QTranslator()
self.translator.load(locale_path)
if QtCore.qVersion() > '4.3.3':
QtCore.QCoreApplication.installTranslator(self.translator)
# Create dialog and keep reference
self.dlg = CompositorDialog(self.iface)
示例7: main
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def main():
# Debug info
print 'Python version: '+str(sys.version_info)
print 'PyQt4 version: '+QtCore.PYQT_VERSION_STR
print 'Qt version: '+QtCore.qVersion()
print 'xml version: '+xml.__version__
# Create the application and enter the main message loop.
createQApp = QtGui.QApplication.startingUp()
if createQApp:
app = QtGui.QApplication([" "])
else:
app = QtGui.qApp
# Create wizard dialog
wiz = commonqt.Wizard()
wiz.setWindowTitle('Scenario builder')
wiz.resize(800, 600)
seq = commonqt.WizardSequence([PageOpen,SequenceEditScenario(),PageFinal])
wiz.setSequence(seq)
wiz.show()
ret = app.exec_()
page = None
wiz.unlink()
sys.exit(ret)
示例8: __init__
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def __init__(self, iface):
"""Constructor.
Args:
iface (QgsInterface): An interface instance that will be passed to
this class which provides the hook by which you can manipulate the
QGIS application at run time.
"""
super(ROITool, self).__init__()
# Save reference to the QGIS interface
self.iface = iface
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QtCore.QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(self.plugin_dir, 'i18n',
'roitool_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QtCore.QTranslator()
self.translator.load(locale_path)
if QtCore.qVersion() > '4.3.3':
QtCore.QCoreApplication.installTranslator(self.translator)
示例9: sendReport
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def sendReport(self):
name = unicode(self.mainwindow.profile().handle)
bestname = unicode(self.name.text())
os = ostools.osVer()
full = ostools.platform.platform()
python = ostools.platform.python_version()
qt = QtCore.qVersion()
msg = unicode(self.textarea.toPlainText())
if len(bestname) <= 0 or len(msg) <= 0:
msgbox = QtGui.QMessageBox()
msgbox.setStyleSheet(self.mainwindow.theme["main/defaultwindow/style"])
msgbox.setText("You must fill out all fields first!")
msgbox.setStandardButtons(QtGui.QMessageBox.Ok)
ret = msgbox.exec_()
return
QtGui.QDialog.accept(self)
data = urllib.urlencode({"name":name, "version": version._pcVersion, "bestname":bestname, "os":os, "platform":full, "python":python, "qt":qt, "msg":msg})
print "Sending..."
f = urllib.urlopen("http://distantsphere.com/pc/reporter.php", data)
text = f.read()
print text
if text == "success!":
print "Sent!"
else:
print "Problems ):"
示例10: main
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def main():
# Debug info
print 'Python version: '+str(sys.version_info)
print 'PyQt4 version: '+QtCore.PYQT_VERSION_STR
print 'Qt version: '+QtCore.qVersion()
# Create the application and enter the main message loop.
createQApp = QtGui.QApplication.startingUp()
if createQApp:
app = QtGui.QApplication([' '])
else:
app = QtGui.qApp
# Create wizard dialog
wiz = commonqt.Wizard(closebutton = sys.platform!='win32')
seq = commonqt.WizardSequence([PageIntroduction,PageChooseAction,ForkOnAction(wiz),visualizer.PageVisualize,visualizer.PageReportGenerator,visualizer.PageSave,visualizer.PageFinal])
wiz.setSequence(seq)
wiz.setWindowTitle('GOTM-GUI')
wiz.resize(800, 600)
wiz.show()
ret = app.exec_()
page = None
wiz.unlink()
sys.exit(ret)
示例11: __init__
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def __init__(self, iface):
"""Constructor.
:param iface: An interface instance that will be passed to this class
which provides the hook by which you can manipulate the QGIS
application at run time.
:type iface: QgsInterface
"""
# Save reference to the QGIS interface
self.iface = iface
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QtCore.QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'bdhabnat_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QtCore.QTranslator()
self.translator.load(locale_path)
if QtCore.qVersion() > '4.3.3':
QtCore.QCoreApplication.installTranslator(self.translator)
# Create the dialog (after translation) and keep reference
self.dlg = bdhabnatDialog(iface)
# Declare instance attributes
self.actions = []
self.menu = self.tr(u'&BD Habnat')
# TODO: We are going to let the user set this up in a future iteration
self.toolbar = self.iface.addToolBar(u'bdhabnat')
self.toolbar.setObjectName(u'bdhabnat')
示例12: __init__
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def __init__(self):
QtGui.QDialog.__init__(self, None)
self.setWindowFlags( self.windowFlags() & ~QtCore.Qt.WindowContextHelpButtonHint )
self.setWindowFlags( self.windowFlags() | QtCore.Qt.WindowStaysOnTopHint)
# initialize locale
locale = QtCore.QSettings().value("locale/userLocale")[0:2]
localePath = os.path.join(os.path.dirname(__file__), 'i18n', 'geopunt4qgis_{}.qm'.format(locale))
if os.path.exists(localePath):
self.translator = QtCore.QTranslator()
self.translator.load(localePath)
if QtCore.qVersion() > '4.3.3': QtCore.QCoreApplication.installTranslator(self.translator)
self._initGui()
示例13: __init__
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def __init__(self, parent=None):
QtGui.QDialog.__init__(self, parent)
uic.loadUi("forms/aboutform.ui", self)
self.setModal(False)
cfg = Configuration()
self.pythonVer.setText('Python ver. {0}'.format(sys.version))
self.qtVer.setText('Qt ver. {0}'.format(QtCore.qVersion()))
self.matplotlibVer.setText('Matplotlib ver. {0}'.format(
matplotlib.__version__))
self.pyQtVer.setText('PyQt ver. {0}'.format(
cfg.pyqt_version_str
))
self.numpyVer.setText('Numpy ver. {0}'.format(
numpy.__version__))
self.sciPyVer.setText('Scipy ver. {0}'.format(
scipy.__version__))
示例14: __init__
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def __init__(self, iface):
self.iface = iface
self.plugin_dir = os.path.dirname(__file__)
locale = QtCore.QSettings().value("locale/userLocale")[0:2]
localePath = os.path.join(
self.plugin_dir, 'i18n', 'idecanarias_{}.qm'.format(locale)
)
if os.path.exists(localePath):
self.translator = QtGui.QTranslator()
self.translator.load(localePath)
if QtCore.qVersion() > '4.3.3':
QtCore.QCoreApplication.installTranslator(self.translator)
# TODO: 140514, install dock
self.dock = IDECanariasDock(self.iface)
self.iface.addDockWidget(QtCore.Qt.BottomDockWidgetArea, self.dock)
示例15: signal_received
# 需要导入模块: from PyQt4 import QtCore [as 别名]
# 或者: from PyQt4.QtCore import qVersion [as 别名]
def signal_received(self, message):
logger.debug('%s - %s' % (QtCore.qVersion(), message))
try:
if message == "reset":
self.webView.setHtml(self.startpage)
else:
self.request = QtNetwork.QNetworkRequest()
self.request.setRawHeader("Content-Type", QtCore.QByteArray('application/octet-stream'))
self.request.setRawHeader("Accept-Language", QtCore.QByteArray("de, *"))
self.request.setUrl(QtCore.QUrl(message))
self.webView.load(self.request)
# old version without user-agent
# self.webView.load(QtCore.QUrl(message))
except:
self.webView.setHtml(self.startpage)
logger.error('receive: {}'.format(message))