Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved Error Due to automatic update of moc_application.cpp file

    General and Desktop
    2
    4
    298
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      saurabh162 last edited by

      Dear Developer,

      Please help me solve following error.

      In my application first by mistake I have added slot "cursorPositionChanged" for Line Edit widget. Corresponding to which I get

      1. on_LineEdit_cursorPositionChanged() slot in my application.cpp file

      2. case 31: _t->on_stepLineEdit_cursorPositionChanged((reinterpret_cast< int()>(_a[1])),(reinterpret_cast< int()>(_a[2]))); break;

      entry in my moc_application.cpp file.

      Later, after realizing my mistake when I have deleted above given code and rebuild my application I get following error.

      error: undefined reference to `Application::on_LineEdit_cursorPositionChanged(int, int)' in moc_application.cpp file

      Please inform me from where code:

      case 31: _t->on_stepLineEdit_cursorPositionChanged((reinterpret_cast< int()>(_a[1])),(reinterpret_cast< int()>(_a[2]))); break;

      appear in my moc_application.cpp file after I do "Clean all" and "Rebuild all" , even after I have deleted it from moc_application.cpp file before rebuilding my application.

      Kindly inform me if you need any information from me.

      Thank you very much :)

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        Try removing the whole build directory and building again. Also, run qmake manually in Qt Creator (right click on your project and select "Run qmake"), then build.

        I have deleted above given code

        So you have removed the slot from both application.h and application.cpp?

        (Z(:^

        1 Reply Last reply Reply Quote 2
        • S
          saurabh162 last edited by

          Hello Sierdzio,

          Thank you very much for your reply actually I forget to remove slot from application.h file.

          After I deleted declaration of slot from .h file everything went fine.

          Thank you :)

          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            You're welcome. Happy coding :-)

            (Z(:^

            1 Reply Last reply Reply Quote 0
            • First post
              Last post