[Interest] QVariant, enums and gcc (Qt 5.5 vs 5.6 vs 5.7)

Ch'Gans chgans at gna.org
Sun Nov 27 02:32:20 CET 2016


On 27 November 2016 at 07:40, Thiago Macieira <thiago.macieira at intel.com> wrote:
> On sábado, 26 de novembro de 2016 21:58:03 PST Ch'Gans wrote:
>> So my code is build using the same gcc, but behave differently
>> depending on the qt libraries (qt-5.6-official gives different result
>> than qt-6.6-ubuntu).
>> And more disturbing, linking against qt-5.5-official gives different
>> behaviour than when linking against qt-5.6-official...
>
> Of course. There's a new feature in QVariant and the metatype system relating
> to enums. So it's going to work on the newer versions but not on older ones.
>
> That said, the information I can find indicates the feature was introduced in
> 5.5. So it should have worked on all of your tests. Conclusion: the problem is
> not where you're looking.
>
> Please attach a simple[*] testcase so we can investigate further.
>
> [*] simple is: a single .cpp file, less than 200 lines of code, that compiles
> and is self-sufficient. No need to attach the .pro file.

I think i have it (monitoring QStandardItemModel::dataChanged signal),
see attached source file (40 lines! ;)). Hopefully I'm not doing
something stupid...

Output with KUbuntu  16.10, Qt 5.6:
Data changed QVariant(int, 2) Qt::CheckState(Unchecked)
Data changed QVariant(int, 0) Qt::CheckState(Unchecked)

Output with Official Qt 5.5 for Linux:
Data changed QVariant(int, 2) Qt::CheckState(Unchecked)
Data changed QVariant(int, 0) Qt::CheckState(Unchecked)

Output with Official Qt 5.6 for Linux:
Data changed QVariant(int, 2) Qt::CheckState(Checked)
Data changed QVariant(int, 0) Qt::CheckState(Unchecked)

Output with Official Qt 5.7 for Linux:
Data changed QVariant(int, 2) Qt::CheckState(Checked)
Data changed QVariant(int, 0) Qt::CheckState(Unchecked)

Chris


> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Software Architect - Intel Open Source Technology Center
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 1042 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161127/8494eccf/attachment.cpp>


More information about the Interest mailing list