Short Description: Qt4 Accounting View Optimizations, esp. for model loading Bug Number: n/a Release notes (y/n): no For Release Nums: 6.1 Two major changes to address slowness of model load of Accounting models, especially those using Supply Display Groups. (1) Defer Supply creations until after the model load. (2) Don't apply Supply Display Group styles on a single-supply basis. Instead, batch all such needed Supply style updates into a single operation. -------------------------- QtUtils/AccountGfxItem.hpp QtUtils/AccountGfxItem.cpp -------------------------- Avoid unnecessary "updateSupplies" calls during model loading. (This is for creating "missing" Supply and Transfer graphics items, and updating all such items' end-points). See changes in methods: (1) void AccountGfxItem::schedUpdateSupplies() // Transfer Items Too (2) void AccountGfxItem::updateSuppliesTimeout() ----------------------------- QtUtils/WorkspaceGfxScene.hpp QtUtils/WorkspaceGfxScene.cpp ----------------------------- (1) Instead of applying Supply Display Group Styles to Supply and Transfer Graphics Items as they are created, schedule a deferred style update, and do required updates at once (with a single access to the list of prioritized Supply Display Groups). New data members: QTimer* _updateSupplyStylesTimer; bool _updateSupplyStyles_all; QSet _updateSupplyStyles_supplySet; New methods: void schedUpdateSupplyStyles (Supply*); // NULL means "ALL" void cancelUpdateSupplyStyles(); void updateSupplyStyles (bool calledFromTimeout=false); void updateSupplyStylesTimeout(); // Qt slot Removed method: void setSupplyStyle (Supply*); (2) Recoded these two methods. They used to search the entire QGrahpicsScene for SupplyGfxItems or TransferGfxItems. Now, instead, they find the SimObjGfxItem for the downstream SimObj, and call methods to drill down to the AccountGfxItems to search for the desired SupplyGfxItem or TransferGfxItem. SupplyGfxItem* getSupplyItem (Supply*) const TransferGfxItem* getTransferItem (Supply*) const -------------------------- QtUtils/SimObjGfxItem.hpp QtUtils/SimObjGfxItem.cpp QtUtils/AcctRowGfxItem.hpp QtUtils/AcctRowGfxItem.cpp QtUtils/AccountGfxItem.hpp QtUtils/AccountGfxItem.cpp -------------------------- Added: SupplyGfxItem* getSupplyItem (Supply*) const; TransferGfxItem* getTransferItem (Supply*) const; ---