Important: Please read the Qt Code of Conduct -

QT Designer Plugin Development

  • Hi

    At first i have to say, that i'm completly new in QT, so that i have to learn a lot.

    My task/target is to create an custom widget plugin for the QT Designer and deliver it to some other developers.
    The Widget works fine, if i use it in the same Project, where i created it.
    My next step was to pack the widget into an library (dll) to add it to the QT Designer Toolbar.
    I implemented the QDesignerCustomWidgetInterface class, built the library and copied it to the designer folder, so that the widget appears in the Toolbox/Widget-list. Works fine.

    But here i'm stuck and i have no idea how to solve it:
    How can i use this custom widget in an simple MainWindow application?
    If i simply add the Widget to my ui file (MainWindow), everything is shown correctly in the designer.
    But if i compile the MainWindow Project, i get this message from the generated "u_***.h" file:
    error C1083: Cannot open include file: '***.h'

    The application is missing the header files. If i add them to the Project, then i get some LNK2019 errors (unresolved external Symbol "...")

    I can't publish my Code here, but it would help me a lot, if you could explain it to me for the following plugin and an empty MainWindow template, where i have the same problem: (files at the end of the site)

    I thank you in advance

  • Lifetime Qt Champion

    the include in the ui_ comes from
    QString WorldTimeClockPlugin::includeFile() const
    return QStringLiteral("worldtimeclock.h");

    but it seems the error contains no filename ??