Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. warning: this file is not part of any project.

warning: this file is not part of any project.

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
11 Posts 6 Posters 15.1k Views
  • 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.
  • tereshkoT tereshko

    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 Offline
    C Offline
    closx
    wrote on last edited by
    #2

    @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

    tereshkoT 1 Reply Last reply
    0
    • tereshkoT tereshko

      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

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #3

      @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.

      tereshkoT 1 Reply Last reply
      2
      • C closx

        @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!

        tereshkoT Offline
        tereshkoT Offline
        tereshko
        wrote on last edited by
        #4

        ok, i will try. Thnaks

        1 Reply Last reply
        0
        • aha_1980A aha_1980

          @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

          tereshkoT Offline
          tereshkoT Offline
          tereshko
          wrote on last edited by
          #5

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

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Meistermosher
            wrote on last edited by
            #6

            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

            jsulmJ 1 Reply Last reply
            0
            • M Meistermosher

              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

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #7

              @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
              0
              • jsulmJ jsulm

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

                M Offline
                M Offline
                Meistermosher
                wrote on last edited by
                #8

                @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

                jsulmJ C 2 Replies Last reply
                0
                • M Meistermosher

                  @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

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  @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
                  0
                  • jsulmJ jsulm

                    @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.

                    M Offline
                    M Offline
                    Meistermosher
                    wrote on last edited by Meistermosher
                    #10

                    @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
                    0
                    • M Meistermosher

                      @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

                      C Offline
                      C Offline
                      C56_
                      wrote on last edited by
                      #11

                      @Meistermosher Yes. It really works. :D

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved