PDA

View Full Version : Do you use the designer, or do you code your gui manually?



Kumosan
1st April 2007, 23:41
Just for pure curiosity.
Who is using the designer. Why? Why not? Always?

jacek
1st April 2007, 23:56
Similar polls from the past, just for reference:
http://www.qtcentre.org/forum/f-qt-programming-2/t-qt-designer-coding-by-hand-3099.html
http://www.qtcentre.org/forum/f-qt-programming-2/t-qt-designer-or-writing-by-hand-5936.html

and, yes, I do use Qt Designer all the time.

Kumosan
2nd April 2007, 00:00
Hmm, a third might be a bit much. Perhaps this thread should be deleted.

jacek
2nd April 2007, 00:21
Hmm, a third might be a bit much. Perhaps this thread should be deleted.
I don't know, compare the results of previous polls --- they're contradictory.

Kumosan
2nd April 2007, 00:50
Depends probably on the exact wording of the poll questions. But it is strange.

Brandybuck
2nd April 2007, 19:24
I use the Designer. I avoided it in Qt3, but changed my mind in Qt4. The Qt3 Designer created widgets, which meant I was always subclassing an autogenerated class. But with the new UI form classes this is not a problem. I can treat the UI as a true object, and use it the way I want to use it. I typically use the UI as a private data member, but sometimes use multiple inheritance instead. The second problem with Qt3 was that it generated "messy" code (imho). But Qt4 Designer generates very clean sensible code.

I did have one GUI a couple of months ago that was too complicated for Designer. I needed to use a couple of custom layout managers in it, and some "hand tweaking", to make lay it out correctly. But that's the exception.

I don't put everything in a single UI file, though. I tend to split it up. The main window, menus and toolbars will be one UI file, and the central widget antoher UI file. If I have a tabbed widget, then every page will be a separate UI file. Etc.

Designer has proven to be a huge timesaver.

BrainB0ne
11th April 2007, 16:33
I always use the designer to design my GUI's, but only the layout.... for functionality i use the subclassing method with Visual Studio 6 as IDE.

croftj
1st May 2007, 03:58
Depends, In some cases, I do them within the program, usually this is in the case where the elements in the dialog my change dynamically. Otherwise, the designer is my friend.

KShots
1st May 2007, 19:21
I use designer when it's convenient. Some things, like toolbars and such, must be done programmatically (designer has no such functionality in v4), but I don't complain too much there - it's a simple matter. Other things, like truly dynamic menuing systems, obviously cannot be done through designer due to their dynamic nature (for example, a list of pushbuttons that gets populated based on what plugins the user has loaded).

Some things are possible to do in designer, but are very awkward. For example, creating a widget to insert into a bunch of other widgets (re-using functionality). Designer provides this functionality, but you must manually edit the .ui file to properly include it. Much easier to just design the thing via code, though you can of course design the shared portion using designer rather easily.

Of course, most simple widgets and dialogs benefit greatly from designer - being able to see exactly how everything gets placed, how certain modifications look in real-time, etc - it's a valuable resource.

Michiel
21st May 2007, 13:42
I use Designer if Designer can do what I want. But I find it extremely limited.

If I want a combobox in a toolbar, for example, I'm out of luck. Or if I want to assign a QIcon with different states to an action, instead of a single image. Or if I want to lay-out the status-bar. Or if I want to set my own central widget.

The code would be a lot cleaner if you could do more in Designer.

wysota
21st May 2007, 14:34
If I want a combobox in a toolbar, for example, I'm out of luck.
True, but this is quite easily implementable, so it's highly probable we'll have access to QWidgetAction objects from Designer.

Or if I want to assign a QIcon with different states to an action, instead of a single image.
I think this one is possible to do with current Designer, but I'd have to check how it assigns icons to widgets.

Or if I want to lay-out the status-bar.
True, but this is easily doable by combining two Designer generated widgets and not more than five lines of code.


