The easiest way (using the constructor) is to open the main window, drag it into it QWidgetand place / name QWidgetin the same way as your custom widget. Once this is done, right-click on QWidgetand select the Promote ... . A dialog box appears with widgets that you can promote. At the bottom of this dialog box, you can add a new widget for promotion. Enter the class name and provide information about the file and add this widget. Then select an entry in the list and click the Promote button .
At the end of this process, you can recompile and your custom widget will be placed in the main window.
source
share