Unable to add file to project



  • 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


  • Qt Champions 2018

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



  • 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?



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


  • Qt Champions 2018

    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



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


Log in to reply