I am developing a GUI with PyQt. The GUI has qListWidget, qTableWidget, and a plot implemented with Mayavi. The list refers to figures that are plotted (for example, cylinders and cones). When a figure is selected in the list, I want the form properties to be loaded into the table (from the dictionary variable) and the figure highlighted on the chart. I have a Mayavi job that works perfectly. In addition, if the table is edited, I need a form that needs to be redrawn to reflect the new property value (for example, for a cylinder, if the radius is changed).
So, when a list item is selected โ update the table using the properties of the item (from the dictionary variable), highlight the item in the graph
When the table is edited -> update the dictionary variable and redo the item
Problem: when I select a list item and load data into a table, the qTableWidget ItemChanged signal is triggered every time the cell is updated, which causes the form to be rebuilt repeatedly with incomplete data.
Is there a typical way to disable the GUI event loop when updating a table? (I have experience with Excel VBA, in this context the Application.EnableEvents = False parameter will prevent the WorksheetChange event from being triggered every time the cell is updated.) Should I have a "table update" variable to prevent actions from occurring while updating the table? Is there a way to update a table widget at the same time, rather than an item by position? (I agree that I intentionally avoid the Model-View framework at the moment, hence qListWIdget and qTableWidget).
Any suggestions?
This is my first time poster, but for a long time StackOverflow, so I just want to say thanks in advance for being such an amazing community!
source share