Results 1 to 6 of 6

Thread: UI Builder Error: Finding/Adding A Slot

  1. #1
    Join Date
    Aug 2009
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question UI Builder Error: Finding/Adding A Slot

    I'm trying to add a slot through the ui designer in QtCreator, and I get this error, I've tried rebuilding the project, made sure the header is there, deleted it so it was recreated, nothing seems to fix it, anyone know why this is happening?
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2009
    Posts
    14
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: UI Builder Error: Finding/Adding A Slot

    I have got the same problem. Any suggestion, please?

  3. #3
    Join Date
    Nov 2010
    Posts
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: UI Builder Error: Finding/Adding A Slot

    In my case this was because of manually multy-renaming class name from class_name to ClassName. Then class_name.h, ui_class_name.h include entries, CLASSNAME_H define entries and other occurences were renamed too in project files. Changes which caused project not to build was fixed by me but the rest were related to this "Error finding/adding a slot" problem:
    Qt Code:
    1. #ifndef ClassName_H
    2. #define ClassName_H
    To copy to clipboard, switch view to plain text mode 
    in classname.h and
    Qt Code:
    1. #include ClassName.h
    2. #include ui_ClassName.h
    To copy to clipboard, switch view to plain text mode 
    in classname.cpp.
    When I fixed it (1st should be in UPPERCASE, 2nd in lowercase) all went good.

    By the way, in error dialog box there was
    Cannot find classname.h
    which is confusing because there WAS file named exactly "classname.h" in appropriate directory.

  4. The following user says thank you to vitvrn for this useful post:

    serjik (6th July 2013)

  5. #4
    Join Date
    May 2011
    Posts
    21
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: UI Builder Error: Finding/Adding A Slot

    i got this message:

    Error finding/adding a slot.
    No documents matching 'ui_MainWindow.h' could be find.
    Rebuilding the project might help.

    And i solved it:
    i renamed my source files to lowercase character and also renamed those in xx.prj file and #include "mainwindow.h" in used files.
    just it.

  6. #5
    Join Date
    Aug 2013
    Posts
    2
    Qt products
    Qt4

    Default Re: UI Builder Error: Finding/Adding A Slot

    I have not found xx.prj. Just only .pro

  7. #6
    Join Date
    Apr 2014
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: UI Builder Error: Finding/Adding A Slot

    Hello I stumpled to this exact same error and discovered after 2 hours debuggin where the error is happening.

    If you have namespace Ui

    you must have in header:

    Private:
    Ui::MyClass *ui

    Then in CPP you need to have #Include "MyClass.h" #Include "ui_MyClass.h" and in the code you must have:

    ui(new Ui::MyClass) in the constructor statement.

    Then only the Creator finds the ui file.

    My problem was that I had several Namespaces like:

    namespace MyApp { namespace core { namespace gui { class MyClass

    When using some other namespace than Ui the creator cannot turn Ui::MyClass to pruple meaning that it indicates that code works. SO I changed it to MyApp::core::gui::MyClass *ui

    This did break the Creator finding slot where Ui is. Changed that line in header back to Ui::MyClass *ui and then slots worked in Designer again. How ever for some reason the creator editor cannot understand the Ui::MyClass *ui because the namespace Ui does not exist. This may be a creator bug.

    Hope this helps.

Similar Threads

  1. How to declare SLOT as a parameter to member function?
    By QPlace in forum Qt Programming
    Replies: 2
    Last Post: 17th July 2018, 01:41
  2. Differences in calling a Slot
    By Denarius in forum Qt Programming
    Replies: 7
    Last Post: 28th April 2009, 16:32
  3. Replies: 12
    Last Post: 18th September 2008, 16:04
  4. Problem When Creating my own Slot
    By Fatla in forum Qt Programming
    Replies: 12
    Last Post: 6th June 2008, 15:44

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.