Commit dd01383c authored by Wolfgang Rohdewald's avatar Wolfgang Rohdewald
Browse files

use qtpy as wrapper around pyqt/pyside. Now runs with pyside too

parent a825503d
......@@ -3,3 +3,8 @@ at the file debian.control
all content of debian.control is used by make_debian_package,
so its syntax must follow debian package rules
Kajongg uses the wrapper qtpy around PyQt5 / Pyside2. If both are installed, kajongg uses PyQt5.
The environment variable QT_API can override that, see https://github.com/spyder-ide/qtpy#requirements
If you see segfaults, Pyside2 is better for finding the reason.
......@@ -20,9 +20,9 @@ in the windows guest:
- put Python3.5/scripts and Python3.5/DLLs into PATH
- pip3 install --upgrade pip
- pip3 install cx_freeze
- pip3 install pyqt
- pip3 install twisted
- pip3 install sip
- pip3 install PyQt5
- install pywin32 (right now pip does not offer a 32bit version for Python 3.5, download from sourceforge)
- install Visual Studio 2015 Community Edition
- setup a shared directory (visible for host and guest) "kajongg": a working copy of the git repository
......
......@@ -5,7 +5,7 @@ Maintainer: Wolfgang Rohdewald <wolfgang@rohdewald.de>
Package: kajongg
Architecture: all
Depends: python (>= 3.5.0), python-twisted-core (>= 16.6.0), libsqlite3-0 (>= 3.5.0), libqt4-sql-sqlite (>= 4.6), python-qt4-sql (>= 4.6), kdegames-mahjongg-data, vorbis-tools
Depends: python (>= 3.5.0), python-twisted-core (>= 16.6.0), python3-qtpy(>= 1.9.0), libsqlite3-0 (>= 3.5.0), libqt4-sql-sqlite (>= 4.6), python-qt4-sql (>= 4.6), kdegames-mahjongg-data, vorbis-tools
Recommends: sox
Replaces: kmj
Homepage: https://kde.org/applications/games/org.kde.kajongg
......
......@@ -14,7 +14,7 @@ from twisted.internet.defer import Deferred, succeed, fail
from qt import QPropertyAnimation, QParallelAnimationGroup, \
QAbstractAnimation, QEasingCurve
from qt import pyqtProperty, QGraphicsObject, QGraphicsItem
from qt import Property, QGraphicsObject, QGraphicsItem
from common import Internal, Debug, isAlive, StrMixin
from log import logDebug, logException, id4
......@@ -298,7 +298,7 @@ class AnimatedMixin:
"""setter for property pos"""
QGraphicsObject.setPos(self, pos)
pos = pyqtProperty('QPointF', fget=_get_pos, fset=_set_pos)
pos = Property('QPointF', fget=_get_pos, fset=_set_pos)
def _get_scale(self):
"""getter for property scale"""
......@@ -308,7 +308,7 @@ class AnimatedMixin:
"""setter for property scale"""
QGraphicsObject.setScale(self, scale)
scale = pyqtProperty(float, fget=_get_scale, fset=_set_scale)
scale = Property(float, fget=_get_scale, fset=_set_scale)
def _get_rotation(self):
"""getter for property rotation"""
......@@ -318,7 +318,7 @@ class AnimatedMixin:
"""setter for property rotation"""
QGraphicsObject.setRotation(self, rotation)
rotation = pyqtProperty(float, fget=_get_rotation, fset=_set_rotation)
rotation = Property(float, fget=_get_rotation, fset=_set_rotation)
def queuedAnimation(self, propertyName):
"""return the last queued animation for this graphics object and propertyName"""
......
......@@ -745,7 +745,7 @@ class ItemInt(KConfigSkeletonItem):
class KConfigSkeleton(QObject):
"""handles preferences settings"""
configChanged = pyqtSignal()
configChanged = Signal()
def __init__(self):
QObject.__init__(self)
......
......@@ -300,4 +300,4 @@ max-module-lines=1300
# tab).
indent-string=' '
extension-pkg-whitelist=sip
extension-pkg-whitelist=sip,PySide2
......@@ -9,113 +9,119 @@ SPDX-License-Identifier: GPL-2.0
# pylint: disable=unused-import, no-name-in-module
from PyQt5 import uic
from PyQt5.QtCore import PYQT_VERSION_STR
from PyQt5.QtCore import QT_VERSION_STR
from PyQt5.QtCore import QAbstractAnimation
from PyQt5.QtCore import QAbstractItemModel
from PyQt5.QtCore import QAbstractTableModel
from PyQt5.QtCore import QByteArray
from PyQt5.QtCore import QCoreApplication
from PyQt5.QtCore import QCommandLineParser
from PyQt5.QtCore import QCommandLineOption
from PyQt5.QtCore import QLibraryInfo
from PyQt5.QtCore import QStandardPaths
from PyQt5.QtCore import QEasingCurve
from PyQt5.QtCore import QEvent
from PyQt5.QtCore import QEventLoop
from PyQt5.QtCore import QMetaObject
from PyQt5.QtCore import QMimeData
from PyQt5.QtCore import QModelIndex
from PyQt5.QtCore import QObject
from PyQt5.QtCore import QParallelAnimationGroup
from PyQt5.QtCore import QPersistentModelIndex
from PyQt5.QtCore import Qt
from PyQt5.QtCore import QPoint
from PyQt5.QtCore import QPointF
from PyQt5.QtCore import QPropertyAnimation
from PyQt5.QtCore import QRect
from PyQt5.QtCore import QRectF
from PyQt5.QtCore import QSize
from PyQt5.QtCore import QSizeF
from PyQt5.QtCore import QSocketNotifier
from PyQt5.QtCore import QTimer
from PyQt5.QtCore import QTranslator
from PyQt5.QtCore import QLocale
from PyQt5.QtCore import pyqtProperty
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QAbstractItemView
from PyQt5.QtWidgets import QAction
from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QBrush
from PyQt5.QtWidgets import QCheckBox
from PyQt5.QtGui import QColor
from PyQt5.QtWidgets import QComboBox
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QDialog
from PyQt5.QtWidgets import QDialogButtonBox
from PyQt5.QtGui import QDrag
from PyQt5.QtGui import QFont
from PyQt5.QtGui import QFontMetrics
from PyQt5.QtWidgets import QFormLayout
from PyQt5.QtWidgets import QFrame
from PyQt5.QtWidgets import QGraphicsItem
from PyQt5.QtWidgets import QGraphicsObject
from PyQt5.QtWidgets import QGraphicsRectItem
from PyQt5.QtWidgets import QGraphicsScene
from PyQt5.QtWidgets import QGraphicsSimpleTextItem
from PyQt5.QtWidgets import QGraphicsView
from PyQt5.QtWidgets import QGridLayout
from PyQt5.QtWidgets import QHBoxLayout
from PyQt5.QtWidgets import QHeaderView
from PyQt5.QtGui import QIcon
from PyQt5.QtGui import QImageReader
from PyQt5.QtCore import QItemSelectionModel
from PyQt5.QtWidgets import QLabel
from PyQt5.QtWidgets import QLineEdit
from PyQt5.QtWidgets import QListWidget
from PyQt5.QtWidgets import QListWidgetItem
from PyQt5.QtWidgets import QListView
from PyQt5.QtWidgets import QMainWindow
from PyQt5.QtWidgets import QMenu
from PyQt5.QtWidgets import QMessageBox
from PyQt5.QtGui import QPainter
from PyQt5.QtGui import QPalette
from PyQt5.QtGui import QPen
from PyQt5.QtGui import QPixmap
from PyQt5.QtGui import QPixmapCache
from PyQt5.QtWidgets import QProgressBar
from PyQt5.QtWidgets import QRadioButton
from PyQt5.QtWidgets import QPushButton
from PyQt5.QtWidgets import QScrollArea
from PyQt5.QtWidgets import QScrollBar
from PyQt5.QtWidgets import QSizePolicy
from PyQt5.QtWidgets import QSlider
from PyQt5.QtWidgets import QSpacerItem
from PyQt5.QtWidgets import QSpinBox
from PyQt5.QtWidgets import QSplitter
from PyQt5.QtWidgets import QStackedWidget
from PyQt5.QtWidgets import QStatusBar
from PyQt5.QtCore import QStringListModel
from PyQt5.QtWidgets import QStyle
from PyQt5.QtWidgets import QStyledItemDelegate
from PyQt5.QtWidgets import QStyleOption
from PyQt5.QtWidgets import QStyleOptionGraphicsItem
from PyQt5.QtWidgets import QStyleOptionViewItem
from PyQt5.QtWidgets import QTableView
from PyQt5.QtWidgets import QTableWidget
from PyQt5.QtWidgets import QTableWidgetItem
from PyQt5.QtWidgets import QTabWidget
from PyQt5.QtWidgets import QTextBrowser
from PyQt5.QtGui import QTextDocument
from PyQt5.QtWidgets import QTextEdit
from PyQt5.QtWidgets import QToolBar
from PyQt5.QtWidgets import QToolButton
from PyQt5.QtGui import QTransform
from PyQt5.QtWidgets import QTreeView
from PyQt5.QtWidgets import QVBoxLayout
from PyQt5.QtWidgets import QWidget
from PyQt5.QtGui import QValidator
from PyQt5.QtGui import QGuiApplication
from PyQt5.QtSvg import QGraphicsSvgItem
from PyQt5.QtSvg import QSvgRenderer
from qtpy import uic
try:
from qtpy.QtCore import PYQT_VERSION_STR
except ImportError:
PYQT_VERSION_STR = 'Pyside PYQT_VERSION_STR: TODO'
try:
from qtpy.QtCore import QT_VERSION_STR
except ImportError:
QT_VERSION_STR = 'Pyside QT_VERSION_STR: TODO'
from qtpy.QtCore import QAbstractAnimation
from qtpy.QtCore import QAbstractItemModel
from qtpy.QtCore import QAbstractTableModel
from qtpy.QtCore import QByteArray
from qtpy.QtCore import QCoreApplication
from qtpy.QtCore import QCommandLineParser
from qtpy.QtCore import QCommandLineOption
from qtpy.QtCore import QLibraryInfo
from qtpy.QtCore import QStandardPaths
from qtpy.QtCore import QEasingCurve
from qtpy.QtCore import QEvent
from qtpy.QtCore import QEventLoop
from qtpy.QtCore import QMetaObject
from qtpy.QtCore import QMimeData
from qtpy.QtCore import QModelIndex
from qtpy.QtCore import QObject
from qtpy.QtCore import QParallelAnimationGroup
from qtpy.QtCore import QPersistentModelIndex
from qtpy.QtCore import Qt
from qtpy.QtCore import QPoint
from qtpy.QtCore import QPointF
from qtpy.QtCore import QPropertyAnimation
from qtpy.QtCore import QRect
from qtpy.QtCore import QRectF
from qtpy.QtCore import QSize
from qtpy.QtCore import QSizeF
from qtpy.QtCore import QSocketNotifier
from qtpy.QtCore import QTimer
from qtpy.QtCore import QTranslator
from qtpy.QtCore import QLocale
from qtpy.QtCore import Property
from qtpy.QtCore import Signal
from qtpy.QtWidgets import QAbstractItemView
from qtpy.QtWidgets import QAction
from qtpy.QtWidgets import QApplication
from qtpy.QtGui import QBrush
from qtpy.QtWidgets import QCheckBox
from qtpy.QtGui import QColor
from qtpy.QtWidgets import QComboBox
from qtpy.QtGui import QCursor
from qtpy.QtWidgets import QDialog
from qtpy.QtWidgets import QDialogButtonBox
from qtpy.QtGui import QDrag
from qtpy.QtGui import QFont
from qtpy.QtGui import QFontMetrics
from qtpy.QtWidgets import QFormLayout
from qtpy.QtWidgets import QFrame
from qtpy.QtWidgets import QGraphicsItem
from qtpy.QtWidgets import QGraphicsObject
from qtpy.QtWidgets import QGraphicsRectItem
from qtpy.QtWidgets import QGraphicsScene
from qtpy.QtWidgets import QGraphicsSimpleTextItem
from qtpy.QtWidgets import QGraphicsView
from qtpy.QtWidgets import QGridLayout
from qtpy.QtWidgets import QHBoxLayout
from qtpy.QtWidgets import QHeaderView
from qtpy.QtGui import QIcon
from qtpy.QtGui import QImageReader
from qtpy.QtCore import QItemSelectionModel
from qtpy.QtWidgets import QLabel
from qtpy.QtWidgets import QLineEdit
from qtpy.QtWidgets import QListWidget
from qtpy.QtWidgets import QListWidgetItem
from qtpy.QtWidgets import QListView
from qtpy.QtWidgets import QMainWindow
from qtpy.QtWidgets import QMenu
from qtpy.QtWidgets import QMessageBox
from qtpy.QtGui import QPainter
from qtpy.QtGui import QPalette
from qtpy.QtGui import QPen
from qtpy.QtGui import QPixmap
from qtpy.QtGui import QPixmapCache
from qtpy.QtWidgets import QProgressBar
from qtpy.QtWidgets import QRadioButton
from qtpy.QtWidgets import QPushButton
from qtpy.QtWidgets import QScrollArea
from qtpy.QtWidgets import QScrollBar
from qtpy.QtWidgets import QSizePolicy
from qtpy.QtWidgets import QSlider
from qtpy.QtWidgets import QSpacerItem
from qtpy.QtWidgets import QSpinBox
from qtpy.QtWidgets import QSplitter
from qtpy.QtWidgets import QStackedWidget
from qtpy.QtWidgets import QStatusBar
from qtpy.QtCore import QStringListModel
from qtpy.QtWidgets import QStyle
from qtpy.QtWidgets import QStyledItemDelegate
from qtpy.QtWidgets import QStyleOption
from qtpy.QtWidgets import QStyleOptionGraphicsItem
from qtpy.QtWidgets import QStyleOptionViewItem
from qtpy.QtWidgets import QTableView
from qtpy.QtWidgets import QTableWidget
from qtpy.QtWidgets import QTableWidgetItem
from qtpy.QtWidgets import QTabWidget
from qtpy.QtWidgets import QTextBrowser
from qtpy.QtGui import QTextDocument
from qtpy.QtWidgets import QTextEdit
from qtpy.QtWidgets import QToolBar
from qtpy.QtWidgets import QToolButton
from qtpy.QtGui import QTransform
from qtpy.QtWidgets import QTreeView
from qtpy.QtWidgets import QVBoxLayout
from qtpy.QtWidgets import QWidget
from qtpy.QtGui import QValidator
from qtpy.QtGui import QGuiApplication
from qtpy.QtSvg import QGraphicsSvgItem
from qtpy.QtSvg import QSvgRenderer
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment