views:

64

answers:

2

Hi,

I've just started working with Qt Creator and I want to write the UI.

My question is: what is the best way to write it? By drag and drop from widget box or writing code?

I've dragged some widgets and I saw that not all of build in QWidget like QIcon and QMultiLineEdit are in the widget box. How to add them?

Thanks!

A: 

You should use QT Designer whenever possible because it has loads of useful backend things, like automatic code generation for i18n widgets.

It considerably reduces the time cost of developing GUI's and also makes it easier.

Keep in mind that you can extend and add functionality to any design(widget(s)) you create in the designer and add new widgets that are not present in the Designer Widget list.

If you wish for a more tailored response on a specific issue you've encountered, than create a question tailored on that specific issue and we'll be happy to answer.

Jsz
+1  A: 

In my opinion, if you just started with Qt, it could be a good thing if you have the time to make a simple UI/Program that you all write manually, not using Qt Creator a single bit. I completely agree that Qt Creator is faster to build your UI, but you can learn more about the mechanics of the QWidget, QMainWindow, QLayout, etc. classes by doing it manually at least once. It could really help you if you get a problem to know a bit more details than to drag-and-drop widgets one on the other.

Of course, if you don't have any ideas on how to write a UI in Qt, you could create a simple UI in Qt Creator and look at how it is coded and try to reproduce something similar on your own.

Hope this helps.

Live