Important: Please read the Qt Code of Conduct -

Error finding /adding a slot - in Qt Designer

  • As the title saiz .
    This has been a problem in past (2012) and the attached link does not really provide solution.

    This is a first attempt to work with signal / slot AFTER I reinstalled my Qt Creator .
    Since I am adding a slot in "device.cpp" I do not get why the error is reporting missing header from so any places.

    I assume it is missing from some common place , but I do not get from where.

    Could use some help.


  • Lifetime Qt Champion


    Did you nuke the build folder ?
    Delete the .pro.user file ?

  • Did you nuke the build folder ?

    Not sure what you are asking. I can fully rebuild / compile and run everything, including all "events" in "device" object.
    I have several dialogs under tab and they all complain about same things.
    It has to be something common.

    Delete the .pro.user file ?

    I have build a simple main window and added button and list and it all works as expected.

    I really cannot figure out what header is missing and why only when I try to add "connect" in Qt Designer.

    I will add another test tab dialog and see if I can identify the missing #inlcude header.l

  • Lifetime Qt Champion

    @AnneRanch said in Error finding /adding a slot - in Qr Designer:

    Not sure what you are asking

    Delete the build folder. If you don't know where it is you can check in QtCreator: Projects/General/Build Directory

  • Here is something which may lead to solution.

    I have never had a need to look into "projects" form.
    I copy - using "files" to keep track of my development - poor man version control.

    Noticed that the "tab" and "build directory" do not match.

    Not sure what to do about error which is going to be "overwritten" ??

    Also - I do not know wnat "shadow build" does.

    I went to my early version of the project and experienced same issue - missing still unknown header.

    Thanks for all your help, appreciate that very much


  • Lifetime Qt Champion

    @AnneRanch said in Error finding /adding a slot - in Qr Designer:

    Not sure what to do about error which is going to be "overwritten" ??

    Nothing. Next time you build the content of that folder will be overwritten. This is just a warning telling you that there is already something in that folder.

    "Also - I do not know wnat "shadow build" does" - is explained in the documentation:

  • BUMP

    I am back with same issue - this time only one error.
    To get rid of the original post error I have totally abandoned my original project and started over.
    This time I included only one class from the original code (btscanner) and as expected got the error back.
    ( I'll admit I am still not sure about anything "ui" in QtCreator )

    I really do not understand how to find / identify the missing reference to "ui::DeviceDiscovery" so I can add appropriate header into my code.

    Here is a refresher , just a text of the error.

    The class containing "Ui::DeviceDiscovery" could not be found in
    Please verify the #include-directives.

  • Lifetime Qt Champion


    The complete example (5.15 version) can be found here.

    Check the .pro file to see if yours is missing anything like the FORMS directive.

  • @SGaist
    My FORMS in .pro seem to work , no problem.

    I basically have two dialogs - MainWindow and Bluetooth scanner.
    I can "go to slot ..." and add a slot in MainWIndow and do "connect" , but I get this error doing same in Bluetooth scanner.
    I did check both headers and see no obvious difference.
    I am doing both "slot" assignment in QtDesigner , but since it fails for Bluetooth dialog I cannot continue in QtDesigner and do the connect there.

    I have two options
    do the Bluetooth "connect" manually, which I am still not comfortable with, or
    just rebuild the "device class " - an original scanner dialog - and hope it will work.

    Many thanks for your help.

  • Lifetime Qt Champion

    Which slot are you trying to connect ?

    Advice: get yourself comfortable with doing things in code code. That's a very good long term investment.

Log in to reply