Getting background color of a frame value in a Label
-
I am trying to get the red value of the background color of a frame, to put it into a label.
This color value has been set by a QColorDialog, and applied with QPalette.
There is no value in my label... What am I doing wrong?Here's the code
void PatternEditor::on_boutonCouleurInit_clicked()
{
QColor couleur = QColorDialog::getColor(Qt::white, this); //sets couleur with QColorDialogQPalette palette; palette.setColor(QPalette::Background, couleur); //sets background color ui->initColorWidget->setAutoFillBackground(true); ui->initColorWidget->setPalette(palette); //apply color to the background's frame ui->codeCouleurInitLabel->setText(QChar(couleur.red())); //(should) set text of my label with the red color value of couleur
}