PDA

View Full Version : Best Practice - Qt Designer or Code?



kringen
22nd March 2012, 03:22
I've been browsing the examples in the Qt Creater application and am amazed at what can be created with no form designer.

One thing I noticed is that most of the project examples did not use the Qt Designer Ui forms. The majority of the widgets were added programmatically. I'm not sure if this is because it is the best practice or if it is due to keeping the examples simple. As a Visual Studio user, I'm used to having to place all objects in the designer and then go about making them work with actions.

My question as someone embarking on a new project is...What is the consensus best practice for applications built with Qt? Should I plan on the majority of windows and widgets being created and placed in the underlying code or do most applications use the designer?

Thanks in advance for your insights.

Lykurg
22nd March 2012, 06:14
It's a pure personal choice. I arrange widgets myself if they are small. In all other cases I use the designer because it is much easier and less work. And since the ui is transformed in a header file, you have no negative impact.

ChrisW67
23rd March 2012, 00:03
Personal preference as Lykurg says. I use both. In my current project, I code my main window which has little content until I load a range of plugins providing more complex widgets I have built with the aid of Designer.