我正在尝试在 qgis 中创建插件。我使用 3 个组合框创建插件工具对话框,其中我从 qgis 层获取数据作为输入,我需要 2 和 3 个组合框的编码来列出输入层数据帧索引。
我使用代码在第一个组合框中获取图层
# Fetch the currently loaded layers
layers = QgsProject.instance().layerTreeRoot().children()
# Clear the contents of the comboBox from previous runs
self.dlg.comboBox.clear()
# Populate the comboBox with names of all the loaded layers
self.dlg.comboBox.addItems([layer.name() for layer in layers])
在组合框 2 和 3 中列出