tommy
13th January 2008, 18:15
This is how I change the backround or my QLabel
QPalette Pal2(pixmapLabel->palette());
Pal2.setColor(QPalette::Window, Qt::gray);
pixmapLabel->setAutoFillBackground(true);
pixmapLabel->setPalette(Pal2);
I would now like to change the background color to rgb color where I replace "Qt::gray" with RGB numbers. How do I do that?
So far I've tried this.
Pal2.setColor(QPalette::Window, QColor::rgb(150,150,150));
and
Pal2.setColor(QPalette::Window, QRgb::rgb(150,150,150));
but neither work.
QPalette Pal2(pixmapLabel->palette());
Pal2.setColor(QPalette::Window, Qt::gray);
pixmapLabel->setAutoFillBackground(true);
pixmapLabel->setPalette(Pal2);
I would now like to change the background color to rgb color where I replace "Qt::gray" with RGB numbers. How do I do that?
So far I've tried this.
Pal2.setColor(QPalette::Window, QColor::rgb(150,150,150));
and
Pal2.setColor(QPalette::Window, QRgb::rgb(150,150,150));
but neither work.