@Christian-Ehrlicher
Oh well, did not expect the solution to be that simple (if this is actually the case)
Understanding the Qt Framework's library/module design is pain :D
@SimpleY i ve got same problem as your, try to go to preferences->Qt Quick->QML/JS editing-> QML Language server and remove tick on Tun on (leave all unchecked)
it worked for me.
@goingwtheflow
You have two .py files, each with their own main, hence standalone programs. How do you intend for them to interact? One would be better without the main.
When you post code, please use the Code icon on the toolbar to make your code legible.
I know this answer is a bit late, but one solution that comes to my mind is to separate UI from logic. Create one file (e.g. a ui.qml file) for your UI and use it in another qml file.
try to create a qmldir file, but it did not work
look for the error but I found nothing that serves me. I do not know if it has to do with the fact that I'm not using a qrc file.
in the ".pro" file, add a line to copy and paste the "qml" folder into the compiled directory. that's because I want the code jv and qml can be edited with any editor in the final version
#Copia la carpeta "qml" dentro de la carpeta build
copydata.commands = $(COPY_DIR) $$PWD/qml $$OUT_PWD
first.depends = $(first) copydata
export(first.depends)
export(copydata.commands)
QMAKE_EXTRA_TARGETS += first copydata
@Jason-Wright Thanks for your solution. Help me solve the same problem.
You can also remove 'as Components', then don't care this alias when use your 'Navigation'.
Thanks J-P, that's exactly what I needed to know! I think I found an old example online that used the 1.x approach to styling, then tried to combine that with 2.x controls - and got myself in a tangle. I now understand how styling is meant to be applied in 2.x, and it's working just fine for me.
It's not just "yet another app" to learn. It's the current defacto version control system used by Qt, KDE, the linux kernel and many more projects.
Even if you're the only developer, that's something you really want to learn to use.
Good news! My use case is actually well covered by simply using a regular .import "thing.js" as Thing. I don't need the specific namespace-less behavior of Qt.include; I just happened to miss .import when reading the doc, thus failing to understand that Qt.include is only a second import mechanism to be used instead of .import under very specific (documented) circumstances.
→ Doc might still deserve clarification of the async behavior, but my initial problem is gone with using .import. I updated the QTBUG
@MarkoSan Following are the 2 ways to do it correctly,
If loading main.qml from resource (i.e qrc)
for eg. engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
You will need to add the complete path so that the main.qml file in qrc is able to find it. For eg.
import "file:///home/someusername/gui/delegates" //import using complete path
UePeopleItemDelegate { //using the loaded Component
}
If loading main.qml directly i.e from some local path
for eg. engine.load(QUrl(QStringLiteral("main.qml"))). Note no qrc
Here you can use the relative path in main.qml
import "./gui/delegates" //import using relative path
UePeopleItemDelegate { //using the loaded Component
}
Assuming the directory gui is present in same location that of main.qml as we have used "."