My setup:
I am creating and updating a form.ui file in Qt Designer, and using the Makefile generated by qmake
. Using form.ui, make
correctly generates ui_form.h, which is included in myWidget.cc.
The problem:
When form.ui is updated, make
correspondingly regenerates ui_form.h. However, myWidget.o is not regenerated and thus the UI updates are not reflected in the recompiled application. On inspecting the Makefile, it turns out that the myWidget.o rule has no dependency on ui_form.h.
The question:
How can I force qmake
to include the required dependency in the Makefile it generates?
Note: As the Makefile is auto-generated each time qmake
is run, a manual edit of the Makefile is only a temporary solution which I would rather avoid.
Related:
-- This question identifies a similar problem but is still open. The replies do not sufficiently explore the problem (narrow it down to the missing Makefile dependency) and the solutions given do not work.
-- There is a discussion on adding dependencies to the Makefile here but this question, too, is still open and the scenario is different from mine.