Is there a easy way to protect, or revert Qt source code?

Multi tool use
Multi tool use


Is there a easy way to protect, or revert Qt source code?



I just accidentally refactored QList to QSet, and Qt faithfully did it, to all of its own sources too... (yup, that was dumb!)



Thankfully my code is source controlled, I just reverted everything, would it be feasible/sensible to make a git repo for the Qt sources too? (I have the free version so I didn't think I could modify them anyway...?)



Is there a hidden setting that will prevent its sources from being modifiable, to stop me from doing this again?



I'm currently using the maintenance tool to install a newer version of Qt, but other than update or add/remove, there wasn't a re-install option that I could see, am I missing something?




2 Answers
2



Thankfully my code is source controlled, I just reverted everything, would it be feasible/sensible to make a git repo for the Qt sources too? (I have the free version so I didn't think I could modify them anyway...?)



Feasible? Definitely. Sensible? Perhaps, assuming that by "make a git repo" you mean "cloning the official Qt repos from Git". It depends on how many times you plan on making the same renaming mistake. :D But seriously, I think there are benefits to building Qt yourself:



There are downsides too, though. You might run into build issues if you're using configure flags that the CI doesn't use (such as a -no-foo option). It can take a while to build depending on how many submodules you have and what kind of machine you're building on.



In general, if you're not using API that's in dev and not yet released, it's probably not worth bothering.



If you're still interested, this page has instructions for building Qt from Git:



https://wiki.qt.io/Building_Qt_5_from_Git



Is there a hidden setting that will prevent its sources from being modifiable, to stop me from doing this again?



Couldn't you set some permissions on the source directory? I've never had to do this, but have been bitten by it on unrelated occasions before, so I know it works. :D



I'm currently using the maintenance tool to install a newer version of Qt, but other than update or add/remove, there wasn't a re-install option that I could see, am I missing something?



Remove and add is your only option, I think. Otherwise, you can always keep a backup of the source by just copying the whole directory.



There's no point to using source code control for an install: it's not source code. It's artifacts. You already know how to protect artifacts of all sorts from modification. Proper filesystem attributes will do it just fine.



Your finished Qt installation should not be writable by you. It would be by default on Unix systems when installed using a privileged package manager. Elsewhere: you need to make it read only. If you build from source, then recursively making the install folder read-only as the last step after installation is all it takes; and since you should be already automating your Qt build, then adding the "make read-only" step is trivial.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

k 0NOF6Nkpw 8Q8jtcB w3K9mW,UD8UUYl
r6iu66o v3a69HcKJU7vlQAzqRXepdENW3

Popular posts from this blog

Rothschild family

Cinema of Italy