Use Designer or Hand Code for a big complicated desktop GUI application



  • I am new to Qt but have years Java Swing and C++ experience. I have no experience on drag-n-drop GUI builder for real project. I know there are some discussions about Designer vs Hand Code online in general. But we may use Qt. I want to hear from experienced Qt experts/users here.

    The desktop GUI application we are going to build will be used in hospital to control a big medical device. We need to handle patient, data display, data store, data transfer, treatment, diagnosis, protocol, and .... It will be a big complicated GUI application. AND the schedule will be VERY tight.

    I am confident we can make it by Hand Code the GUI based on our existing experience. But now there is another option: use Qt Designer. BTW, we may use Qt Widgets project but not the Qt Quick. I have installed Qt and now is learning.

    What I am trying to figure out about the Designer are the followings:

    1. We will have a very tight schedule. Does the Designer will help us out this from beginning to the end (it will build the application quick)?

    2. It will be easy to build multiple layers GUI with Designer? For example from display one bring up display two and bring up display three from display two, like a display stack.

    3. Can we share GUI code via different parameters in the constructor? For example if we have a display screen which can be used in different modules/cases because the differences are very little, we can easily share it with different parameters/flags if we write the code by hands. How about with the Designer? The code generated by machine cannot be modified?

    4. Can Designer generated code be embedded inside a normal class? Sometimes, we may need a display (not just a dialog) code being embedded and being triggered in a class which is a business logic class and is not generated by the Designer.

    5. Can we use Hand Code along with the Designer generated code? (to resolve about #3 and #4 concerns)
      If yes, it's a good / normal practice?

    6. How can we apply our OOP design with the classes/code generated by the Designer? For example if we have decided that all top level GUI classes should derive from an abstract class or a pure abstract class which declares some functions all subclasses should have, can we do this? The use of super class will make the polymorphism possible. Force all related classes derive from a parent may result in a clear, easy to find code base.

    7. We may use few GUI components from other company to lessen our work load. If their components are built by Qt Designer, do we have to use Designer to build our GUI in order to avoid integration hassles?

    Any input will be appreciated.


  • Moderators

    Yes. Writing the UI by hand for large forms is usually a waste of time. With Designer you can do it faster and there is no runtime penalty (only the compilation will take a few seconds longer).

    See "QStackedWidget":http://qt-project.org/doc/qt-5.0/qtwidgets/qstackedwidget.html.

    I think you are confusing things a bit. Designer generates a .ui file that is only a description of the UI. You still have full control over the thing in C++ class associated with the form, just as if it was written by hand (well, almost. Depends on specific use cases).

    Again, I have a feeling you don't understand how it works. Create some simple GUI apps to see how it works. In short: you can embed anything anywhere, Qt does not care or know whether anything was generated by Designer or hand-crafted.

    Yes, and yes. You can manipulate the UI in form class. You can't (and don't need to) modify the ui_*.h file that is automatically generated by uic.

    Designer has nothing to do with your class hierarchy. You can use any model you wish.

    No. In your code, you simply include GUI class header, that's it - you don't care whether the widget was designed in Designer or elsewhere. Please, read the documentation, do some sample apps and it should all get clear.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.