Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[py3] Add PyQt5/PyQt4 compatibility layer
- Loading branch information
Showing
18 changed files
with
265 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt4.Qsci import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt4.QtCore import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt4.QtGui import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from PyQt4.QtGui import ( | ||
QAbstractPrintDialog | ||
QPageSetupDialog | ||
QPrintDialog | ||
QPrintEngine | ||
QPrintPreviewDialog | ||
QPrintPreviewWidget | ||
QPrinter | ||
QPrinterInfo | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt4.QtWebKit import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from PyQt4.QtWebKit import ( | ||
QGraphicsWebView | ||
QWebFrame | ||
QWebHitTestResult | ||
QWebInspector | ||
QWebPage | ||
QWebView | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt5.Qsci import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt5.QtCore import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt5.QtGui import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt5.QtPrintSupport import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt5.QtWebKit import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt5.QtWebKitWidgets import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from PyQt5.QtWidgets import * |
Empty file.