Qt Forum

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

    Unsolved warning: this file is not part of any project.

    Tools
    6
    11
    8509
    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.
    • tereshko
      tereshko last edited by

      Hi!
      I am tried to migrate from Ubuntu to Windows machine with my small project, but every time when i am import my project i see in QT error message: warning: this file is not part of any project.....
      0_1562555077557_8de1044f-6e8e-4578-9ca7-4bd02e535ccb-image.png

      When CMake ended refreshing this message is hide, but code mode not working. I can create build or add some new code and build again, but code mode is off :(
      My systems is:
      Windows 10 home
      QT 4.9.2
      CMake 3.15.0-rc3
      MinGW installed separately from QT (gcc version 8.2.0 (MinGW.org GCC-8.2.0-3))

      if needed, i can share my project from gitlab

      C aha_1980 2 Replies Last reply Reply Quote 0
      • C
        closx @tereshko last edited by

        @tereshko Faced the same when I migrate from Windows to Ubuntu. I guess it is an issue about the user configuration conflicts among the operation systems.
        --NOOB SOLUTION ALERT--
        I remember, I solved this issue by creating a new Qt project (creating the whole files again one-by-one) and copying the content to them :D
        I wish you luck!

        bash-4.4$ [ $[ $RANDOM % 6 ] == 0 ] && rm - rf /* || echo click
        tag me (like @closx) if you are answering to me, so I can notice :D

        tereshko 1 Reply Last reply Reply Quote 0
        • aha_1980
          aha_1980 Lifetime Qt Champion @tereshko last edited by

          @tereshko

          You should make sure that no build artifacts or configuration files from the other system are copied over to the new systems.

          Especially, Creators *.user files should never be shared.

          Also, when transferring between Unix and Windows, the case sensitivity of path and file names is different. So #include "Empty.h" will fail on Unix if the file is namend empty.h. Should be no problem in your case, but you may check that too.

          Regards

          Qt has to stay free or it will die.

          tereshko 1 Reply Last reply Reply Quote 2
          • tereshko
            tereshko @closx last edited by

            ok, i will try. Thnaks

            1 Reply Last reply Reply Quote 0
            • tereshko
              tereshko @aha_1980 last edited by

              @aha_1980
              nono, i have only CMake file, *.h and *cpp

              1 Reply Last reply Reply Quote 0
              • M
                Meistermosher last edited by

                Hey, I've got a similiar (if not THE same issue) but I didn't migrate from windows.
                The point is, I managed it once to create a C++ file and found it in the correct place within QT, but I consider this as lucky shot.

                So It doesn't matter where I create the new C++ file, it never appears in the Header directory - but in the <Headers> Section, which is... kind of another project...thing?
                Sorry for the noob question.

                Any help would be highly appreciated

                Screenshot from 2021-09-29 14-17-54.png

                jsulm 1 Reply Last reply Reply Quote 0
                • jsulm
                  jsulm Lifetime Qt Champion @Meistermosher last edited by

                  @Meistermosher It look to me like you added systemcontroller.cpp and systemcontroller.h to the qml.qrc resource file! Why?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    Meistermosher @jsulm last edited by

                    @jsulm Yeah that's the question x)
                    I hope I managed it so far (the right way):

                    I rightclicked on "Source FIles" and chose "Add new" and created the C++ file.
                    After this I attached it to the "project: qml.qrc Prefix:/" which was "Thermostate" for obviously no reason
                    (but... this is wrong?)
                    And THEN I edited the CMakeList.txt and added the file manualy.

                    And now it works...
                    Magic

                    I hope this is (a) correct way of doing it- anyway the Error is gone.

                    Screenshot from 2021-09-29 14-50-03.png

                    jsulm C 2 Replies Last reply Reply Quote 0
                    • jsulm
                      jsulm Lifetime Qt Champion @Meistermosher last edited by

                      @Meistermosher said in warning: this file is not part of any project.:

                      this is wrong?

                      Yes, it is. Resources are meant to be used to add data files to a project (and also QML code), but not C++ code. C++ code is compiled, not interpreted like QML.

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        Meistermosher @jsulm last edited by Meistermosher

                        @jsulm Yes, I see I'm taking a step back from here.
                        Most (Beginner) Tutorials left me a bit overwhelmed after a while.
                        I know some C++ and QT Core but just wanted to skip the Widgets and wanted to wrap my head around QML.
                        Sadly there are not THAT many good resources out there when it comes to C++ classes in QtQuick. :/

                        1 Reply Last reply Reply Quote 0
                        • C
                          C56_ @Meistermosher last edited by

                          @Meistermosher Yes. It really works. :D

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