'choices: couples (name, key)'

def create_combobox(self, text, choices, option, default=NoDefault, tip=None, restart=False):

    label = QLabel(text)
    combobox = QComboBox()
    if (tip is not None):
        combobox.setToolTip(tip)
    for (name, key) in choices:
        if (not ((name is None) and (key is None))):
            combobox.addItem(name, to_qvariant(key))
    count = 0
    for (index, item) in enumerate(choices):
        (name, key) = item
        if ((name is None) and (key is None)):
            combobox.insertSeparator((index + count))
            count += 1
    self.comboboxes[combobox] = (option, default)
    layout = QHBoxLayout()
    layout.addWidget(label)
    layout.addWidget(combobox)
    layout.addStretch(1)
    layout.setContentsMargins(0, 0, 0, 0)
    widget = QWidget(self)
    widget.label = label
    widget.combobox = combobox
    widget.setLayout(layout)
    combobox.restart_required = restart
    combobox.label_text = text
    return widget
