I happen to have used the qcombobox, but could not find a way to add a dummy placeholder (like we have in tkinter). For example, the combobox I'd like to have is something like this:
--Choose One--
Apple
Banana
Kiwi
I already have the elements; Apple, Banana, Kiwi in place but I want the --Choose One-- vanished when I click on it.
**Tkinter version**
from tkinter import ttk
#---
#some code here
#---
lst = ['Apple','Banana','Kiwi']
self.w0 = ttk.Combobox(self, values = lst, state='readonly')
self.w0.set('--Choose One--') ### This is the functionality that I need
self.w0.pack()
**PyQt version**
from PyQt5 import QtWidgets
lst = ['Apple','Banana','Kiwi']
#---
#some code here
#---
self.comboBox = QtWidgets.QComboBox()
self.comboBox.addItems(lst)
self.layout.addWidget(self.comboBox) ## self.layout is defined but not shown here
### I might add it as an item of the comboBox like
### self.comboBox.addItem('--Choose One--') but it then becomes selectable
### which I don't want it to.