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![]()
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![]()
Think DigitalGasoline
paletteBackgroundColor()
raphaelf (16th May 2007)
QWidget::setPaletteBackgroundColor() is a Qt3 support member.
Qt Code:
// set palette.setColor(ui.l1_le->backgroundRole(), Qt::yellow); ui.l1_le->setPalette(palette); // getTo copy to clipboard, switch view to plain text mode
Instead of "ui.l1_le->backgroundRole()" you may also directly use QPalette::Base which is used as a background role of text entry widgets.
J-P Nurmi
raphaelf (16th May 2007)
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);
Think DigitalGasoline
I could solve my problem like that:
Thanks![]()
Qt Code:
//QMessageBox::information(this,"LernIT",QString::number(a)); if (color == "#ffff00") insert(); else solve();To copy to clipboard, switch view to plain text mode
Think DigitalGasoline
Bookmarks