Nominate our 2022 Qt Champions!

[SOLVED] Code editor dropdown combobox ui names not updating -How do get them to update

  • These are the steps taken in the Qt Designer to reproduce the problem
    1- Create a dockwidget in Designer

    2-in the object inspector, the name of the dockwidget is dockwidget

    3-When I write code in the code editor where I do ui-> , a combobox appears that lets me select available items from the ui based on their name. I can select dockwidget

    4- In the Object inspector, I right-click on the dockwidget named dockwidget and select "Change object name.." and then I change the name to tradeRecords_dockwidget

    5-When I write code in the code editor where I do ui-> , a combobox appears that lets me select available items from the ui based on their names, but the newly renamed dockwidget name does not appear. Instead the old name is still listed.

    6-If I select the old dockwidget name, it inserts it the code but when I build, an error is given where the old dockwidget name does not exist........this is as it should be since it was renamed.

    7- When I manually type in the pointer reference to the new dockwidget name, everything builds fine.

    8- Still, after doing qmake, and clean and rebuilding, the combobox will not update to the new dockwidget name. I can still code and run things, but it's annoying not to have the new dockwidget name appear in the combobox dropdown list so I can select it as I code. Is there a solution to this problem??

    Forgive the wordiness, it's just hard to describe this!

  • The proper term I was looking for to describe the dropdown box was "code completion".
    So far, I found the problem to revolve around the mainwindow.ui file.
    The mainwindow.ui file needs to be processed by a uic.exe file to generate a ui_mainwindow.h file.
    For some reason the ui_mainwindow.h file. is being placed outside the directory of my project, so I just copied it to my project directory and all was better.

    Could someone PLEASE tell me how to make the ui_mainwindow.h file be generated "inside" my project directory?

    I know I can eventually, using lots of time, figure it out myself, just like I figured out this problem, but doing all these system busywork tasks is detracting from my time to work on the program itself. Qt is starting to annoy me in this way. TOO MANY THINGS TO EXPLORE AND READ AND FIX JUST TO GET THE WHEEL REINVENTED. These time-consuming items "do not exist" in better IDE's. Fortunately Qt has so much to offer, and I like the Qt Creator interface so much, I'm willing, for now, to slog through the super-steep learning curve.

  • The way to set where files get built is by using the projects button on the left side of the Qt Creator interface.

Log in to reply