qt - Sorting QObject children -


i noticed qobject::children() method return const reference qobjectlist, contains children of qobject. safe cast away constness , sort list qsort?

thanks anton

no, should not this. definition of qobject::children():

inline const qobjectlist &children() const { return d_ptr->children; } 

this means directly reference of internal objectlist. , documentation says:

note list order changes when qwidget children raised or lowered. widget raised becomes last object in list, , widget lowered becomes first object in list.

it looks bad idea mess list.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -