[Interest] Mysterious C++/QML compilation bug

Alexander Dyagilev alervdvcw at gmail.com
Mon Jun 12 16:29:13 CEST 2023


Sorry, I forgot to mention that in this particular case I'm using Qt 
5.12.12.

Maybe this is a known issue, or it's already fixed or even never existed 
in Qt 6.x.

On 6/12/2023 5:26 PM, Alexander Dyagilev wrote:
> Please note, that this is not something occasional. I'm able to 100% 
> reproduce this issue.
>
> I.e. :
>
> 1. I modify C++ header (adding some enum value in the middle of the 
> enum).
> 2. Perform full rebuild of the app.
> 3. Launch app - it's broken.
> 4. Make fake modifications in QML files using enum (e.g. insert a 
> space and then save file).
> 5. Build and launch app - all is OK.
>
> On 6/12/2023 5:20 PM, Alexander Dyagilev wrote:
>> Hello,
>>
>> In C++ I'm using Q_NAMESPACE + Q_ENUM_NS and export enum to QML (in 
>> QML I use it like MyCoolEnum.MyCoolValue).
>>
>> I've found a weird issue: I've inserted a new value in the middle of 
>> my enum. And all was suddenly broken. I spent 1 hour trying to 
>> understand what is going on.
>>
>> Full rebuild was not helping. Then, I just made fake modifications in 
>> QML files which uses this enum - and all started working again!
>>
>> So, it appears that QML caches somehow somewhere old enum values and 
>> does not want to refresh them even after the full rebuild of the app.
>>
>> Where are this cached files located? I was not able to find them 
>> inside of the build directory, and this is weird too.
>>


More information about the Interest mailing list