Package schrodinger :: Package infra :: Module pyqt4_compat
[hide private]
[frames] | no frames]

Module pyqt4_compat

Classes [hide private]
  QtUpgradeError
An exception raised when trying to access a PyQt4 method that no longer exists or has been renamed in PyQt5.
Functions [hide private]
tuple
_get_namespaces()
Iterate through all objects in PyQt4's QtGui module and divide things into four new namespaces:
Variables [hide private]
  IS_PYQT4 = True
hash(x)
  PRINT_SUPPORT = set(['QAbstractPrintDialog', 'QPageSetupDialog...
  WIDGET_ANCESTORS = ['QWidget', 'QLayoutItem', 'QStyle', 'QStyl...
  FORCE_WIDGETS = set(['QAbstractGraphicsShapeItem', 'QActionGro...
  QTCORE = set(['QAbstractProxyModel', 'QIdentityProxyModel', 'Q...
  EXCLUDE = set(['QAbstractProxyModel', 'QGraphicsItemAnimation'...
  __package__ = 'schrodinger.infra'
  qtgui = {'Display': <class 'PyQt4.QtGui.Display'>, 'QAbstractT...
  qtgui_deprecated = {'QStyleOptionDockWidget': <class 'PyQt4.Qt...
  qtprintsupport = {'QAbstractPrintDialog': <class 'PyQt4.QtGui....
  qtwidgets = {'QAbstractButton': <class 'PyQt4.QtGui.QAbstractB...
Function Details [hide private]

_get_namespaces()

 

Iterate through all objects in PyQt4's QtGui module and divide things into four new namespaces:

  • Objects that are still in the QtGui module in PyQt5
  • Objects that have been moved to the QtWidgets module in PyQt5
  • Objects that have been moved to the QtPrintSupport module in PyQt5
  • Objects that no longer exist in PyQt5 but that we still need access to for PyQt4 code, such as the QStyleOption subclasses. (For example, PyQt4's QStyleOptionViewItemV2, QStyleOptionViewItemV3, and QStyleOptionViewItemV4 have been merged into QStyleOptionViewItem in PyQt5, but our PyQt4 code may still need to identify a QStyleOptionViewItem subclass instance that's passed in from C++.)
Returns: tuple
A tuple of dictionaries, where each dictionary represents one of the namespaces listed above.

Variables Details [hide private]

PRINT_SUPPORT

Value:
set(['QAbstractPrintDialog',
     'QPageSetupDialog',
     'QPrintDialog',
     'QPrintEngine',
     'QPrintPreviewDialog',
     'QPrintPreviewWidget',
     'QPrinter',
     'QPrinterInfo'])

WIDGET_ANCESTORS

Value:
['QWidget',
 'QLayoutItem',
 'QStyle',
 'QStyleHintReturn',
 'QGesture',
 'QAbstractItemDelegate',
 'QAction']

FORCE_WIDGETS

Value:
set(['QAbstractGraphicsShapeItem',
     'QActionGroup',
     'QApplication',
     'QButtonGroup',
     'QCompleter',
     'QDataWidgetMapper',
     'QDirModel',
     'QFileIconProvider',
...

QTCORE

Value:
set(['QAbstractProxyModel',
     'QIdentityProxyModel',
     'QItemSelection',
     'QItemSelectionModel',
     'QItemSelectionRange',
     'QSortFilterProxyModel',
     'QStringListModel'])

EXCLUDE

Value:
set(['QAbstractProxyModel',
     'QGraphicsItemAnimation',
     'QIdentityProxyModel',
     'QInputContext',
     'QInputContextFactory',
     'QItemSelection',
     'QItemSelectionModel',
     'QItemSelectionRange',
...

qtgui

Value:
{'Display': <class 'PyQt4.QtGui.Display'>,
 'QAbstractTextDocumentLayout': <class 'PyQt4.QtGui.QAbstractTextDocum\
entLayout'>,
 'QActionEvent': <class 'PyQt4.QtGui.QActionEvent'>,
 'QBitmap': <class 'PyQt4.QtGui.QBitmap'>,
 'QBrush': <class 'PyQt4.QtGui.QBrush'>,
 'QClipboard': <class 'PyQt4.QtGui.QClipboard'>,
 'QCloseEvent': <class 'PyQt4.QtGui.QCloseEvent'>,
...

qtgui_deprecated

Value:
{'QStyleOptionDockWidget': <class 'PyQt4.QtGui.QStyleOptionDockWidget'\
>,
 'QStyleOptionDockWidgetV2': <class 'PyQt4.QtGui.QStyleOptionDockWidge\
tV2'>,
 'QStyleOptionFrame': <class 'PyQt4.QtGui.QStyleOptionFrame'>,
 'QStyleOptionFrameV2': <class 'PyQt4.QtGui.QStyleOptionFrameV2'>,
 'QStyleOptionFrameV3': <class 'PyQt4.QtGui.QStyleOptionFrameV3'>,
 'QStyleOptionProgressBar': <class 'PyQt4.QtGui.QStyleOptionProgressBa\
...

qtprintsupport

Value:
{'QAbstractPrintDialog': <class 'PyQt4.QtGui.QAbstractPrintDialog'>,
 'QPageSetupDialog': <class 'PyQt4.QtGui.QPageSetupDialog'>,
 'QPrintDialog': <class 'PyQt4.QtGui.QPrintDialog'>,
 'QPrintEngine': <class 'PyQt4.QtGui.QPrintEngine'>,
 'QPrintPreviewDialog': <class 'PyQt4.QtGui.QPrintPreviewDialog'>,
 'QPrintPreviewWidget': <class 'PyQt4.QtGui.QPrintPreviewWidget'>,
 'QPrinter': <class 'PyQt4.QtGui.QPrinter'>,
 'QPrinterInfo': <class 'PyQt4.QtGui.QPrinterInfo'>}

qtwidgets

Value:
{'QAbstractButton': <class 'PyQt4.QtGui.QAbstractButton'>,
 'QAbstractGraphicsShapeItem': <class 'PyQt4.QtGui.QAbstractGraphicsSh\
apeItem'>,
 'QAbstractItemDelegate': <class 'PyQt4.QtGui.QAbstractItemDelegate'>,
 'QAbstractItemView': <class 'PyQt4.QtGui.QAbstractItemView'>,
 'QAbstractScrollArea': <class 'PyQt4.QtGui.QAbstractScrollArea'>,
 'QAbstractSlider': <class 'PyQt4.QtGui.QAbstractSlider'>,
 'QAbstractSpinBox': <class 'PyQt4.QtGui.QAbstractSpinBox'>,
...