Skip to content
Permalink
Browse files

[py3] Add PyQt5/PyQt4 compatibility layer

  • Loading branch information
m-kuhn committed Nov 16, 2015
1 parent 0b6dd35 commit 47543d940ecfda7e0e902cb843a962d763c92e5e
@@ -56,6 +56,7 @@ ENDMACRO(PY_COMPILE)
ADD_SUBDIRECTORY(plugins)
ADD_SUBDIRECTORY(qsci_apis)
ADD_SUBDIRECTORY(console)
ADD_SUBDIRECTORY(PyQt)
ADD_SUBDIRECTORY(pyplugin_installer)
ADD_SUBDIRECTORY(ext-libs)

@@ -0,0 +1,35 @@
SET (QGIS_PYQT_DIR ${QGIS_DATA_DIR}/python/PyQt)
SET (PYTHON_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/python)

SET(PYQT_COMPAT_FILES
__init__.py
QtWidgets.py
QtCore.py
QtGui.py
QtPrintSupport.py
QtWebKit.py
QtWebKitWidgets.py
Qsci.py
)

ADD_CUSTOM_TARGET(pyqtcompat ALL)

IF(ENABLE_QT5)
SET(PYQT_PREFIX PyQt5)
ELSE(ENABLE_QT5)
SET(PYQT_PREFIX PyQt4)
ENDIF(ENABLE_QT5)

FOREACH(pyfile ${PYQT_COMPAT_FILES})
SET(pyfile ${PYQT_PREFIX}/${pyfile})
ADD_CUSTOM_COMMAND(TARGET pyqtcompat
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTHON_OUTPUT_DIRECTORY}/PyQt
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} ${PYTHON_OUTPUT_DIRECTORY}/PyQt
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
)
ENDFOREACH(pyfile)
PY_COMPILE(pyqtcompat "${PYTHON_OUTPUT_DIRECTORY}/PyQt")

