QComboBox *comboBox = new QComboBox();
comboBox->addItem(QObject::tr("Red"), Qt::red);
...
QObject::connect(comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changePenColor()));
QPen pen;
QColor color = comboBox->itemData(comboBox->currentIndex(), Qt::UserRole).value<QColor>();
pen.setColor(color);