Using Qt designer to create widgets.



  • Hello,

    I'm currently working on a project as an introduction to Qt. I am now familiar with Qt designer and have made a couple of UI forms. In one of my UI forms, I was able to use other UI forms with a QStackedWidget.

    So I was wondering since I was able to use the UI form as a widget, would it be correct to create/design simple widgets using Qt designer? I mainly want to do this because it's much easier to design the widget with Qt designer's drag and drop feature (lol).

    Thanks.



  • @thisisdavid

    Hi
    If you are comfortable to use then you can use, there is no problem with it.



  • @thisisdavid said in Using Qt designer to create widgets.:

    Hello,

    I'm currently working on a project as an introduction to Qt. I am now familiar with Qt designer and have made a couple of UI forms. In one of my UI forms, I was able to use other UI forms with a QStackedWidget.

    So I was wondering since I was able to use the UI form as a widget, would it be correct to create/design simple widgets using Qt designer? I mainly want to do this because it's much easier to design the widget with Qt designer's drag and drop feature (lol).

    Thanks.

    There is nothing wrong with that! I do a good amount of my ui in sub-designer classes.

    From personal experience:
    If you come back a few month later to your project, than it is much easier to understand what one coded, if a ui-designer class is at hand!


  • Qt Champions 2016

    Hi
    Note that when designing in Creator, c++ code is generated.
    So even when you need it for code ( like dynamic adding)
    you can go into setupUI() and get the code and tweak it.
    win-win :)


  • Moderators

    @mrjj Tweak setupUI()? I would not do that as all your changes will be lost next time the code is generated again.


  • Moderators

    @jsulm good point

    You might copy the parts of the generated code and paste it in another file.


  • Moderators

    @Eddy Sure. I just wanted to point out that one should not change generated code.


  • Qt Champions 2016

    @jsulm
    No, take the code. :)

    As I write "and get the code and tweak it."

    So i hope it dont sounds like fiddling in the file as that is futile as you say.
    I will make sure to include "copy the code" in such statements as if u can read it the other way
    then others can too.

    But its very easy way to make complex layout in layout and get the code for free.


Log in to reply
 

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