40 QList<T>
findInRange(
double x,
double y,
double w=0,
double h=0);
50 void clear(
bool autoDelete=
true);
99 if (static_cast<CADrawable*>(elt)->xPos() + static_cast<CADrawable*>(elt)->width() > _maxX)
101 if (static_cast<CADrawable*>(elt)->yPos() +
static_cast<CADrawable*
>(elt)->height() > _maxY)
102 _maxY = static_cast<CADrawable*>(elt)->
yPos() +
static_cast<CADrawable*
>(elt)->height();
109 template <
typename T>
113 return _list.removeAll(elt);
121 template <
typename T>
124 for (
int i=0; i<_list.size(); i++) {
125 if (static_cast<CADrawable*>(_list.at(i))->bBox().contains(x,y)) {
128 if (autoDelete)
delete elt;
143 template <
typename T>
146 for (
int i=0; i<_list.size(); i++)
157 template <
typename T>
161 for (
int i=0; i<_list.size(); i++) {
162 if ( ((static_cast<CADrawable*>(_list[i])->xPos() <= x+w) &&
163 (static_cast<CADrawable*>(_list[i])->yPos() <= y+h) &&
164 (static_cast<CADrawable*>(_list[i])->xPos() + static_cast<CADrawable*>(_list[i])->width() >= x) &&
165 (static_cast<CADrawable*>(_list[i])->yPos() + static_cast<CADrawable*>(_list[i])->height() >= y)) ||
166 ((
static_cast<CADrawable*
>(_list[i])->width() == 0) &&
167 (static_cast<CADrawable*>(_list[i])->yPos() <= y+h) &&
168 (static_cast<CADrawable*>(_list[i])->yPos() +
static_cast<CADrawable*
>(_list[i])->height() >= y)) ||
169 ((
static_cast<CADrawable*
>(_list[i])->height() == 0) &&
170 (static_cast<CADrawable*>(_list[i])->xPos() <= x+w) &&
171 (static_cast<CADrawable*>(_list[i])->xPos() +
static_cast<CADrawable*
>(_list[i])->width() >= x))
185 template <
typename T>
187 return findInRange(rect.x(), rect.y(), rect.width(), rect.height());
198 template <
typename T>
205 for (i=0; i < _list.size(); i++) {
206 if ( static_cast<CADrawableMusElement*>(_list[i])->musElement() &&
207 ( !elt || (timeBased?(
static_cast<CADrawable*
>(_list[i]))->xPos():(
static_cast<CADrawable*
>(_list[i]))->xPos()) > (timeBased?elt->
xPos():elt->
xPos()) ) &&
208 ( ( timeBased?(
static_cast<CADrawable*
>(_list[i]))->xPos():(
static_cast<CADrawable*
>(_list[i]))->xPos() ) < x) &&
212 !(static_cast<CADrawableMusElement*>(_list[i]))->musElement()->isPlayable() &&
213 ((
static_cast<CADrawableMusElement*
>(_list[i]))->musElement()->context() == voice->
staff() && voice->
contains(static_cast<CADrawableMusElement*>(_list[i])->musElement()))
215 (static_cast<CADrawableMusElement*>(_list[i]))->musElement()->isPlayable() &&
224 return static_cast<T
>(elt);
235 template <
typename T>
242 for (i=0; i < _list.size(); i++) {
243 if ( static_cast<CADrawableMusElement*>(_list[i])->musElement() &&
244 ( !elt || (timeBased?(
static_cast<CADrawable*
>(_list[i]))->xPos():(
static_cast<CADrawable*
>(_list[i]))->xPos()) < (timeBased?elt->
xPos():elt->
xPos()) ) &&
245 ( ( timeBased?(
static_cast<CADrawable*
>(_list[i]))->xPos():(
static_cast<CADrawable*
>(_list[i]))->xPos() ) > x) &&
249 !(static_cast<CADrawableMusElement*>(_list[i]))->musElement()->isPlayable() &&
250 ((
static_cast<CADrawableMusElement*
>(_list[i]))->musElement()->context() == voice->
staff() && voice->
contains((static_cast<CADrawableMusElement*>(_list[i]))->musElement()))
252 (static_cast<CADrawableMusElement*>(_list[i]))->musElement()->isPlayable() &&
261 return static_cast<T
>(elt);
272 template <
typename T>
279 for (i=0; i<_list.size(); i++) {
280 if ( ((!elt) || ((static_cast<CADrawable*>(_list[i])->yPos() + static_cast<CADrawable*>(_list[i])->height()) > (elt->
yPos() + elt->
height())))
281 && ((static_cast<CADrawable*>(_list[i])->yPos()+
static_cast<CADrawable*
>(_list[i])->height()) < y) ) {
285 return static_cast<T
>(elt);
297 template <
typename T>
304 for (i=0; i<_list.size(); i++) {
305 if ( ((!elt) || (static_cast<CADrawable*>(_list[i])->yPos() < elt->
yPos())) && (
static_cast<CADrawable*
>(_list[i])->yPos() > y) ) {
310 return static_cast<T
>(elt);
317 template <
typename T>
326 template <
typename T>
336 template <
typename T>
340 for (
int i=0; i<_list.size(); i++) {
341 if (static_cast<CADrawable*>(_list[i])->xPos() +
static_cast<CADrawable*
>(_list[i])->width() > _maxX)
342 _maxX = static_cast<CADrawable*>(_list[i])->xPos() +
static_cast<CADrawable*
>(_list[i])->width();
343 if (static_cast<CADrawable*>(_list[i])->yPos() +
static_cast<CADrawable*
>(_list[i])->height() > _maxY)
344 _maxY = static_cast<CADrawable*>(_list[i])->
yPos() +
static_cast<CADrawable*
>(_list[i])->height();
352 template <
typename T>
354 for (
int i=0; i<tree->
list().size(); i++)
355 _list += tree->
list().at(i)->clone();