Есть QVector!Код: struct gStruct { QString *gId; QString *gDesignation; }; gStruct *braceGroups; QVector *gVector;Так правильно создавать вектор, каждый элемент каторого содержит указанную структуру?Код:gVector = new QVector(); if (qsqTransactions->exec("SELECT \"ID_GROUP\", \"DESIGNATION\" FROM \"T_GROUPS\" ORDER BY \"DESIGNATION\";")) { while (qsqTransactions->next()) { braceGroups = new gStruct; braceGroups->gId = new QString(); *braceGroups->gId = qsqTransactions->record().field("ID_GROUP").value().toSt ring(); braceGroups->gDesignation = new QString(); *braceGroups->gDesignation = qsqTransactions->record().field("DESIGNATION").value().t oString(); gVector->push_back(*braceGroups); } }
|