-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make port value changes trigger modelindex updates #25
Comments
TreeItems shall connect to the Port value changed signal. |
Initial investigation shows that QAbstractItemModel::dataChanged shows a significant overhead when it is called multiple times each clock cycle (given that multiple ports have changed), so for now, reloading the visible parts of the model each clock cycle seems to be the most efficient. |
The core issue is that within Qt, data should be fully contained in a model, and any modifications to this data should be conducted through the model. So currently, the way to notify this is to tell the view to update all currently visible QModelIndex'es, which will then fetch the updated values from the model. This might be the most "effective" way to hacking around the fact that model data is externally modified. |
Currently, the entire Netlist/Register model is updated when the circuit is clocked - this is not scaleable.
model::data() should fetch values directly from their connected ports instead of this data being set during model initialization. Furthermore, a port emitting its updated signal should be connected to the specific treeItem (and QModelIndex) to update that specific index. This should allow us to completely remove the updateNetlistData() methods.
End goal is to remove the NetlistModelBase::invalidate() calls made in Netlist::reloadNetist()
The text was updated successfully, but these errors were encountered: