-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathQtViewer.py
43 lines (32 loc) · 1014 Bytes
/
QtViewer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
class QtViewer(QWidget):
# Constructor
def __init__(self):
super(QtViewer, self).__init__()
self.viewer = None
# Destructor
def closeEvent(self, QCloseEvent):
super().closeEvent(QCloseEvent)
self.viewer.Finalize()
# Initialize the UI
def _init_UI(self):
# Set up the layouts
self.mainLayout = QVBoxLayout()
self.topLayout = QHBoxLayout()
self.topLayout.addWidget(self.viewer)
self.mainLayout.addLayout(self.topLayout)
self.setLayout(self.mainLayout)
# Connect signals and slots
def connect(self):
pass
# Getters and setters
def get_viewer(self):
return self.viewer
# Connect on data
def connect_on_data(self, path):
self.viewer.connect_on_data(path)
# Render the viewer
def render(self):
self.viewer.render()