INSTALL(FILES ${PYQT_COMPAT_FILES} DESTINATION "${QGIS_PYQT_DIR}")
@@ -0,0 +1 @@
from PyQt4.Qsci import *
@@ -0,0 +1 @@
from PyQt4.QtCore import *
@@ -0,0 +1 @@
from PyQt4.QtGui import *
@@ -0,0 +1,10 @@
from PyQt4.QtGui import (
QAbstractPrintDialog
QPageSetupDialog
QPrintDialog
QPrintEngine
QPrintPreviewDialog
QPrintPreviewWidget
QPrinter
QPrinterInfo
)
@@ -0,0 +1 @@
from PyQt4.QtWebKit import *
@@ -0,0 +1,8 @@
from PyQt4.QtWebKit import (
QGraphicsWebView
QWebFrame
QWebHitTestResult
QWebInspector
QWebPage
QWebView
)
@@ -0,0 +1,200 @@
from PyQt4.QtGui import (
QAbstractButton,
QAbstractGraphicsShapeItem,
QAbstractItemDelegate,
QAbstractItemView,
QAbstractScrollArea,
QAbstractSlider,
QAbstractSpinBox,
QAction,
QActionGroup,
QApplication,
QBoxLayout,
QButtonGroup,
QCalendarWidget,
QCheckBox,
QColorDialog,
QColumnView,
QComboBox,
QCommandLinkButton,
QCommonStyle,
QCompleter,
QDataWidgetMapper,
QDateEdit,
QDateTimeEdit,
QDesktopWidget,
QDial,
QDialog,
QDialogButtonBox,
QDirModel,
QDockWidget,
QDoubleSpinBox,
QErrorMessage,
QFileDialog,
QFileIconProvider,
QFileSystemModel,
QFocusFrame,
QFontComboBox,
QFontDialog,
QFormLayout,
QFrame,
QGesture,
QGestureEvent,
QGestureRecognizer,
QGraphicsAnchor,
QGraphicsAnchorLayout,
QGraphicsBlurEffect,
QGraphicsColorizeEffect,
QGraphicsDropShadowEffect,
QGraphicsEffect,
QGraphicsEllipseItem,
QGraphicsGridLayout,
QGraphicsItem,
QGraphicsItemGroup,
QGraphicsLayout,
QGraphicsLayoutItem,
QGraphicsLineItem,
QGraphicsLinearLayout,
QGraphicsObject,
QGraphicsOpacityEffect,
QGraphicsPathItem,
QGraphicsPixmapItem,
QGraphicsPolygonItem,
QGraphicsProxyWidget,
QGraphicsRectItem,
QGraphicsRotation,
QGraphicsScale,
QGraphicsScene,
QGraphicsSceneContextMenuEvent,
QGraphicsSceneDragDropEvent,
QGraphicsSceneEvent,
QGraphicsSceneHelpEvent,
QGraphicsSceneHoverEvent,
QGraphicsSceneMouseEvent,
QGraphicsSceneMoveEvent,
QGraphicsSceneResizeEvent,
QGraphicsSceneWheelEvent,
QGraphicsSimpleTextItem,
QGraphicsTextItem,
QGraphicsTransform,
QGraphicsView,
QGraphicsWidget,
QGridLayout,
QGroupBox,
QHBoxLayout,
QHeaderView,
QInputDialog,
QItemDelegate,
QItemEditorCreatorBase,
QItemEditorFactory,
QKeyEventTransition,
QLCDNumber,
QLabel,
QLayout,
QLayoutItem,
QLineEdit,
QListView,
QListWidget,
QListWidgetItem,
QMainWindow,
QMdiArea,
QMdiSubWindow,
QMenu,
QMenuBar,
QMessageBox,
QMouseEventTransition,
QPanGesture,
QPinchGesture,
QPlainTextDocumentLayout,
QPlainTextEdit,
QProgressBar,
QProgressDialog,
QPushButton,
QRadioButton,
QRubberBand,
QScrollArea,
QScrollBar,
QShortcut,
QSizeGrip,
QSizePolicy,
QSlider,
QSpacerItem,
QSpinBox,
QSplashScreen,
QSplitter,
QSplitterHandle,
QStackedLayout,
QStackedWidget,
QStatusBar,
QStyle,
QStyleFactory,
QStyleHintReturn,
QStyleHintReturnMask,
QStyleHintReturnVariant,
QStyleOption,
QStyleOptionButton,
QStyleOptionComboBox,
QStyleOptionComplex,
QStyleOptionDockWidget,
QStyleOptionFocusRect,
QStyleOptionFrame,
QStyleOptionGraphicsItem,
QStyleOptionGroupBox,
QStyleOptionHeader,
QStyleOptionMenuItem,
QStyleOptionProgressBar,
QStyleOptionRubberBand,
QStyleOptionSizeGrip,
QStyleOptionSlider,
QStyleOptionSpinBox,
QStyleOptionTab,
QStyleOptionTabBarBase,
QStyleOptionTabWidgetFrame,
QStyleOptionTitleBar,
QStyleOptionToolBar,
QStyleOptionToolBox,
QStyleOptionToolButton,
QStyleOptionViewItem,
QStylePainter,
QStyledItemDelegate,
QSwipeGesture,
QSystemTrayIcon,
QTabBar,
QTabWidget,
QTableView,
QTableWidget,
QTableWidgetItem,
QTableWidgetSelectionRange,
QTapAndHoldGesture,
QTapGesture,
QTextBrowser,
QTextEdit,
QTimeEdit,
QToolBar,
QToolBox,
QToolButton,
QToolTip,
QTreeView,
QTreeWidget,
QTreeWidgetItem,
QTreeWidgetItemIterator,
QUndoCommand,
QUndoGroup,
QUndoStack,
QUndoView,
QVBoxLayout,
QWhatsThis,
QWidget,
QWidgetAction,
QWidgetItem,
QWizard,
QWizardPage,
qApp,
qDrawBorderPixmap,
qDrawPlainRect,
qDrawShadeLine,
qDrawShadePanel,
qDrawShadeRect,
qDrawWinButton,
qDrawWinPanel
)
Empty file.
@@ -0,0 +1 @@
from PyQt5.Qsci import *
@@ -0,0 +1 @@
from PyQt5.QtCore import *
@@ -0,0 +1 @@
from PyQt5.QtGui import *
@@ -0,0 +1 @@
from PyQt5.QtPrintSupport import *
@@ -0,0 +1 @@
from PyQt5.QtWebKit import *
@@ -0,0 +1 @@
from PyQt5.QtWebKitWidgets import *
@@ -0,0 +1 @@
from PyQt5.QtWidgets import *
Empty file.

0 comments on commit 47543d9

Please sign in to comment.
You can’t perform that action at this time.