Short Description: Qt4 Accounting View: Account QGraphicsItem Features Bug Number: n/a Release notes (y/n): no, not yet. For Release Nums: 6.1 (1) Context menus implemented for SimObj "Regions" and Account Items, with just stubs for the Supply creation menu items. (2) Display Group properties implemented for SimObj "Regions" (background pattern/color and border color) and for Account Items (background pattern/ color, border color and shape width. One difference from the Qt3 implementation is that selected SimObj "Regions" are drawn with a DASHED border, with a contrasting black or white between the dashes. Note yet done: Account Item Labels don't have a drawn background. -------------------------- QtUtils/AccountGfxItem.hpp QtUtils/AccountGfxItem.cpp -------------------------- (1) Added configurable Account Item width (default: 100), and potentially, height (now: 35). int _width; int _height; (2) Added context menu support in class AccountGfxItem::Label : public QGraphicsTextItem: // Note: It is necessary to override the QGraphicsTextItem // implementations of these QGraphicsItem virtual methods and // explicitly 'ignore' these context menu and mouse events in // order for the containing QGraphicsItems to receive them. // // virtual from QGraphicsItem virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent*); virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent*); virtual void mouseMoveEvent (QGraphicsSceneMouseEvent*); virtual void mousePressEvent (QGraphicsSceneMouseEvent*); virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent*); (3) Account Items now drawn with display group background color/pattern outline color and width (default: 100). See implementation in: void AccountGfxItem::setStyle (const AccountDisplayInfo& info) void AccountGfxItem::paint (QPainter*, const QStyleOptionGraphicsItem* .. QColor getWsBgColor() const; <<< ADDED -------------------------- QtUtils/AcctRowGfxItem.hpp QtUtils/AcctRowGfxItem.cpp -------------------------- More complete dynamic Account Item rebuilding: Schedule a deferred rebuild of the Account items from these places: (a) SIMOBJ_ACCOUNT_DELETED callback. (b) Asynchronous acctItemAcctDeleted (const Account*) notificattion. In destructor: Stop and Delete the QTimer* _buildAccountItemsTimer ALSO: New support methods: const QMap& getAccountItemMapRef() { return (_accountItemMap); } QColor getWsBgColor() const; --------------------------- QtUtils/RwGraphicsScene.hpp QtUtils/RwGraphicsScene.cpp --------------------------- New support methods: // Return information about the "main" RwGraphicsView for this scene. RwGraphicsView* mainRwGraphicsView() const; double mainRwGraphicsViewZoomFactor() const; ------------------------- QtUtils/SimObjGfxItem.hpp QtUtils/SimObjGfxItem.cpp ------------------------- Implemented context menus for: (a) SimObj "Region" (in Accounting View), and (b) Account Items (within "Region"), including dynamically built "Display Group" submenus: Added: // Accounting SimObj "Region" style properties QBrush _regionBgBrush; // Qt::NoBrush == no background QColor _regionBorderColor; // void getAccountItemMap (QMap&, bool append=true) const; QColor getWsBgColor() const; For the dynamic "Display Group" submenus: OLD: QSignalMapper _contextGroupActionMapper; NEW: QSignalMapper _contextObjGroupActionMapper; NEW: QSignalMapper _contextAcctGroupActionMapper; OLD: int insertDspGroupActions (QMenu*); NEW: int insertObjDspGroupActions (QMenu*); NEW: int insertAcctDspGroupActions (QMenu*, Account*); Added context menu support in class SimObjGfxItem::LabelItem : public QGraphicsTextItem: // Note: It is necessary to override the QGraphicsTextItem // implementations of these QGraphicsItem virtual methods and // explicitly 'ignore' these context menu and mouse events in // order for the containing QGraphicsItems to receive them. // // virtual from QGraphicsItem virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent*); virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent*); virtual void mouseMoveEvent (QGraphicsSceneMouseEvent*); virtual void mousePressEvent (QGraphicsSceneMouseEvent*); virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent*); ----------------------------- QtUtils/WorkspaceGfxScene.hpp QtUtils/WorkspaceGfxScene.cpp ----------------------------- Removed irregular use of collection classes from Qt library, the "standard" library and our own home grown classes in favor of Qt, plus additions to support Accounting Graphics Items. OLD: void getSimObjMap (std::map&) const; void getSimObjItems (cwSlist&) const; void getSelSimObjItems (cwSlist&) const; void getLinkMap (std::map&) const; NEW: QMap getSimObjMap() const; QMap getAccountItemMap() const; QList getSimObjItems() const; QList getSelSimObjItems() const; QMap getLinkMap() const; New provisions for support of the Accounting workspace: virtual void reconfigureAccountItems() {} Expanded context-menu support: OLD: simObjGfxItem_contextGroupSelected (const QString& groupName); NEW: simObjGfxItem_contextObjGroupSelected (const QString& groupName); NEW: simObjGfxItem_contextAcctGroupSelected (const QString& groupName); Added -- plus supporting handlers (not listed). Account* _objSceneCtxAccount; QAction* _openAcctsSumAction; QAction* _editAccountAction; QAction* _openAccountAction; QAction* _delAccountAction; QAction* _addSupplyInOutAction; // STUB QAction* _addSupplyDivRetAction; // STUB QAction* _addSupplyTransAction; // STUB ------------------------------ QtUtils/SimulationGfxScene.hpp QtUtils/SimulationGfxScene.cpp ------------------------------ Added method for updating all AccountGfxItems. This virtual method implementation would be moved to QtUtils/AccountingGfxScene, when and if that is created. virtual void reconfigureAccountItems(); ---