![]() Registered Member ![]()
|
Hi, yesterday I was reading the book Foundations of Qt Development (recommended on techbase) and discovered that there's this tool called QT Designer which is used to create the user interfaces, but when checking techbase I found little reference to it.
Afterwards I went to the directory of some apps(ktechlab in this case) and found they actually do have .ui files. My question is the following: what is the actual role of Qt designer in the KDE developer community? Is KDevelop Designer preferred over Qt Designer? Are these actually used or real "hard core" KDE hackers do everything by hand? Ii.e. I recall reading in Aaron Seigo's blog that for writing code he preferred a simple text editor instead of KDevelop. Any light you might shed on this would be really appreciated since I intend to become a KDE developer some time in the future and I'm trying to go in the right direction and understand certain things.
Last edited by choucete on Tue Jan 20, 2009 3:35 pm, edited 1 time in total.
|
![]() KDE Developer ![]()
|
While some prefer doing UI by hand, my choice is definitely the Designer. GUI for the GUI, tooth for a tooth.
![]() While for the development I use Vim. AFAIK, Aaron also uses Vim, so stating that he prefers a simple text editor to KDevelop is a completely incorrect statement ![]() The point is, try as many environments - IDEs, editors - as you can, and stay with the one that fits you most. If you need help with Vim, for example setting it to act like a full IDE, don't be afraid to ask ![]() |
![]() Registered Member ![]()
|
First of all, thanks for your reply Ivan.
![]()
You're totally right, simple was the wrong choice of words. :-$ What I actually meant was "to use a text editor to create the GUI stuff", instead of using a "GUI for the GUI" as you say. Basically you replied to my main doubt, so it is actually possible to do UI by hand? Is it much more complicated than doing it by hand? Or is actually one of those cases on which even though coding it by hand might seem more time consuming at first but the gains you have on control over what you intend proves it worth? (I don-t think this might be case since for what you say it works well for you). ![]() For example, to provide with a real life story of which I can actually talk about: I have some experience with website design and while my girlfriend liked Dreamweaver on her win, I chose to use Emacs (yes, I like emacs better :-P) to manually code the entire thing in html and php. Of course she told me that "manually coding it is lame and time consuming". Finally where she had divs flying around out of control when trying to visualize on a browser, I found that everything was where I intended it to be, giving me my "I told you so" moment. lol. Could KDE development be compared with that in any way or am I just comparing oranges with apples? |
![]() KDE Developer ![]()
|
Preamble: The post is very confusing, and unstructured, but these are some of the thoughts on the subject:
That's a very nice point - while I've never used WYSIWYG editors for HTML, I do use GUI builders. My opinion is that it is because HTML and WYSIWYG don't play well together. HTML has awful layouting mechanisms... or TBH it has none whatsoever. And the WYSIWYG really stands for /what you see is what we hope you'll eventually get if oyu're lucky/ ![]() On the other side, you have Inkscape. SVGs are XML files. Would you dream of /drawing/, or to say writing SVG files by hand in a text editor? ![]() So, IMO the GUI design is something in between. The advantages I see for QtDesigner are: - You are forced to have the presentation / implementation separated since you code outside of the .ui file - While a HTML preview is just /a reload/ away, to see manually coded UI, you need to compile and start the program. In the case of .ui, you see exactly what you will get while making it. - QtDesigner gives you enough control most of the time, and if something is not enough for you, you could always code that part by hand - outside of the .ui file so that it wouldn't be screwed by editing it again (drawing the parallel with html again) - and the last but not the least, when you are working on something that was made by someone else, you *see* what is going on. So, if the last .ui was screwed, you could just D'n'D and make a proper functioning layout. Analysing the manually coded UI is *pain*. (Just like when you try to analyse a html file created by FrontPage ![]() The main problem I see with manually coding the UI is not really /making/ the UI, it is /changing/ it later. For example, at first Lancelot was totally hard-coded - C++ code that generates the UI. (the reason: there is no UI designer for Plasma). And then I wanted to change one small thing and I totally got lost in the code. Where is what declared, where I call this and so on... So, since making a GUI editor was out of the question (I didn't have *that* much free time) I decided to make something in-between - a Plasma UI Compiler (Puck) that was supposed to do a similar thing as Qt's uic (UI Compiler). It allowed me to define UI by writing an XML file which would be translated to C++ code. Although is it doesn't get near to visual editing, it has a structure (like writing html by hand) that depends on the actual layout - if one panel is a child of another in the UI, then its node is a child node of the parent panel's node in XML. Manual editing of the UI raises exponentially with its complexity (at least I see it that way) ... I've just remembered, there is a thread (or three) for this on QtCentre forums... http://www.qtcentre.org/forum/f-qt-desi ... -6371.html http://www.qtcentre.org/forum/f-qt-prog ... -3099.html http://www.qtcentre.org/forum/f-qt-prog ... -5936.html |
![]() Administrator ![]()
|
Here's a Qt tutorial that does it does it all "by hand".
Personally I think Qt Designer is pretty neat: it let's you play around with the layout, and you see the result directly (without needing to compile every time you make a change). Another good thing with a GUI is that you can easily change the layout if you feel like it. I bet it's much more troublesome to rewrite/modify the code to completely change the layout, although I haven't done it myself.
Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.
10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts |
![]() KDE Developer ![]()
|
Years ago I used to do all of my user interfaces by hand, even when tools were available to do it graphically. The reason was that the generated code always constrained how I wrote my own code to interact with it. But with Qt4 I've been using Designer, because it does not impose any contraints. In fact, it doesn't even generate widget classes.
In a nutshell: Designer only lays out widgets, sets their properties, and optionally makes connections. Any application above the level of trivial needs some actual old fashioned coding behind the scenes. It produces an XML file (*.ui) that is converted by the uic compiler into a UI class. This class can then be used directly, as a data member, or with multiple inheritance. I tend to "compose" my user interfaces. If I have a tab dialog, for example, I will make each page its own UI class.
Don't look back! (Or you might see the giants whose shoulders we stand on)
|
![]() Registered Member ![]()
|
First of all sorry for taking so long to reply.
Thanks everyone for your feedback. You have certainly cleared my doubts in many ways. I now have a lot of reading to do. ![]() |
Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]