From f1980a3317c1af410851585ba18eabc7939956ff Mon Sep 17 00:00:00 2001 From: Emanuele Cannizzaro Date: Sun, 29 Aug 2021 11:25:07 +0200 Subject: [PATCH 1/2] replaced Qt bindings to qtpy --- tablexplore/qt.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/tablexplore/qt.py b/tablexplore/qt.py index c576a1d..1a11be7 100644 --- a/tablexplore/qt.py +++ b/tablexplore/qt.py @@ -25,13 +25,7 @@ import sys -try: - from PySide2 import QtCore - from PySide2.QtWidgets import * - from PySide2.QtGui import * - from PySide2.QtCore import QObject, Signal, Slot -except: - from PyQt5 import QtCore - from PyQt5.QtWidgets import * - from PyQt5.QtGui import * - from PyQt5.QtCore import pyqtSignal as Signal, pyqtSlot as Slot +from qtpy import QtCore +from qtpy.QtWidgets import * +from qtpy.QtGui import * +from qtpy.QtCore import QObject, Signal, Slot From 3b3c54fd2c2cd169223681b4621b863955058c29 Mon Sep 17 00:00:00 2001 From: Emanuele Cannizzaro Date: Sun, 29 Aug 2021 11:26:21 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 63a22eb..edae6f4 100644 --- a/README.md +++ b/README.md @@ -58,19 +58,21 @@ https://www.youtube.com/watch?v=nscmtsG5SKQ ## Use the widget in Python ```python -from PySide2 import QtCore -from PySide2.QtWidgets import * -from PySide2.QtGui import * import pandas as pd +import sys + +from qtpy.QtCore import Qt, QRect +from qtpy.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget + from tablexplore import data, core, plotting, interpreter class TestApp(QMainWindow): def __init__(self, project_file=None, csv_file=None): QMainWindow.__init__(self) - self.setAttribute(QtCore.Qt.WA_DeleteOnClose) + self.setAttribute(Qt.WA_DeleteOnClose) self.setWindowTitle("Example") - self.setGeometry(QtCore.QRect(200, 200, 800, 600)) + self.setGeometry(QRect(200, 200, 800, 600)) self.main = QWidget() self.setCentralWidget(self.main) layout = QVBoxLayout(self.main) @@ -82,10 +84,10 @@ class TestApp(QMainWindow): return if __name__ == '__main__': - import sys app = QApplication(sys.argv) aw = TestApp() aw.show() + app.exec_() ```