def __init__(self): """Constructor""" super(MainWindow, self).__init__() # Load user interface from UI-file loadUi('exmqt6.ui', self) # Query for figure class name Figure = cfv.figureClass() # Create figure widgets to insert in UI self.figGeometry = Figure(self) self.figElementValues = Figure(self) self.figDisplacements = Figure(self) # Insert widgets in gridLayout self.gridLayout.addWidget(self.figGeometry._widget, 0, 0) self.gridLayout.addWidget(self.figElementValues._widget, 0, 1) self.gridLayout.addWidget(self.figDisplacements._widget, 1, 0) # Create our problem instance self.problem = PlaneStress2DProblem()
def __init__(self): """Konstruktor""" super(MainWindow, self).__init__() # Load user interface from UI-file loadUi('viscon.ui', self) # Create figure class Figure = cfv.figureClass() #Skapa figurer för förhandsvisning av geo, mesh, initialspänningar self.figGeometry = Figure(self) self.figMesh = Figure(self) self.figInitial = Figure(self) self.middleLayout.addWidget(self.figGeometry._widget, 20) self.middleLayout.addWidget(self.figMesh._widget, 20) self.middleLayout.addWidget(self.figInitial._widget, 20) #Figurer för resultat self.figPress = Figure(self) self.figuvec = Figure(self) self.figsigvec = Figure(self) self.resLayout1.addWidget(self.figPress._widget, 20) self.resLayout2.addWidget(self.figuvec._widget, 20) self.resLayout2.addWidget(self.figsigvec._widget, 20) #Koppla menyval till händelser self.actionNew.triggered.connect(self.onActionNew) self.actionOpen.triggered.connect(self.onActionOpen) self.actionSave.triggered.connect(self.onActionSave) self.actionSaveas.triggered.connect(self.onActionSaveas) self.actionExit.triggered.connect(self.onActionExit) #Koppla reglage, knappar etc till händelser self.comboBox.currentIndexChanged.connect(self.onDirectionChanged) self.timeSlider.valueChanged.connect(self.onTimeChanged) self.localSlider.valueChanged.connect(self.onLocalChanged) self.meshSlider.valueChanged.connect(self.onMeshChanged) self.meshSlider.setMinimum(2) self.meshSlider.setMaximum(10) self.meshSlider.setTickPosition(QSlider.TicksBelow) self.meshSlider.setTickInterval(1) # --- Visa fönster self.show() self.raise_() # --- Hämta värden från initModel och uppdatera kontrollerna med dessa self.initModel() self.updateControls()
def __init__(self): """Constructor""" super(MainWindow, self).__init__() # Load user interface from UI-file loadUi('exmqt1.ui', self) Figure = cfv.figureClass() self.fig1 = Figure(self) self.fig2 = Figure(self) self.gridLayout.addWidget(self.fig1._widget, 0, 0) self.gridLayout.addWidget(self.fig2._widget, 0, 1) print(self.fig1._widget)