How to access an element the better way QT

  c++, dictionary, loops, qt

I have a QLst which exists of a QMAP list with a map behind

m_currentEPG    <1651 Elemente> QList<QVariant>             [0] <17 Elemente>   QVariant (QVariantMap)
                [0] "channelIcon"   "imagecache/429"    
                    key "channelIcon"   QString
                    value   "imagecache/429"    QVariant (QString)
                [1] "channelName"   "test"  
                    key "channelName"   QString
                    value   "tes"   QVariant (QString)

How can I fast iterate through this list and print all channel names?

I do it like this

for (auto ob : m_currentEPG) {
               QDebug << ob.toMap().value("channelName").toString();
}

Is there any faster way?

Source: Windows Questions C++

LEAVE A COMMENT