Answer the question
In order to leave comments, you need to log in
How to programmatically change the color of a QFrame?
Hello. It is necessary to draw frames in the course of execution and change their color. I do it like this:
ffd.frame = new QFrame(ui->VideoLabel);
QPalette palette;
QBrush brush(QColor(0, 255, 0, 255));
brush.setStyle(Qt::SolidPattern);
palette.setBrush(QPalette::All, QPalette::Window, brush);
ffd.frame->setPalette(palette);
ffd.frame->setGeometry(x,y,width,height);
ffd.frame->setFrameShape(QFrame::Box);
ffd.frame->setFrameShadow(QFrame::Plain);
ffd.frame->setAutoFillBackground(false);
ffd.frame->setLineWidth(2);
ffd.frame->show();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question