I have this C++ code which I am not able to understand from some time. I need to write an equivalent code in Python.
eLst
is an instance of structure tEins
.
for(int iEng = 0; iEng < eLst.length(); iEng++)
{
//loop over connectors
QList <QString> connKeys = eLst.at(iEng).connectors.uniqueKeys();
for(int iCon = 0; iCon < connKeys.length(); iCon++)
{
QString connName = eLst.at(iEng).connectors[connKeys.at(iCon)].name;
//loop over frameports(frames) of connector
QList <QString> frPortKeys = eLst.at(iEng).connectors[connKeys.at(iCon)].framePorts.uniqueKeys();
// ...
}
}
Definitions of the structures used in the above code snippet:
typedef struct Eins
{
QString name;
QHash<QString, tCanController> commControllers;
QHash<QString, tCanConnector> connectors;
} tEIns
typedef struct CanConnector
{
QString name;
QString controllerName;
QHash<QString, tFramePort> framePorts;
QHash<QString, tCanFrame> inOutFrames;
} tCanConnector;
typedef struct CanController
{
QString name;
} tCanController;