Skip to content

Commit

Permalink
Added more features to gui (including data layer dropdown)
Browse files Browse the repository at this point in the history
  • Loading branch information
fintanosullivan committed Dec 11, 2020
1 parent b899c16 commit 98b679a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions helloworld/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ def run(self):
if self.first_start == True:
self.first_start = False
self.dlg = helloWorldDialog()

# 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])

# show the dialog
self.dlg.show()
Expand Down

0 comments on commit 98b679a

Please sign in to comment.