PDA

View Full Version : Promote Button does not appear in "Promoted Widgets" Dialog



davethomaspilot
6th August 2022, 14:04
I know I'm doing something stupid, but I can't figure it out.

I'm trying to used a placeholder (e.g. List Widget) in QtCreator 4.4.1 for a custom class QCustomPlot. The header and .cpp files for QCustomPlot exist

13750

When I click add, the promoted class name shows in the upper window, but there is no "Promote" button to push:

13751

I've tried different things for the place holder, and have tried checking "global include", but the promote button never appears.

Any help?

Added after 18 minutes:

Found a work-around--

I copy pasted the custom widget from a QtCreator session for another project.

d_stranz
6th August 2022, 16:20
I copy pasted the custom widget from a QtCreator session for another project.

Open the XML .ui file in a text editor and look at how the custom widget insertion is implemented. There will be a section in the place where the widget appears in the UI hierarchy of layouts, and then a section at the bottom which tells the UIC compiler where to find the header file for the custom widget.

If you are brave, the next time you need to do this you can insert the list widget (or label or whatever) and then make those same edits to the .ui file (after having made a copy first). I've done that for QCustomPlot and other widgets.