A really stupid question - what is the MAXIMUM widgets I can have?
-
When my code gets too convoluted I generally build an new code and do not bother to delete the old stuff. Deleting creates "missing variables" and it is too time consuming to clean up...
I do not care if the unused stuff stays in the code - it is unused.
I run into "too many QEditText " widgets - my app started crashing.
So I deleted the widget causing the crash and went back to reusing some older code.The question is - is there areal limit in number of widgets in the application ?
I am using GUI "frame" as a wrapper to copy the containing widgets - but if there is a limit I need to modify my ways.
-
When my code gets too convoluted I generally build an new code and do not bother to delete the old stuff. Deleting creates "missing variables" and it is too time consuming to clean up...
I do not care if the unused stuff stays in the code - it is unused.
I run into "too many QEditText " widgets - my app started crashing.
So I deleted the widget causing the crash and went back to reusing some older code.The question is - is there areal limit in number of widgets in the application ?
I am using GUI "frame" as a wrapper to copy the containing widgets - but if there is a limit I need to modify my ways.
@AnneRanch said in A really stupid question - what is the MAXIMUM widgets I can have?:
The question is - is there areal limit in number of widgets in the application ?
There is no hard limit - I would guess it would be getting slow when you create more than thousands widgets (and showing them). Your crash is most likely not related to your amount of widgets but some other stuff (e.g. accessing invalid/already deleted pointers).
-
@AnneRanch said:
When my code gets too convoluted I generally build an new code and do not bother to delete the old stuff.
That's horrible.
Deleting creates "missing variables" and it is too time consuming to clean up...
That's also horrible.
I do not care if the unused stuff stays in the code - it is unused.
Still - compiles and takes time and space.
I run into "too many QEditText " widgets - my app started crashing.
I highly doubt the crash was caused by too many widgets.
The question is - is there areal limit in number of widgets in the application ?
Theoretically no. Practically, internally, I can imagine there might be some counter or a container somewhere, so you'd be limited by how big they can get. Probably some int so 2^32 or something like that.
Maximum number of widgets is not a realistic problem. It would be in millions if it exists. You'd be hitting an out of memory problem loooong before you'd reach that. From an application architecture point of view - if you have more widgets than you can actually fit onto screen at the same time then you probably have a serious design problem.
-
Windows has a limit on the number of user objects that a process can have, 10000. This includes windows (widgets) and other things. It is more complicated than just that number though; the system has an overall limit like 32768.
Pushing the Limits of Windows: USER and GDI Objects – Part 1
Pushing the Limits of Windows: USER and GDI Objects – Part 2Do not know for X11.
-
Windows has a limit on the number of user objects that a process can have, 10000. This includes windows (widgets) and other things. It is more complicated than just that number though; the system has an overall limit like 32768.
Pushing the Limits of Windows: USER and GDI Objects – Part 1
Pushing the Limits of Windows: USER and GDI Objects – Part 2Do not know for X11.
@ChrisW67 True, but Qt widgets are not native user objects by default. Top level windows and widgets for which you explicitly call
winId()become native, otherwise they're just C++ objects, of which there is no limit. And if an app has 10000 windows or native widgets created I would again say it has a bigger, architectural problem.