Use QColor from getColor on QLabel and QTextbox

//To use color on text and label 
//Simple sample :)
QColor color = QColorDialog::getColor(QColor(ui->backgroundColorPickerText->text()), this);
   if(color.isValid())
    {
 
        QPixmap pix(21, 21);
        pix.fill(color);
 
        ui->backgroundColorPickerLabel->setPixmap(pix);
        ui->backgroundColorPickerText->setText(color.name());
    }

Popularity: 60% [?]

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks

Leave a Reply