from PyQt5.QtGui import * from PyQt5.QtWidgets import * from CustomFrame import * import os import datetime class MainWindow(QMainWindow): """docstring for Mainwindow""" def __init__(self, parent = None): super(MainWindow,self).__init__(parent) self.basic() self.Controller = ControlFrame() self.viewerFrame = ViewerFrame(self.Controller.OnAction) splitter= self.split_() self.setCentralWidget(splitter) def basic(self): #设置标题,大小,图标 self.setWindowTitle("RPC3DView") self.resize(490*2+300, 370*2) #self.setWindowIcon(QIcon("./image/Gt.png")) #居中显示 screen = QDesktopWidget().geometry() self_size = self.geometry() self.move(int((screen.width() - self_size.width())/2),int((screen.height() - self_size.height())/2)) def closeEvent(self, QCloseEvent): self.Controller.close() self.viewerFrame.close() #分割窗口 def split_(self): splitter = QSplitter(Qt.Horizontal) splitter.addWidget(self.viewerFrame) splitter.addWidget(self.Controller) splitter.setStretchFactor(0,11) splitter.setStretchFactor(1,4) return splitter def OnCloudHandle(self,clouds:pb.clouds): self.viewerFrame.DisplayCloud(clouds) def OnErrorHandle(self,info:str): self.Controller.DisplayErrorInfo(info)