Short Description: Qt4 Accounting View: Account Graphics Item Reordering Bug Number: n/a Release notes (y/n): no, not yet. For Release Nums: 6.1 Dragging an Account Item right or left over another Account Item in the same Simulation Object "Region" (rectangle) causes the positions of those two Account Items to be swapped. Note that Account item ordering is recorded in the "display position" property on Accounts (via int Account::getPosition() and Account:: setPosition(int) methods). -------------------------- QtUtils/AcctRowGfxItem.hpp QtUtils/AcctRowGfxItem.cpp -------------------------- New data member: AccountGfxItem* _draggingAcctItem; // not owned here. New method: AccountGfxItem* acctItemAtScenePos (const QPointF&) const; Reordering operation is implemented in these three methods: void AcctRowGfxItem::mouseMoveEvent (QGraphicsSceneMouseEvent* evt) void AcctRowGfxItem::mousePressEvent (QGraphicsSceneMouseEvent* evt) void AcctRowGfxItem::mouseReleaseEvent (QGraphicsSceneMouseEvent* evt) In method AcctRowGfxItem::removeAccount (const Account*), if the Account corresponds to AccountGfxItem* _draggingAcctItem, wipe out that variable. ALSO: Fixes to AcctRowGfxItem::buildAccountItems() to apply the default style to newly created AccountGfxItems (for added Accounts). -------------------------- QtUtils/AccountGfxItem.hpp QtUtils/AccountGfxItem.cpp -------------------------- Added methods: virtual Account* firstAccount() const { return _account; } virtual int displayPosition() const; virtual void setDisplayPosition (int pos); Note: these methods are virtual, in anticipation of the AggAccountGfxItem (aggregated account item), to be developed soon. ====================== Short Description: Tweak to Account Item Reordering: Disable on Lock, etc. Bug Number: n/a Release notes (y/n): no For Release Nums: 6.1 Don't initiate an Account Graphics Item drag (for reordering) in these cases: (1) The clicked mouse button is not the main ("left") button, (2) Workspace icons are locked, (3) The model is a Scenario Baseline model, or (4) In a RiverWare Viewer session. See changes in method: void AcctRowGfxItem::mousePressEvent (QGraphicsSceneMouseEvent*); ---