Teuniz
28th August 2006, 13:16
I use a QLCDNumber and I changed the color of the background like this:
lCDNumber1 = new QLCDNumber(myobjectDialog);
lCDNumber1->setGeometry(QRect(240, 810, 130, 40));
lCDNumber1->setLineWidth(1);
lCDNumber1->setSmallDecimalPoint(FALSE);
lCDNumber1->setNumDigits(7);
lCDNumber1->setSegmentStyle(QLCDNumber::Flat);
lCDNumber1->setProperty("value", 0);
lcdpalette = new QPalette;
lcdpalette->setColor(QPalette::Background, QColor(170, 255, 0));
lcdpalette->setColor(QPalette::Base, QColor(170, 255, 0));
lcdpalette->setColor(QPalette::AlternateBase, QColor(170, 255, 0));
lCDNumber1->setPalette(*lcdpalette);
In Linux it works ok, but in Windows XP the backgroundcolor of the QLCDNumber
is lightgrey instead of green. I changed the style to Plastique with:
app.setStyle(new QPlastiqueStyle);
this changed the style to plastic in Windows XP but I still can not change the
backgroundcolor of QLCDNumber.
What do I need to do to get this working in Windows XP?
Regards, Teuniz
lCDNumber1 = new QLCDNumber(myobjectDialog);
lCDNumber1->setGeometry(QRect(240, 810, 130, 40));
lCDNumber1->setLineWidth(1);
lCDNumber1->setSmallDecimalPoint(FALSE);
lCDNumber1->setNumDigits(7);
lCDNumber1->setSegmentStyle(QLCDNumber::Flat);
lCDNumber1->setProperty("value", 0);
lcdpalette = new QPalette;
lcdpalette->setColor(QPalette::Background, QColor(170, 255, 0));
lcdpalette->setColor(QPalette::Base, QColor(170, 255, 0));
lcdpalette->setColor(QPalette::AlternateBase, QColor(170, 255, 0));
lCDNumber1->setPalette(*lcdpalette);
In Linux it works ok, but in Windows XP the backgroundcolor of the QLCDNumber
is lightgrey instead of green. I changed the style to Plastique with:
app.setStyle(new QPlastiqueStyle);
this changed the style to plastic in Windows XP but I still can not change the
backgroundcolor of QLCDNumber.
What do I need to do to get this working in Windows XP?
Regards, Teuniz