Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Reference generated ui_ header from different subproject



  • Hi all,

    I have a setup in which I have some custom (promoted) widgets. I started with the widgets in the same subproject as where they are used, but to be able to reuse them, I have now moved them to an own subproject.
    To be able to set some specific things oir on or connect to widgets on the custom widget, I use a reference similar to:

    ui->customWidget->ui->widget
    

    But after the move, the generated ui_customwidget.h is not found anymore when building. Even though in QT Creator it all seems to be fine.
    How can I include the generated ui_*.h files into a different subproject? Or is this the wrong way to go, and should I add wrapper methods to the customwidget.h/cpp?

    TiA!


  • Lifetime Qt Champion

    It's not directly possible and would somehow contradict the whole class encapsulation - you have to add a setter to the class which uses the ui-file.



  • Thanks for the quick reply! I'll add the wrapper methods for the parts that I need.


Log in to reply