Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › Changing the folder structure

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #24729

    Miika

    I moved qml/Main.qml from to be src/qml/Main.qml

    The Felgo Live Client does not work, it says:

     

    file:/MyProject/src/qml/Main.qml: No such file or directory

     

     

    #24732

    Alex
    Felgo Team

    Hi Miika,

    can you try to clear the cache of the connected client using the button in the Live Server?

    Best,
    Alex

    #24735

    Miika

    Hi Alex, thanks for the reply!

     

    Found the button in the client window, in Actions -> Clear project cache and reload.

    I found out that Felgo creates cache at: C:\Users\<username>\AppData\Roaming\Felgo Live Client\<projectname>.

    The said button cleans all folders at that location.

    However, this does not help with the issue. Therefore, a feature suggestion to Felgo: Monitor the actual structure and settings of the user as per the qml locations, and reproduce that structure in the cache and build folders.

     

    Manual solutions to the issue:

    1. Create your wanted folder structure in the project folder
    2. Change in .pro file: qmlFolder.source = <your wanted path>
    3. Change in main.cpp: felgo.setMainQmlFileName(QStringLiteral(<location and name of your main qml file, relative to proj path>));
    4. To use the live client with custom folder structure: Copy your custom structuring to the cache location mentioned above
    5. To debug and dev normally by running with Qt Creator, you also need to replicate custom structuring at the build folder

    At deployment, things should be changed to use .qrc, I believe, and that will mean other modifications.

    Best,

    -Miika

    #24737

    Miika

    Just wanted to add that it was not actually so easy, the above does not completely work. Copying things doesn’t work, symbolic links might work. However, with custom structures, you’ll lose the straight updateability upon pressing Ctrl-S to the live client window — you need to activate the window and press Ctrl-R. Not sure if applies to the custom live client build, and don’t have time to investigate further. The default foldering is recommended for now, which is a bit disappointing.

     

    Also, perhaps no need to do anything at the build folder, just rebuild.

    #24738

    Alex
    Felgo Team

    Hi Miika,

    you you quickly post your folder structure so we have a change to try and reproduce the issue? So e.g. something like:

    root
    -- qml (--> has Main.qml)
    -- assets
    ---- images
    ---- icons
    -- android
    -- src
    ---- something

    Best,
    Alex

    #24899

    Omegapon

    Hello Alex,

    I’m excited to try out the Felgo 4 hot reload feature with my existing Qt6 project.

    Unfortunately, I’m running into the same issue as OP when using a non-standard project layout.

    My project is structured like this (100’s of QML and cpp files were omitted for brevity):

    (image, because forum software keeps breaking the formatting)

    https://imgur.com/a/0EaQybO

    App contains my main.cpp and is the resulting binary.

    It links Core which is a shared qml c++ module and is loaded in main.cpp like so:

    #include <QtQml/qqmlextensionplugin.h>
    Q_IMPORT_QML_PLUGIN(com_my_org_CorePlugin)

    (in case it’s relevant)

     

    Anyway, App also links FelgoLive in the CMakeLists.txt and starts the live client at the end:

     FelgoLiveClient liveClient(&engine);

    Upon connecting I get

    MyProject/src/com/my/org/App/main.qml: No such file or directory

     

    Your 6.4 example projects work just fine. I don’t want to mess with my existing project too much. I tried copying it into the cache folder but it didn’t work either and even that was a headache given my Core module lives outside the App directory.

    Ideally, I don’t need to make any changes to my CMakeLists besides linking to your library.

    In case there’s anything else I can provide to help debug this issue please let me know.

     

     

    #24901

    Alex
    Felgo Team

    Hi,

    the main issue here is that the Live Server assumes that the “src” folder is reserved for C++ files, and thus it is ignored by default. So any contents of this folder are not sent to the Live Client.

    You could try to rename the “src” folder to e.g. “source” and check if it works then or if you hit another obstacle.

    I will suggest our team to add an option to configure the default ignored folders in the Live Server, to better support such custom project structures.

    Best,
    Alex

    #24911

    Omegapon

    Hello Alex,

    thanks for the tip. After renaming my src/ dir to source/ and adjusting the QML_IMPORT_PATH from /src to /source I managed to:

    – Start my App and connect as a Live Client by pressing Connect from within the App

    I did not manage to start my App from the Felgo Live Server UI. Whenever I press START it fails with:

    > MyProject/source/com/my/org/App/main.qml:10:1: module com.my.org.Core is not installed

    Besides the renamed directory I did not change anything else about my project. So the layout mentioned in my previous post still applies.

    Anyway, unfortunately I still couldn’t test out the hot reload with the App running as a Live Client.

    I tried to change some random properties like the color of a Rectangle and text of a button,

    but I keep getting segfaults whenever anything is changed. Maybe it is related to the Felgo Live Server issue with the missing import?

    Otherwise, the App seems to run fine even the features using the missing QML import:

    First stacktrace: https://imgur.com/a/Oo3SIKv

    Second stacktrace: https://imgur.com/YdDuoM1

    #24915

    Alex
    Felgo Team

    Hi,

    the Start button in the Live Server will always start the default Live Client shipped with the SDK (thus the import fails). If you are using the Live Client Module in your own app, you will always have to start your own app and connect it to the Live Server.

    I have forwarded the stack traces to the tech team, thank you for your effort. If we can get any insights from them, I’ll let you know. You could disable “Hot Reload” in the Live Server and only use “Live Reload” (so without preserving the application state) at least, to still speed up development by avoiding build/run steps.

    Best,
    Alex

Viewing 9 posts - 1 through 9 (of 9 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded