infos = bertos_utils.loadCpuInfos(self._projectInfoRetrieve("SOURCES_PATH"))
for cpu in infos:
item = QListWidgetItem(cpu["CPU_NAME"])
- # The CPU_DESC field in the cpu definition is a list of string, so we need to
- # store it as a QStringList in a QVariant
- item.setData(Qt.UserRole, QVariant(cpu))
+ item.setData(Qt.UserRole, qvariant_converter.convertDict(cpu))
self.pageContent.cpuList.addItem(item)
def _connectSignals(self):
toolchains = self.toolchains()
for element in toolchains:
item = QListWidgetItem(element)
- item.setData(Qt.UserRole, QVariant(element))
+ item.setData(Qt.UserRole, qvariant_converter.convertString(element))
self.pageContent.toolchainList.addItem(item)
def _clearList(self):
toolchainList = set(toolchainList) - set(storedToolchainList)
for element in toolchainList:
item = QListWidgetItem(element)
- item.setData(Qt.UserRole, QVariant(element))
+ item.setData(Qt.UserRole, qvariant_converter.convertString(element))
self.pageContent.toolchainList.addItem(item)
self.setToolchains(list(toolchainList.union(storedToolchainList)))
sel_toolchain = QFileDialog.getOpenFileName(self, self.tr("Choose the toolchain"), "")
if not sel_toolchain.isEmpty():
item = QListWidgetItem(sel_toolchain)
- item.setData(Qt.UserRole, QVariant(sel_toolchain))
+ item.setData(Qt.UserRole, qvariant_converter.convertString(sel_toolchain))
self.pageContent.toolchainList.addItem(item)
toolchains = self.toolchains()
toolchains = set(toolchains + [sel_toolchain])
def _insertListElement(self, directory):
if bertos_utils.isBertosDir(directory):
item = QListWidgetItem(QIcon(":/images/ok.png"), bertos_utils.bertosVersion(directory) + " (\"" + directory + "\")")
- item.setData(Qt.UserRole, QVariant(directory))
+ item.setData(Qt.UserRole, qvariant_converter.convertString(directory))
self.pageContent.versionList.addItem(item)
elif len(directory) > 0:
item = QListWidgetItem(QIcon(":/images/warning.png"), "UNKNOWN" + " (\"" + directory + "\")")
- item.setData(Qt.UserRole, QVariant(directory))
+ item.setData(Qt.UserRole, qvariant_converter.convertString(directory))
self.pageContent.versionList.addItem(item)
def _fillVersionList(self):