On 19/12/2018 11:37, Konstantin Shegunov wrote:
On Wed, Dec 19, 2018 at 11:22 AM Tom Isaacson <tom.isaac...@navico.com
<mailto:tom.isaac...@navico.com>> wrote:
Is it possible to use QMetaEnum::keyCount() to initialise an array?
Something like:
const QMetaEnum metaEnum = QMetaEnum::fromType<MyArray>();
int MyArray[metaEnum.keyCount()];
constQMetaEnummetaEnum=QMetaEnum::fromType<Qt::Alignment>();
intMyArray[metaEnum.keyCount()];
Compiles for me (with g++ 8.2,-std=gnu++11 which is expanded from
CONFIG+=c++11).
Unfortunately, that's a variable length array, which is a GNU extension.
_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest