Does not compile on Qt 4.7

Issue #3 resolved
Former user created an issue

When compiling with Qt 4.7 the following error appears:

../../src/json/qjsonparser.cpp: In member function ‘void QJsonPrivate::Parser::ParsedObject::insert(uint)’: ../../src/json/qjsonparser.cpp:358:17: error: ‘class QVarLengthArray<unsigned int, 64>’ has no member named ‘insert’

To my knowledge insert method was adden in Qt 4.8 to QVarLengthArray.

Output of qmake -v: QMake version 2.01a Using Qt version 4.7.4 in /usr/lib64

Comments (4)

  1. Matt Broadstone

    Can you please test that this patch fixes your issue?

    You're correct that this was introduced in 4.8, unfortunately it would be nontrivial for me to add this feature to QVarLengthArray just for 4.7, so my alternative here is to just use QVector. This likely means a pretty serious performance impact, but it's a working path for now.

  2. Martin Gerlach

    Hi,

    The patch works. Maybe calling .reserve(64) in the constructor can reduce the performance impact.

  3. Matt Broadstone

    apologies! for some reason I wasn't "watching" this ticket, so I didn't get your response. Will merge in later today.

  4. Log in to comment