ComboBox checkable


#1

Any help,
I’ve made a combobox contains set of items. I want it to be checkable that user can select more than item from it.
code :-

class Ui_Form2(object):

def setupUi(self, Form):

    Form.setObjectName("Form")
    Form.resize(587, 646)
    self.comboBox_4 = QtWidgets.QComboBox(Form)
    self.comboBox_4.setGeometry(QtCore.QRect(70, 130, 71, 22))
    self.comboBox_4.setStyleSheet("QComboBox {\n"

" border-top: 1px solid #96d1f8;\n"
" background: #65a9d7;\n"
" background: -webkit-gradient(linear, left top, left bottom, from(#3e779d), to(#65a9d7));\n"
" background: -webkit-linear-gradient(top, #3e779d, #65a9d7);\n"
" background: -moz-linear-gradient(top, #3e779d, #65a9d7);\n"
" background: -ms-linear-gradient(top, #3e779d, #65a9d7);\n"
" background: -o-linear-gradient(top, #3e779d, #65a9d7);\n"
" padding: 3.5px 7px;\n"
" -webkit-border-radius: 0px;\n"
" -moz-border-radius: 0px;\n"
" border-radius: 0px;\n"
" -webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;\n"
" -moz-box-shadow: rgba(0,0,0,1) 0 1px 0;\n"
" box-shadow: rgba(0,0,0,1) 0 1px 0;\n"
" text-shadow: rgba(0,0,0,.4) 0 1px 0;\n"
" color: white;\n"
" font-size: 12px;\n"
" font-family: Georgia, serif;\n"
" text-decoration: none;\n"
" vertical-align: middle;\n"
" }\n"
“.QComboBox:hover {\n”
" border-top-color: #28597a;\n"
" background: #28597a;\n"
" color: #ccc;\n"
" }\n"
“.QComboBox:active {\n”
" border-top-color: #1b435e;\n"
" background: #1b435e;\n"
" }")
self.comboBox_4.setObjectName(“comboBox_4”)
self.comboBox_4.addItem("")
self.comboBox_4.addItem("")
self.comboBox_4.addItem("")
self.comboBox_4.addItem("")
self.comboBox_4.addItem("")
self.comboBox_4.addItem("")
self.comboBox_4.addItem("")

def retranslateUi(self, Form):
    _translate = QtCore.QCoreApplication.translate
    Form.setWindowTitle(_translate("Form", "2nd PAN"))
   
    self.comboBox_4.setItemText(0, _translate("Form", "Bump"))
    self.comboBox_4.setItemText(1, _translate("Form", "Tunnel"))
    self.comboBox_4.setItemText(2, _translate("Form", "Curves"))
    self.comboBox_4.setItemText(3, _translate("Form", "Railway"))
    self.comboBox_4.setItemText(4, _translate("Form", "Speed humps"))
    self.comboBox_4.setItemText(5, _translate("Form", "Cat\'s eyes"))
    self.comboBox_4.setItemText(6, _translate("Form", "All"))
    self.label_5.setText(_translate("Form", "PAN"))

if name == “main”:
import sys
app = QtWidgets.QApplication(sys.argv)
Form = QtWidgets.QWidget()
ui = Ui_Form2()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec_())