From 8a806a5386e50b2d7215d3933a71a384d478e585 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 27 Jul 2017 15:49:21 +0200 Subject: [PATCH] registering of subcontrols has to start with 1, 0 is reserved for QskAspect::Control --- src/common/QskAspect.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/common/QskAspect.cpp b/src/common/QskAspect.cpp index 78cb0159..12d9aa43 100644 --- a/src/common/QskAspect.cpp +++ b/src/common/QskAspect.cpp @@ -65,7 +65,8 @@ QskAspect::Subcontrol QskAspect::nextSubcontrol( names += name; - const auto subControl = static_cast< Subcontrol >( names.size() - 1 ); + // 0 is QskAspect::Control, we hav to start with 1 + const auto subControl = static_cast< Subcontrol >( names.size() ); hashTable[ metaObject ] += subControl; return subControl; @@ -76,8 +77,8 @@ QByteArray QskAspect::subControlName( Subcontrol subControl ) const auto& names = qskAspectRegistry->subControlNames; const int index = subControl; - if ( index >= 0 && index < names.size() ) - return names[ index ]; + if ( index > 0 && index < names.size() ) + return names[ index - 1 ]; return QByteArray(); }