Or if I want to set my own central widget.
Hmm... This one you certainly can do within Designer, especially with the help of custom widgets.


The code would be a lot cleaner if you could do more in Designer.
True, but it'd start to get difficult to use the tool.

Michiel
21st May 2007, 14:49
I think this one is possible to do with current Designer, but I'd have to check how it assigns icons to widgets.

Looks to me like you can only select one file or one resource.


True, but this is easily doable by combining two Designer generated widgets and not more than five lines of code.

Hm.. Could you explain this? Right now I do it with only 4 lines of code, without using designer.


Hmm... This one you certainly can do within Designer, especially with the help of custom widgets.

In Designer, the central widget is a QWidget, which is the parent of my real main widget. This is all in Designer, but it's a bit of a waste to have a QWidget that doesn't really do anything.

Or I can use the setCentralWidget() function in the code. This costs extra lines of code to create the widget, set its properties and make it the central widget.


True, but it'd start to get difficult to use the tool.

True, but I don't think we're at that point yet. Right now, many more features could be added without sacrificing simplicity.

wysota
21st May 2007, 15:03
Looks to me like you can only select one file or one resource.
There are other ways to assign pixmaps.


Hm.. Could you explain this? Right now I do it with only 4 lines of code, without using designer.
You can certainly implement your statusBar widget in Designer and then just assign it to the status bar using code. There is also a high chance you could use QStatusBar as the base for your form in Designer and then just replace the default bar with yours with a single line of code. If not, then it's just a matter of subclassing QStatusBar to introduce proper functionality.


In Designer, the central widget is a QWidget, which is the parent of my real main widget. This is all in Designer, but it's a bit of a waste to have a QWidget that doesn't really do anything.
That's not much of a waste, isn't it? I'm sure you can spare extra 100 bytes of memory. It's just a pitty you can't promote the default central widget to the proper widget. But maybe that's a suggestion for Trolltech to do it. Should take them not more than 15 minutes to do that.


True, but I don't think we're at that point yet. Right now, many more features could be added without sacrificing simplicity.

I'm sure there are features in Designer which you have not discovered yet :)

Edit: I just checked and confirmed it's possible to assign whatever icons you want from within Designer.

Michiel
23rd May 2007, 15:59
You can certainly implement your statusBar widget in Designer and then just assign it to the status bar using code. There is also a high chance you could use QStatusBar as the base for your form in Designer and then just replace the default bar with yours with a single line of code. If not, then it's just a matter of subclassing QStatusBar to introduce proper functionality.

Too much trouble. Right now, I only have two QLabels inside the statusbar. And I only require 4 lines of code (6 if you include the member var declarations) to put them there. I simply think you should be able to drag them (and maybe progressbars, etc.) to the statusbar in Designer.


That's not much of a waste, isn't it? I'm sure you can spare extra 100 bytes of memory. It's just a pitty you can't promote the default central widget to the proper widget. But maybe that's a suggestion for Trolltech to do it. Should take them not more than 15 minutes to do that.

You're right, it's not much of a waste. And I'll sacrifice those 100 bytes to be able to do as much as possible in Designer. I simply think that you should be able to remove any unnecessary layers of code. As you say, it's probably not hard to implement this one.


I'm sure there are features in Designer which you have not discovered yet :)

I don't think so. Don't misunderstand. I love Designer. It's clean, easy to use and elegant. But there are improvements to be made. You can't take full advantage of the features of Qt 4 in Designer.


Edit: I just checked and confirmed it's possible to assign whatever icons you want from within Designer.

Well, don't keep it to yourself. :) How do I assign a QIcon (with different sizes + enabled/disabled states) to a QAction from within Designer?

wysota
23rd May 2007, 20:51
Well, don't keep it to yourself. :) How do I assign a QIcon (with different sizes + enabled/disabled states) to a QAction from within Designer?

You use the "pixmap function" feature of Designer.

