Short Description: Fixed Drawing anomaly in Qt4 Accounting WS: Account Labels Bug Number: n/a Release notes (y/n): no For Release Nums: 6.1 Qt4 Accounting WS: Drawing anomaly: Dragged SimObj wipes out Account Label SEE: http://cadswes2.colorado.edu/~philw/2010/Qt4AcctView/DragEraseProblem/ This problem was ultimately solved by changing the Account Graphics Item Label from a QGraphicsTextItem to a QGraphicsSimpleTextItem. In the course of searching for a solution, the three child QGraphicsItems (of SimObjGfxItems and AccountGfxItems) were conditionally reverted to _actual_ child items, instead of top-level QGraphicsItems (parented directly by the QGraphicsScene). That didn't turn out to address this problem, but the conditional changes are being retained in case we need to try this again for some other problem -- or if we want to (somehow) solve the Supplies- Obscuring-Labels-and-Icons problem in some other way. To revert the Icon and Label child items back to actual child items, change these definitions: FILE: SimObjGfxItem.cpp ... // Instantiate "child" Icon and Label as a top-level QGraphicsItems? static const bool UseSepObjIconItemForAccounting (true); static const bool UseSepObjLabelItemForAccounting (true); FILE: AccountGfxItem.cpp ... // Instantiate Label "child" as a top-level QGraphicsItem? static const bool UseSeparatedAccountLabelItem (true); -------------------------- QtUtils/AccountGfxItem.hpp QtUtils/AccountGfxItem.cpp -------------------------- Change base class of internal "label" text class: OLD: class AccountGfxItem::Label : public QGraphicsTextItem NEW: class AccountGfxItem::Label : public QGraphicsSimpleTextItem Note that AccountGfxItem::Label is no longer a QObject. QObject had been inherited from the QGraphicsTextItem base class. But QGraphicsSimpleTextItem does not have inherit QObject. ------------------------- QtUtils/SimObjGfxItem.cpp QtUtils/SimObjGfxItem.hpp ------------------------- While changing SimObjGfxItem::LabelItem class from a QGraphicsTextItem to a QGraphicsSimpleTextItem was tried, that change didn't turn out to be helpful. However, one lower-level change which was necessary to try that change was retained. The label-deletion notification from the label to the sort-of-parent "SimObjGfxItem" was changed from a Qt Signal/Slot notification to a method call from the LabelItem destructor. The latter is actually preferable, as that occurs sooner, while the C++ vtable for the LabelItem is still intact. OLD: void labelItemDestroyed (QObject*); // private slot NEW: void labelItemDeleted (const QGraphicsItem*); Also the SimObjGfxItem::LabelItem virtual method: QRectF boundingRect(), was reimplemented (from the base class). In the case of the item being "separated" (parented by the Scene instead of by the SimObjGfxItem), the bounding rectangle is made slightly larger. This didn't turn out to be relevant for this problem, but it is prudent. The issue is that the bounding rectangle MUST be AT LEAST as large as the area in which drawing occurs (in the paint() method implementation). ---