Answer the question
In order to leave comments, you need to log in
QtCreator + QML: does not update resource files on (re)build. Shaw to do?
Good day.
Actually, for two weeks now I have been making love with Qt + QML, in general, an amazing thing, everything you need is there and even more, besides cross-platform (a critical criterion, you need an android), but that's bad luck. It just so happened that I got used to vim or Visual Studio (the best IDE for today). But QtCreator is a thing in itself, it seems that everything is there, what is needed, but it seems that a piece of it is understandable. Actually, the problem is in the question, and the problem is amazing, it floats!
So, we create a couple of files in QRC. We change them. We collect, we launch. We change again. We collect, we launch. There is a difference? That's bad luck, it doesn't matter!
It's so annoying that it's just annoying. Googling resulted in two tickets on the bugboard , but they are closed. Actually, okay, if there is no right solution, I'm interested in the possibility of a quick solution. After all, now to run it, you must first run qmake, then make clean, and then make build. And only then launch. Actually, I would work under vim and rivet my own scripts, but no, you have to rape windows, and under it vim is not vim, scripts are not scripts and there are no terminals at all, so there is nothing to do here, but you have to. No matter how I searched, I didn’t find pre-build hooks in Qt to force qmake to be pushed there, but it would be ideal to fix this bug after all.
Remarkably, for quite a long time everything was ok.
The profile is here.
QT += charts qml quick serialport network
SOURCES += main.cpp \
devicesmodel.cpp \
device.cpp
RESOURCES += \
qml.qrc
HEADERS += \
devicesmodel.h \
device.h \
betterdebug.h
DISTFILES += Amplifier.qml \
DevicesList.qml \
DevicesView.qml \
FDR.qml \
main.qml \
NLD.qml \
OffMode.qml \
Oscilloscope.qml \
Receiver.qml \
Settings.qml \
Switcher.qml \
SwitchItem.qml
Answer the question
In order to leave comments, you need to log in
Alexey
used the solution , because it gets rid of the poor makefile, giving the greatest control over the project. Not everything works perfectly yet, but now it can work quite well. By the way, Qt already knows how to create QBS projects, although for this you will have to choose an illogical project without Qt.
To use Qt, you will need to add its module and the necessary submodules as dependencies, an example * .qbs file is just below:
import qbs
CppApplication {
files: [
"include/betterdebug.h",
"include/device.h",
"include/devicesmodel.h",
"main.cpp",
"qml.qrc",
"resources/Amplifier.qml",
"resources/DeviceView.qml",
"resources/DevicesList.qml",
"resources/FDR.qml",
"resources/NLD.qml",
"resources/OffMode.qml",
"resources/Oscilloscope.qml",
"resources/Receiver.qml",
"resources/Settings.qml",
"resources/SwitchItem.qml",
"resources/Switcher.qml",
"resources/main.qml",
"source/device.cpp",
"source/devicesmodel.cpp",
]
Depends {
name: "Qt"
submodules: ["charts", "qml", "quick", "serialport", "network"]
}
Depends {
name: "cpp"
}
Group {
fileTagsFilter: product.type
qbs.install: true
}
cpp.includePaths: ["./include"]
}
Stop stop. In order for qrc changes to appear, you sometimes need to bother only after adding new files, with changes inside files - usually you don’t need to do anything. If, when updating the resource file, in some exceptional cases it does not rebuild itself, it is enough to remove the cpp file from the build directory and everything will be fine again.
Well, as for crutches, Google has as many of them as you like, in two weeks you could already find stackoverflow.com/questions/12873437/force-qtcreat...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question