void QG_DlgOptionsGeneral::set_color(QComboBox* combo, QColor custom) { QColor current; current.setNamedColor(combo->lineEdit()->text()); QColorDialog dlg; dlg.setCustomColor(0, custom.rgb()); QColor color = dlg.getColor(current, this, "Select Color", QColorDialog::DontUseNativeDialog); if (color.isValid()) { combo->lineEdit()->setText(color.name()); } }