Changeset 8c076a for src/UIElements/Views/Qt4/QtShapeList.cpp
- Timestamp:
- May 5, 2016, 5:14:19 PM (10 years ago)
- Children:
- 4a33f6
- Parents:
- fa6af2
- git-author:
- Frederik Heber <heber@…> (05/05/16 11:46:01)
- git-committer:
- Frederik Heber <heber@…> (05/05/16 17:14:19)
- File:
-
- 1 edited
-
src/UIElements/Views/Qt4/QtShapeList.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/QtShapeList.cpp
rfa6af2 r8c076a 55 55 QtShapeList::QtShapeList(QWidget * _parent) : 56 56 QTreeWidget (_parent), 57 Observer("QtShapeList") 57 Observer("QtShapeList"), 58 observed_shaperegistry(ShapeRegistry::getPointer()) 58 59 { 59 60 setColumnCount(COLUMNCOUNT); … … 70 71 refill(NULL); 71 72 72 ShapeRegistry::getInstance().signOn(this);73 ShapeRegistry::getInstance().signOn(this, ShapeRegistry::ShapeInserted);74 ShapeRegistry::getInstance().signOn(this, ShapeRegistry::ShapeRemoved);75 ShapeRegistry::getInstance().signOn(this, ShapeRegistry::SelectionChanged);73 observed_shaperegistry->signOn(this); 74 observed_shaperegistry->signOn(this, ShapeRegistry::ShapeInserted); 75 observed_shaperegistry->signOn(this, ShapeRegistry::ShapeRemoved); 76 observed_shaperegistry->signOn(this, ShapeRegistry::SelectionChanged); 76 77 77 78 connect(this,SIGNAL(itemSelectionChanged()),this,SLOT(rowSelected())); … … 80 81 QtShapeList::~QtShapeList() 81 82 { 82 ShapeRegistry::getInstance().signOff(this); 83 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::ShapeInserted); 84 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::ShapeRemoved); 85 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::SelectionChanged); 83 if(observed_shaperegistry) { 84 observed_shaperegistry->signOff(this); 85 observed_shaperegistry->signOff(this, ShapeRegistry::ShapeInserted); 86 observed_shaperegistry->signOff(this, ShapeRegistry::ShapeRemoved); 87 observed_shaperegistry->signOff(this, ShapeRegistry::SelectionChanged); 88 } 86 89 } 87 90 … … 90 93 void QtShapeList::recieveNotification(Observable *publisher, Notification_ptr notification) 91 94 { 92 if ( static_cast<ShapeRegistry*>(publisher) == ShapeRegistry::getPointer()) {95 if (publisher == observed_shaperegistry) { 93 96 switch (notification->getChannelNo()) { 94 97 case ShapeRegistry::ShapeInserted: … … 150 153 #endif 151 154 152 void QtShapeList::subjectKilled(Observable *publisher) { 155 void QtShapeList::subjectKilled(Observable *publisher) 156 { 157 if (publisher == observed_shaperegistry) 158 observed_shaperegistry = NULL; 159 else 160 ASSERT(0, "QtShapeList::subjectKilled() - unknown publisher " 161 +toString(publisher)); 153 162 } 154 163
Note:
See TracChangeset
for help on using the changeset viewer.
