Short Description: Aggregation of Accounts in Items, Display Group Setting Bug Number: n/a Release notes (y/n): no For Release Nums: 6.1 (1) Aggregation of Account Items implemented, based on a toggle in Account Display Groups. If enabled, all Accounts on a SimObj (or its Elements) which are part of such a Display Group are represented in a graphics item for that Display Group. (2) Special drawing for Aggregated Account Icons. These consist of one or two representative Account Types of actual Account Instances in the Group. (3) In AccountGfxItems LABELS, a background color contrasting with the user-configured text color is drawn in a rectangle behind the text. (The background rectangle is either white or black, depending on the brightness of the text color). A more precise rectangle geometry is computed than that which had been implemented for the SimObj label was devised, and that computation was applied also to the SimObj label. (4) Double-clicking on an Account Graphics Item shows the Edit Account dialog for that item's Account (or the first Account of that item, if it represents more than one). (5) In the Accounting View, physical links are hidden unless they are enabled in the Display Group Editor "Preferences" menu. ------------------ AccountGfxItem.hpp AccountGfxItem.cpp ------------------ Special drawing for Aggregated Account Icons. The general QPainterPath "shape" is also represented as two distinct QPainterPaths used specifically for drawing. mutable QPainterPath _shapePath; // full shape, returned by shape() mutable QPainterPath _shape1; // drawn shape 1 mutable QPainterPath _shape2; // drawn shape 2 (May be Null) Added Account icon drawing helper functions: unsigned int firstAcctTypeId() const; unsigned int secondAcctTypeId() const; static void addStorShapeToPath (QPainterPath&, int w, int h, ... static void addPassShapeToPath (QPainterPath&, int w, int h, ... static void addDiveShapeToPath (QPainterPath&, int w, int h, ... static void addInstShapeToPath (QPainterPath&, int w, int h, ... All notifications to the containing AcctRowGfxItem are now delivered through Qt signals. The latter two were added: signals: void accountGfxItemDeleted (const AccountGfxItem*); void aggChangeDetected (const AccountGfxItem*); void widthChangeDetected (const AccountGfxItem*); class AccountGfxItem::Label, enhancements for more precise background rectangle drawn below the text. Added: QString _text; QBrush _bgBrush; // Qt::NoBrush == no background void setLabelText (const QString&); QString labelText() const { return _text; } // For opaque background drawing. Use Qt::NoBrush for no background. void setBgBrush (const QBrush&, bool doUpdate=true); // virtual from QGraphicsItem virtual void paint (QPainter*, const QStyleOptionGraphicsItem*, QWidget*); ------------------ AcctRowGfxItem.hpp AcctRowGfxItem.cpp ------------------ Aggregation of multiple Accounts within a single AccountGfxItem is implemented during building of the sequence AccountGfxItems. As each Account is considered, if there already exists an AccountGfxItem in which the Account should be aggregated, the Account is "added" to that item instead of creating a new AccountGfxItem for that Account. See changes in method: void AcctRowGfxItem::buildAccountItems (bool calledFromTimeout) Since "aggregation" is a property of the highest-priority Account Display Group to which each Account belows, it was very awkward to build the sequence of QGraphicItems BEFORE applying Display Group styles (as is sort of inherent in the overall legacy hyper-event-driven architecture). I added a utility to return an Account's applicable Account Display Group. // Display Group utilies static const AccountGroup* acctGroupForAccount (Account*); Also, some preparation for supporting individual Account context menu operations on Aggregate Account Items. const QList& getAccountListRefAtScenePos (const QPointF&) const; ... For notification from AccountGfxItems when they detect an Aggregation Change. The AggRowGfxItem responds by scheduling a rebuild operation: void aggChangeDetected (const AccountGfxItem*); // Qt slot ALSO: in AcctRowGfxItem::mouseDoubleClickEvent (QGraphicsSceneMouseEvent*) ... Open the Edit Account Dialog for the item's (first) Account. --------------------- SimObjGfxItem.hpp SimObjGfxItem.cpp WorkspaceGfxScene.cpp WorkspaceGfxScene.hpp --------------------- Changes in methods in preparation for additional context sub-menus for aggregated account items (representing more than one account): Changes or added methods: const QList& getAccountListRefAtScenePos (const QPointF&) const; void showAcctContextMenu (const QList&, const QPoint& screenPos); ALSO: Enhancements to the SimObjGfxItem to more precisely draw a background rectangle behind the label text. ---------------------- SimulationGfxScene.cpp ---------------------- In method: SimulationGfxScene::reconfigureLinkItems(), in the Accounting View, hide Physical Links unless they are enabled in the Display Group Editor "Preferences". ---