PDA

View Full Version : A gui made with QTdesigner is faster-better or slower-worse than a GUI build in code?



tonnot
20th September 2010, 18:20
I see that there is two ways to build a GUI, using QTdesigner (that maje a .ui file) and by 'hand'.
And I ask myself if there is a better way, thinking in time to compile, size of exe, performance of the program, etc.
Any idea ?

squidge
20th September 2010, 18:52
I believe it's just personal preference. Sure, you can type in the code yourself, but I don't think there's much difference either way. Since uic generates C++ code anyway, you can examine it and see the difference to how you would do it and then choose your path.

SixDegrees
20th September 2010, 23:31
In most cases, it is much faster in terms of development time to use the Designer for layout. It is also much less error-prone and much easier to maintain over long periods of time.

It is also a lot more fun, because layout coding by hand is pure, repetetive drudgery.

I haven't noticed any significant difference in code complexity that would lead to longer compilation times. It would take years, on the order of decades, for the compile time delta to outweigh the development time saved. In terms of runtime performance, you'll see no difference at all in terms of actual use; I suppose you could detect any small differences in a profiler, but the time it would take to perform such a measurement would be several orders of magnitude greater than the difference itself.

I'd only worry about such issues once a problem actually arises in real-world use, at which point you could profitably deploy a suite of analysis tools to track down the source of the problem. Until such a thing happened, though, I'd focus my concerns and efforts on producing good, maintainable code in the parts that have to be written by hand.