From 917636992b616b64988c20aedadcda8ccd990596 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Wed, 6 Sep 2017 10:22:59 +0200 Subject: [PATCH] some debug code for counting lookups in the hint tables --- src/controls/QskSkinnable.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/controls/QskSkinnable.cpp b/src/controls/QskSkinnable.cpp index d037808f..7b415d4a 100644 --- a/src/controls/QskSkinnable.cpp +++ b/src/controls/QskSkinnable.cpp @@ -25,6 +25,8 @@ #include #include +#define DEBUG_LOOKUP 0 + static inline bool qskIsControl( const QskSkinnable* skinnable ) { #if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) @@ -46,8 +48,16 @@ static inline const QVariant& qskResolvedHint( QskAspect::Aspect aspect, const std::unordered_map< QskAspect::Aspect, QVariant >* skinHints, QskSkinHintStatus* status ) { +#if DEBUG_LOOKUP + static int counter = 0; +#endif + if ( controlHints ) { +#if DEBUG_LOOKUP + qDebug() << aspect << ++counter; +#endif + auto it = controlHints->find( aspect ); if ( it != controlHints->cend() ) { @@ -63,6 +73,10 @@ static inline const QVariant& qskResolvedHint( QskAspect::Aspect aspect, if ( skinHints ) { +#if DEBUG_LOOKUP + qDebug() << aspect << ++counter; +#endif + auto it = skinHints->find( aspect ); if ( it != skinHints->cend() ) {