Hello everybody,
OS:Winxp
QT 4.1.3
I can set a color to a lineedit, now i would like to get the color. is this possible?
set color:
ui.l1_le->setPaletteBackgroundColor("yellow");
get color:
?????
Thanks :)
Printable View
Hello everybody,
OS:Winxp
QT 4.1.3
I can set a color to a lineedit, now i would like to get the color. is this possible?
set color:
ui.l1_le->setPaletteBackgroundColor("yellow");
get color:
?????
Thanks :)
paletteBackgroundColor()
QWidget::setPaletteBackgroundColor() is a Qt3 support member.
Code:
// set palette.setColor(ui.l1_le->backgroundRole(), Qt::yellow); ui.l1_le->setPalette(palette); // get
Instead of "ui.l1_le->backgroundRole()" you may also directly use QPalette::Base which is used as a background role of text entry widgets.
Hello,
Thank you very much..
But how could i convert it to String?
For this for example:
QColor color = ui.l1_le->palette().color(ui.l1_le->backgroundRole());
QMessageBox::information(this,"LernIT",color);
I could solve my problem like that:
Thanks :D
Code:
//QMessageBox::information(this,"LernIT",QString::number(a)); if (color == "#ffff00") insert(); else solve();