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

Qt widget promotion error after moving code and ui files.



  • Class DCGraphicsView is a subclass of QGraphicsView, I put a QGraphicsView Widget on the UI file framework.ui. And the I promote that QGraphicsView Widget to DCGraphicsView. After clean, qmake and rebuild, everything is OK as expected.

    But after I moved those code and ui file into a subfolder named ui, and modify the pro as well, use the same procedure as previous (clean, qmake and rebuild). An error message displayed when doing rebuild.

    To figure out what causes this error, I cancel the promotion of QGraphicsView Widget, then no error pops out. If I put it back, the same error comes again. Confused.

    error message as follows:

    No rule to make target 'dcgraphicsview.h', needed by 'ui_framework.h'.Stop.



  • I got a solution, use UI_DIR to the ui file path in pro file.



  • I got a solution, use UI_DIR to the ui file path in pro file.


Log in to reply