BTW. I don't say Designer is perfect. See the posts about UIC and container plugins on my blog (http://blog.wysota.eu.org).

Chuk
5th June 2007, 23:49
I use Designer for QMainWindow and QDialogs. I find it handy to get the layout right, especially when I want to stretch "correctly", whatever that is depending on the dialog. It helps to connect simple signals/slots such as pressing enter in a text edit box to activate the Apply button. It makes it very easy to write code with the automatic slot naming, such as on_QSpinBox_valueChanged(int ID).

The times I write code are when the contents change.. such as a joystick dialog where it loads sliders for each available axis, and buttons for each available button. A library handles most of the work and gives me counts for each.

codebehind
24th June 2007, 15:18
I use the designer for the basic implementation - for positioning the elements on the window - of the GUI. Than i code in txt editor (vim).

wangqiang
15th October 2007, 07:08
:p I often use the designer when i work in !

pherthyl
1st November 2007, 18:47
You use the "pixmap function" feature of Designer

What is the pixmap function and how do I use it? I've been writing most of my interface code by hand since I need to assign icons containing multiple pixmap sizes to QActions , but if it was possible to do in designer I would switch.

wysota
12th November 2007, 11:15
What is the pixmap function and how do I use it?
You probably don't need it - it is a function you can write to generate pixmaps according to a name. You can substitute the default pixmap generation process (based on a filepath) with it.


I've been writing most of my interface code by hand since I need to assign icons containing multiple pixmap sizes to QActions , but if it was possible to do in designer I would switch.
You wouldn't see the result in (current) Designer. If icons are your only problem, you can write a simple routine that would set the icons in code and layout the gui in Designer.

rajesh_clt3
29th November 2007, 14:05
I created widget using designer and connection using manually.......

GreyGeek
7th December 2007, 18:36
Always the designer.

I also avoid using "clever code" which will give trouble to those that are going to be supporting my aps after June of next year. Writing "inspired" code which you can't figure out when you are not so "inspired" is foolish. The maintainers will hate you for it.

alecs1
14th January 2008, 20:43
Thank you for this discussion. Because of this I have finally took the time to learn using the forms, excelent.

Colx007
21st January 2008, 15:59
At the possible I use designer. But if I would know :o, I would use a text editor.

C167
4th April 2008, 16:50
I started with Qt4, and i started with the designer. I always had problems with the designer-generated UIs, i could not handle them. So i mainly use it now to visualize what i want to do and then hardcode it. One problem with generated widgets i had was that they never adjusted their size to the widget or mainwindow that contained them.

jpn
9th April 2008, 20:07
One problem with generated widgets i had was that they never adjusted their size to the widget or mainwindow that contained them.
It's a matter of installing a top-level layout on the form. Deselect child widgets and choose a layout from the Form-menu (or context menu or toolbar).

MrShahi
28th April 2008, 11:52
Not often, I use the designer when my gui design is very complex because it makes the gui very easily...........otherwise I prefer coding to design gui..................:cool:

WinchellChung
28th April 2008, 16:33
Newbie that I am, I generally use the Designer.

But occasionally when I am trying to add new items, it is a real pain to have to break all the layouts, or have Designer turn your dialog into a tangled mess.

In those cases I usually manually insert items into the *.ui file, using an XML editor.

triperzonak
23rd July 2008, 17:33
i use designer almost everytime, but in my app i use designer in one form but in the other not..

and there is 1 proj that i cant use designer cause everything is dynamic..

in my kind of job where everything has deadline or timelimit or what ever you want to call that.. designer is very helpful..

qwakaw
12th November 2008, 06:13
I have always used designer to design the desired UI.. I really don't get the point why one should hardcode GUI.. In Qt 4, the stylesheets, promoting widgets etc gives you the power to achieve what you want with designer..

(OR)

I haven't come across the reqiurement wherby I need to do hardcoding GUI..

