Planned maintenance: From Sunday 8th December 10:00 CET there will be changes to try and solve the caching issues that have been experienced. If anyone has a problem connecting after this period then please PM @AndyS or any of the moderators.

Custom widget with custom widgets in Qt Creator (Designer)

  • Hello all!

    I am trying to use my custom widget containing another custom widget. Creating and using separate custom widgets causes no problem (I create .so lib for plugin, put it to <QtPath>/plugins/designer/, put plugin header to ~/QtPluginHeaders and use this path with INCLUDEPATH in pro files).

    So I have created ToggleSwitch widget and respective plugin, added it into QtCreator and everything is ok.
    Now I want to create new one widget with my ToggleSwitch widget. After doing the same things (adding to QtCreator) my QtCreator app crashes (while opening *.ui file in QtCreator) with the following error:

    ./qtcreator: symbol lookup error: <QtPath/plugins/designer/ undefined symbol: _ZN12ToggleSwitchC1EP7QWidget

    How could I solve this issue?
    My setup: Linux, Qt version 5.13 and QtCreator built with this Qt version.
    Thank for an answers in advance!

  • Problem has be solved by adding ToggleSwitch source/header files to the new widget .pro file.
    So the question now: is there some more common and elegant way to do this?

  • Qt Champions 2018

    @Texture You can make a lib from your ToggleSwitch and link your app against it

  • @jsulm could I link ToggleSwitch lib with another custom widget to do it more "logical"?

  • Qt Champions 2018

    @Texture You can put several widgets into one lib.

  • @jsulm I have not thought in this way :) Sounds good, so I will give a try, thank you. Separate linking is working well.

Log in to reply