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. Unable to add file to project

Unable to add file to project

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
6 Posts 4 Posters 1.9k 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.
  • J Offline
    J Offline
    john-arvid
    wrote on last edited by
    #1

    Hi,

    I just started with Qt creator.

    I have created a project, not written any code, just trying to add a ui file from the Qt designer.

    When I try to add a new or an existing file I loose my main.py file. The only file left is main.pyproject and this is shown in the General Messages.

    Running Windows Runtime device detection.
    C:/Qt/5.12.3/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
    Running Windows Runtime device detection.
    C:/Qt/5.12.3/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
    Running Windows Runtime device detection.
    C:/Qt/5.12.3/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
    Found 1 Windows Runtime devices.
    Found 1 Windows Runtime devices.
    Found 1 Windows Runtime devices.
    Unable to parse "C:\Users\John-Arvid\Documents\test\main.pyproject":1: illegal value
    Unable to parse "C:\Users\John-Arvid\Documents\test\main.pyproject":1: illegal value
    

    This is a clean install on windows 10.

    What should I do?

    \John

    jsulmJ 1 Reply Last reply
    0
    • J john-arvid

      Hi,

      I just started with Qt creator.

      I have created a project, not written any code, just trying to add a ui file from the Qt designer.

      When I try to add a new or an existing file I loose my main.py file. The only file left is main.pyproject and this is shown in the General Messages.

      Running Windows Runtime device detection.
      C:/Qt/5.12.3/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
      Running Windows Runtime device detection.
      C:/Qt/5.12.3/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
      Running Windows Runtime device detection.
      C:/Qt/5.12.3/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
      Found 1 Windows Runtime devices.
      Found 1 Windows Runtime devices.
      Found 1 Windows Runtime devices.
      Unable to parse "C:\Users\John-Arvid\Documents\test\main.pyproject":1: illegal value
      Unable to parse "C:\Users\John-Arvid\Documents\test\main.pyproject":1: illegal value
      

      This is a clean install on windows 10.

      What should I do?

      \John

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

      @john-arvid said in Unable to add file to project:

      main.py

      What is that? Are you using Python?
      Are you targeting Windows RT on ARM? Because that is what you're currently doing.

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

      1 Reply Last reply
      0
      • J Offline
        J Offline
        john-arvid
        wrote on last edited by
        #3

        Yes I am using python.

        I choose new project -> Qt for Python - Window
        This works out of the box.

        I have not made any changes to any settings.

        How can I, and do I need to change target?
        And how does this cause the project files to be removed from the creator?

        1 Reply Last reply
        0
        • J Offline
          J Offline
          john-arvid
          wrote on last edited by
          #4

          I ended up abandoning QT, don't have time to invest getting something simple up and running.

          I will leave this topic open in case someone else comes past it and have a solution or the same problem.

          aha_1980A 1 Reply Last reply
          0
          • J john-arvid

            I ended up abandoning QT, don't have time to invest getting something simple up and running.

            I will leave this topic open in case someone else comes past it and have a solution or the same problem.

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

            Hi @john-arvid,

            There seems to be a bug, which you might want to follow: QTCREATORBUG-22393

            Unfortunately not much users use Qt Creator for Python development, so this was overseen.

            AFAIK, Creator 4.8 should still work correctly.

            Regards

            Qt has to stay free or it will die.

            1 Reply Last reply
            1
            • Cobra91151C Offline
              Cobra91151C Offline
              Cobra91151
              wrote on last edited by
              #6

              Yes, there is a bug with Qt Creator using PyQt5. The problem: it fails to parse/add files properly to the project.

              For example:

              main.pyproject
              main.py
              test1.py
              test2.py
              test3.py
              

              To temporarily fix this issue you have to do it manually:

              {
                  "files": ["main.py", "test1.py", "test2.py", "test3.py"]
              }
              

              So, issue is that it parses .py files line by line, but instead it should be added to the array. I will also add this information here: https://bugreports.qt.io/browse/QTCREATORBUG-22393. Happy coding!

              1 Reply Last reply
              1

              • Login

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