ComaWhite
12th November 2008, 07:23
I don't bother with signals/slots in them. Because the designer creates ugly naming of the slots. etc. But I use it everything else, but depending on what I need it for.

rexi
5th December 2008, 01:11
I mostly used the designer with KDevelop3. I'm still not exactly sure what is the right way to use it (or, the preferred way) I've been creating Qt apps with KDevelop, as well as with Eclipse. As I understand it, the first encourages subclassing, the latter encourages using the UI as a member. Now I'd like to know what most of the users of Qt prefer....

lenardpi
7th January 2009, 21:47
I use the designer for simple dialogs only.

The feature I would really need is being able to put a _subclassed_ widget onto the form. If there is already such a functionality, I don't know how to use it... What I can do is to use the Qt provided widgets only, but usually I'd like to work with eg. MyTabWidget instead of QTabWidget. I'd welcome Visual Studio's convenient solution in the designer for this issue.

jpn
8th January 2009, 14:55
The feature I would really need is being able to put a _subclassed_ widget onto the form. If there is already such a functionality, I don't know how to use it... What I can do is to use the Qt provided widgets only, but usually I'd like to work with eg. MyTabWidget instead of QTabWidget.
Yes, it's possible. See Promoting Widgets (http://doc.trolltech.com/4.4/designer-using-custom-widgets.html#promoting-widgets) for more details.

sneg
8th February 2009, 01:47
I mostly use Designer for prototypes while I do the rest by hand.

KaptainKarl
6th March 2009, 23:35
I don't use QT Designer ever.
I guess I'm just old school and prefer controlling everything in my own code.
I also find QTs syntax for building layouts very intuitive so it's easy for me.

Karl

ersin.ozkan
11th March 2009, 12:27
%80 manually which is the best :)

thiforums
1st April 2009, 19:50
Honestly, dealing with layouts in qDesigner is bad and waste of time. If they add an anchors property for each visual control, it should become more easy, more comfortable and faster way to develop GUIs.

rexi
2nd April 2009, 22:22
Honestly, NO! And it seems this is not only my opinion. Have a look at the other thread you started. Qt has one of the most advanced, flexible, easy to use layout systems I've ever seen. Sorry to say that, but anchors suck. You cannot design a good user interface with anchors :eek:

Qt's layouts are very simple. And that's what makes them very powerful. Just have a serious look at them, and I'm sure you will find out how you can achieve whatever you want it to be. With anchors, you just cannot...

Damn, in my opinion even Java's layouts are superiour to the anchor approach. And I really scorn most of Java's built-in layouts...

ComaWhite
3rd April 2009, 08:11
Honestly, dealing with layouts in qDesigner is bad and waste of time. If they add an anchors property for each visual control, it should become more easy, more comfortable and faster way to develop GUIs.

What do you mean anchors?

rexi
3rd April 2009, 22:42
What do you mean anchors?

Basically it's a kind of layout where you tell widgets how to align with respect to the window they are in, or other controls in said window. Have a look at Up this topic if you wanna QDesigner with an Anchors property! (http://www.qtcentre.org/forum/f-qt-tools-3/t-up-this-topic-if-you-wanna-qdesigner-with-an-anchors-property-19926.html), anchors are described there.

(By the way, is there an easy way to link to other threads in this forum, other than copying their URL? Or a way to link to specific posts in a thread?)

ComaWhite
4th April 2009, 18:19
Oh gawd. Not those "anchors" like in C# WinForms. I hate those. Such a freaking pain to work with.

rexi
4th April 2009, 22:59
I totally agree. I guess whoever prefers anchors to Qt's layout system just doesn't understand how layouts work. Or has never designed anything even remotely complex. I have never seen anything that is easier to use or more powerful than Qt's layouts. It just rocks ;)

ComaWhite
5th April 2009, 05:43
I remember always thinking absolute positioning was the way to go. When I first tried a different library like Gtkmm back then. I laughed at the layouts and I hated them. Now I love them :O

wysota
28th April 2009, 22:38
(By the way, is there an easy way to link to other threads in this forum, other than copying their URL? Or a way to link to specific posts in a thread?)

Just seen this post... Yes, you can use the [thread] or [post] bbcode tags as documented here: BBCode help (http://www.qtcentre.org/forum/misc.php?do=bbcode)

rexi
30th April 2009, 12:00
Thanks. That should make it easier to point others to the right answers :)

QAmazigh
30th May 2009, 01:58
Designer makes life easier :D

Golodh
3rd June 2009, 21:37
I use the designer exclusively because I usually don't need more than functionality that's offered in Qt libraries and because I don't want to spend a lot of time time on the interface.

I think programming GUIs is boring and a huge unproductive time-sink. The Designer saves me an enormous amount of time. Usually I just want to get the main functionality done, and wrapped up in a usable GUI. If I can't build the GUI using standard elements in the designer, I won't take the time to do it.

Besides which ... I haven't taken the time to learn many of all those Qt gui-oriented Qt classes, and if I can use the Designer to get what I want, I'm certainly in no rush to do so. ;)

vieraci
7th August 2009, 08:57
All the time !!
I have to say this is the best IDE I've used...period.
I've paid thousands of dollars for IDE's in the past and this one kills them all...and it's FREE ???

hazardpeter
7th August 2009, 12:47
Must of the times I like to layout widgets by my self, in small projects like the ones I work in there is no really necessity for the designer.

yogeshgokul
7th August 2009, 15:29
I prefer Designer. It Rocks :cool::cool::cool:

nish
19th August 2009, 07:21
I prefer Designer. It Rocks :cool::cool::cool:
it sux big O time..
only VB ppl use toys.

yogeshgokul
19th August 2009, 07:43
it sux big O time..
only VB ppl use toys.
In my limited experience, I never found designer barring me to achieve what I want from Qt.
And I never used VB. ;)

nish
19th August 2009, 09:20
hmm.. but i dont like it..

ericV
28th August 2009, 12:00
When I started with QT 4.5 I tried out the designer, but quickly felt like it wasn't helping me understand how the classes worked and how I could write special functions for the designer generator classes.

Since then I only "write" my GUIs, that way I fell like i have more control over my app.

squidge
3rd October 2009, 23:49
When I last played with Qt I only ever used the designer for the most basic apps as it seemed far too restricted. Now I always use it. If a widget doesn't do what I want, I just promote it, write some code, and back to the designer. Much better than throwing widgets on a form as place holders which is what I had to do before (and then got confused, and eventually stopped using the designer).

MIH1406
21st October 2009, 21:53
Qt Designer makes ugly code

squidge
22nd October 2009, 11:40
I think you mean UIC makes ugly code as QT Designer only generates XML files ;)

I thought about recompiling UIC before, but never got around to it.

gopikrishnav
14th December 2009, 08:22
Well as far as my personal experience is concerned, it depends on the requirement as well.
Sometimes we prepared a common base UI and customize it to various dialogs. In this case we need to show/hide some controls and realign the layouts in the source.

But if there were no derived class dependencies, designer would be the best option.

Tanuki-no Torigava
15th December 2009, 13:47
I use it only for simple dialogs or when I need to see how it will fit the screen. Never use it for console apps :p and GL Widgets or QGraphicSceens. But it is one of the best GUI makers available now. Though there are a lot to do with usability which is IMHO not the best.

lengshuang
24th December 2009, 09:13
I do use designer to design the rack, espencially in project, but i will code my gui manually if the gui is small

Erik-Moscow
29th January 2010, 11:19
Sometimes it easier to write code manually, then use QtDesigner. However, use of QtDesigner almost always much faster.
To write GUI code manually is a good way to learn C++ and Qt I think.

