Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -82,10 +84,10 @@ class TestApp(QMainWindow):
return

if __name__ == '__main__':
import sys
app = QApplication(sys.argv)
aw = TestApp()
aw.show()

app.exec_()
```

Expand Down
14 changes: 4 additions & 10 deletions tablexplore/qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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