I'm trying QgsCheckableComboBox()
in my simple python script in QGIS. How to pause code execution while a comboBox-window is open (like a dialog box)? In my example, I want to ensure that the print()
function is executed only after the comboBox-window is closed. Then the checkedItems
list will not be empty and will contain the selected lines ("Venus", "Earth", "Mars"). How can I achieve this?
from qgis.PyQt import QtGui
from qgis.core import *
planet_list = ["Venus", "Earth", "Mars", "Jupiter", "Pluto"]
items = QgsCheckableComboBox()
items.addItems(planet_list)
items.showNormal()
print('\n\n-----------CheckedItems: ', items.checkedItems())
print()
is not waiting for the combo box interaction?