GUI Design -- Forms (UI) vs code



  • To design the GUI (keep the Push buttons, List, Icons and etc), which method is good, i.e. Using the Forms and drag and drop the push buttons, list and icons (first method) or in code, creates the push buttons, list, icons and layouts (second method).

    When we need to go for the first method? and when we need to use the 2nd method?

    -Thanks.



  • @Balaji-N
    I use Python/PyQt and not Qt Creator, so I go for the second method. I'm used to that. But for most people designing the GUI in Qt Creator is easier/more maintainable. You would then use dynamic creation at runtime only if you have to somewhere for some purpose.



  • @JonB
    Thanks for the reply. I will check this.


  • Qt Champions 2017

    @Balaji-N
    Just as a note. You can easy mix both.
    The UI files is actually only code when app runs so
    you can both use Design AND same time add widgets
    from code for any dymnamic part.
    Qt is even so flexible that you can load UI file at run time
    to use as template for dynamic creation.
    http://doc.qt.io/qt-5/quiloader.html


Log in to reply
 

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