toutarrive
17th March 2010, 14:31
Never... 100% .
Better control when you think on your own.

SixDegrees
8th May 2010, 21:05
I use both. I reach for the designer when I'm putting together a fairly large GUI - like the main application, or a tab set - where the emphasis is on the look and feel. Doing layouts manually, especially complicated ones, is tedious drudgery, and the tedium contributes to corner cutting. With designer, nearly all user visible strings are automatically wrapped in tr() calls, and I have the properties and other settings of the entire inheritance tree available at my fingertips. Much faster, much more conducive to getting things right the first time, and much less error prone than hand coding. And a lot more fun, unless you like the endless, mind-numbing repetition large, nested layouts involve.

Where behavior is paramount, or the task is very small, I find it easier to code by hand.

It isn't unusual for me to use a blended approach - doing a raft of moderately small layouts in designer, then assembling them by hand.

If designer provided a transparent way to insert code while dragging widget components around, my text editor would get a lot less use. I guess this is partly what Creator can do, but sadly there is no way to get Creator to compile in a Solaris environment, thanks to the balky presence, of WebKit. But maybe some day...

Carlton
23rd May 2010, 02:51
As a relative newbie, I find the Qt4 designer an excellent tool, and use it for all my gui projects.

MuzZviman
24th May 2010, 14:12
Yes I do all the time. Mostly from within QtCreator. I wish it resolved few issues like settiing widgets in the status bar, make a widget a central widget and a few other minor issues.

Muz

OpenNingia
10th June 2010, 11:29
I'm looking forward QML, I really liked using Xaml while programming in C#+WPF so I hope QML to be as good as that :)

bred
26th October 2010, 08:13
I'm using designer.

But I prefer to write the signal -> slot connection manually and normally I prefer to edit the menus manually.

snake
3rd March 2011, 15:08
In 99% of tasks I use designer. Manually, I only write very tiny pieces of GUI (ie. customized input dialogues).

petteyg359
17th June 2011, 01:41
I tend to have a much easier time designing in code.

Dong Back Kim
7th August 2011, 07:32
I use Designer most of time except the cases requiring special treatments. For example, when I extend a QWidget and the constructor requires different set of parameters then I need to delete the widget instance created by setupUI() and recreate my own. Wondering whether there is a better way that this.

gkarthick5
25th August 2011, 13:29
Using designer, it is not possible to add widgets to a QToolbar. This is one of the shortcomings.

winkle98
16th December 2011, 01:03
I absolutely hate designer's ui file and the files it generates. The ui files forces things to be stored too separately. This is very frustrating when I'm debugging. Too much bouncing between ui files and cpp files. It's an organizational nightmare as far as I'm concerned. So, when I use Designer I will typically use it to layout my widgets and verify I'm getting the resizing behavior that I want. Then I write the code manually. It makes code maintenance a lot simpler.

aguayro
14th March 2012, 03:31
Designer is a god's sent :D
its make it all easy and fast.

ChiliPalmer
17th March 2012, 21:52
Most of the time I use the Designer, as we have someone in our team who works on ui's and can't code

alizadeh91
3rd March 2013, 19:51
Using designer make codes neat and simpler :) Previously I've always used to work in code but recently i've found that it's better to do it in designer :)

MartinUI
15th March 2013, 14:05
If you don't use the help of designer, I recommend to do so .Start with me for example :) I always try to combine beauty with intuition, and QML is by far my favorite language. I provide a complete UI solutions starting from the graphic design to the finished and polished QML files (including animations). Feel free to contact me

alizadeh91
17th March 2013, 18:11
But QtDesigner has long way to be completed :)

kaufenpreis
23rd December 2014, 11:11
Depends and the task. Sometimes yes, sometimes no.

czilla
15th April 2015, 13:41
I code my gui manually.

Malisha100ka
26th August 2015, 20:42
i use desinger, it is faster, easyer and also i have fun when desing it :)