Short Description: Qt4 Accounting Workspace Port: DONE. Z-Value problem fixed. Bug Number: n/a Release notes (y/n): YES, the whole thing. For Release Nums: 6.1 (1) Z-Value problem solution, "separating" three child items. (2) More consistent text-background colors: SimObj and Account labels. ... see method: AccountGfxItem::updateLabel(). (3) Layout change: SimObj "regions" in Accounting View ... the Label is to the RIGHT of the icon, instead of below. But there is still a vertical gap below the icon and label so that Supply Arrow Heads are not obscured. This new layout is configured with these symbols in SimObjGfxItem.cpp: static const bool InAccounting_SimObjLabelToRight (true); static const bool AddVerticalGapForSupplyArrows (true); More notes on the Z-Value change ... Three child QGraphicsItems have been "separated" from their parent items, and "promoted" as "top-level" items (belonging to the QGraphicsScene). This was done so that they wouldn't be obscured by Supply and Transfer Items, which themselves need to be drawn OVER the SimObjGfxItem (when uses as a "region" rectangle in the Accounting view). The three "separated" child items are: (1) SimObjGfxItem's SimObj Icon (2) SimObjGfxItem's SimObj Label (3) AccountGfxItem's Account Label These separated items are still managed -- at the application level -- by the SimObjGfxItem and AccountGfxItem. But at the QGraphicItem level, they are internally unrelated. So the management of those items needs to be more explicit -- not relying on the "composition" features had they been actual child items. This applies to: (1) Positioning of the child items. (This now must be done explicitly). (2) Life-cycle. They must be explicilty deleted (at the right time). One of the complex initialization problems is that the geometry for a SimObjGfxItem's "separated" child items can't be processed until the SimObjGfxItem is ADDED TO THE SCENE, which happens AFTER construction. So, "separated" children shouldn't created from the SimObjGfxItem constructor. Same for the AccountGfxItem and its separated label item. This work addresses the problem described on this webpage: https://cadswes2.colorado.edu/~philw/2010/Qt4AcctView/ZProblem/ This feature is now ENABLED in the 6.1 builds, with this change in QtGUI/Workspace.cpp: static const bool SHOW_QT4_ACC_WORKSPACE (true); ------------------------------ QtUtils/RwGraphicsItemDefs.hpp ------------------------------ // ************************************************************* // *** Z-Values for top-level (scene-level) QGraphicsItems *** // ************************************************************* #define ZValue_LinkGfxItem (1.0) #define ZValue_SimObjGfxItem (2.0) #define ZValue_SupplyGfxItem (3.0) #define ZValue_TransferGfxItem (3.0) #define ZValue_AccountGfxItem_Label (4.0) #define ZValue_SimObjGfxItem_Icon (4.0) // top-level item only in acc.. #define ZValue_SimObjGfxItem_Label (4.0) // top-level item only in acc.. ... Note that small fractional Z-values are added to some of these to ... implement SimObj Display Group "Layers". That functionality is ... necessarily compromized because the labels and SimObj icon now ... FLOAT ABOVE their "parents" (to be ABOVE Supplies and Transfers). ... See method: double SimObjGfxItem::objLayerZOffset() const; -------------------------- QtUtils/AccountGfxItem.hpp QtUtils/AccountGfxItem.cpp -------------------------- New AccountGfxItem methods: void updateLabelPos(); void deleteLabelItem(); void labelItemDeleted (AccountGfxItem::Label*); double objLayerZOffset() const; // for separated children New AccountGfxItem::Label data member: bool _isSeparatedChild; // parented by scene? Change in constructor, added parameter: Label (WorkspaceGfxScene*, AccountGfxItem*, bool isSeparatedChild); ... in fact, this class is currently always contructed with ... 'isSeparatedChild' as true. -------------------------- QtUtils/AcctRowGfxItem.hpp QtUtils/AcctRowGfxItem.cpp -------------------------- New methods: void setObjRegionBgColor (const QColor&); void updateAcctItemLabelPositions(); double objLayerZOffset() const; // for separated children ------------------------- QtUtils/SimObjGfxItem.hpp QtUtils/SimObjGfxItem.cpp ------------------------- New SimObjGfxItem data members: bool _childrenAdded; SimObjDisplayInfo _simObjDispInfo; New SimObjGfxItem methods: const SimObjDisplayInfo& getStyleRef() const { return _simObjDispInfo; } double objLayerZOffset() const; void updateChildIconItemPos (bool configRefresh=false); void updateChildLabelItemPos (bool configRefresh=false); void updateSeparatedChildPositions(); New SimObjGfxItem::IconItem and SimObjGfxItem::LabelItem members: WorkspaceGfxScene* _wsGfxScene; bool _isSeparatedChild; // parented by scene? bool isSeparatedChild() const { return _isSeparatedChild; } (plus constructor changes). See also new layout configuration constants: static const bool InAccounting_SimObjLabelToRight (true); static const bool AddVerticalGapForSupplyArrows (true); ---------------------------- QtUtils/LinkGfxItem.cpp QtUtils/SupplyGfxItem.cpp QtUtils/TransferGfxItem.cpp ---------------------------- Z-value Changes. ----------------------------- QtUtils/WorkspaceGfxScene.cpp ----------------------------- Initialization, clearing and Z-value changes. Also, added "wait cursor" to certain operations. ---------------------------- QtUtils/ArrowHeadGfxItem.hpp QtUtils/ArrowHeadGfxItem.cpp ---------------------------- Provided access to the hard-coded Arrow Head Width and Height with these two static methods: static int arrowWidth(); static int arrowLength();