import sys from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * class App(QMainWindow): def __init__(self): super().__init__() self.title = 'Surface Selector' self.left = 10 self.top = 10 self.width = 800 self.height = 600 self.setWindowTitle(self.title) self.setGeometry(self.left, self.top, self.width, self.height) self.table_widget = MyTableWidget(self) self.setCentralWidget(self.table_widget) self.show() class MyTableWidget(QWidget): def __init__(self, parent): super(QWidget, self).__init__(parent) self.layout = QVBoxLayout(self) # Initialize and add tabs self.tabs = QTabWidget() self.tab1 = QWidget() self.tab2 = QWidget() self.tabs.resize(800,600) self.tabs.addTab(self.tab1,"Load File") self.tabs.addTab(self.tab2,"Select Surface") # Page 1 self.tab1.layout = QVBoxLayout(self) self.thing1 = QLabel(self) self.thing1.setText('Surface Selector') self.thing1.setAlignment(Qt.AlignCenter) self.button1 = QPushButton("Open file (.STP)") self.button1.clicked.connect(lambda: self.tabs.setCurrentIndex(1)) self.tab1.layout.addWidget(self.thing1) self.tab1.layout.addWidget(self.button1) self.tab1.setLayout(self.tab1.layout) # Page 2 self.tab2.layout = QVBoxLayout(self) self.thing2 = QLabel(self) pixmap2 = QPixmap('car1.png') # what I want is a 3D interactive viewer self.thing2.setPixmap(pixmap2) self.thing2.setAlignment(Qt.AlignCenter) self.button2 = QPushButton("Select Surface") self.button2.clicked.connect(self.output) self.tab2.layout.addWidget(self.thing2) self.tab2.layout.addWidget(self.button2) self.tab2.setLayout(self.tab2.layout) # Page 3 # see car2.png... # Add tabs to widget self.layout.addWidget(self.tabs) self.setLayout(self.layout) def output(self): print('output a step file of selected surfaces...') if __name__ == '__main__': app = QApplication(sys.argv) ex = App() sys.exit(app.exec_())