can I change SegmentList class into a derived class of QList?

• Sep 19, 2015 - 08:37

I tried to do a for loop using the new c++11 range-based for loop format "for (Segment *seg : measure->segments()) {" but noticed wouldn't compile because SegmentLists (https://github.com/musescore/MuseScore/blob/master/libmscore/segmentlis…) is currently manually-coded and lacks the begin & end iterators, which are necessary for the new c++11 range-based for loop format.

Can I change the code for SegmentList by making the class simply extend QList and remove the SegmentList::insert,push_back,push_front,remove,insert functions from the codebase (since they would be implemented by QList)?


Comments

You cannot replace SegmentList with a QList. Every Segment in SegmentList has a next() method which is used at various places. This does not work with QList which needs an explicit iterator.

Do you still have an unanswered question? Please log in first to post your question.