I am creating a GUI with PyQt5, in the main window I have a QFrame, after some calculations, a mesh is added to this object, however, not until I mouse-click while hovering on the QFrame area does the plotted mesh appear on the screen.
I am trying to make this automatic, so that once my mesh is calculated the QFrame updates and plots right away. Does anybody have any ideas on how to do this?
Important lines of code as I have them look like the lines below. In a separate file I have a class with all the properties of the GUI, from which the main class inherits. In the main class, the mesh is obtained and added to the QFrame.
when plotMesh() is called, the mesh is added to the QFrame, but I have to later click on the QFrame to se the image.
What I would like to happen is that the QFrame updates its content as soon as plotMesh() ends
class Ui_MainWindow(object):
def setupUi(self, MainWindow)
# ...
self.vtkFrame = QtWidgets.QFrame(self.layoutWidget)
# ...
# ...
import pyvista as pv
class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self, *args, **kwargs):
# ...
self.vtk_widget = pv.QtInteractor(self.vtkFrame)
# ...
# ...
def plotMesh()
# ...
r_vtk = XXX # XXX stands for functions and calculations
# to get the mesh
self.vtk_widget.add_mesh(r_vtk)
#...