Fill Screen with a single colour.
I've viewed a lot of drawing examples online but I'm still struggling to work out the best way to simply fill screen with one colour in the simplest possible way. (Literally every pixel set one colour, no window bar, no more.)
I'd like to use QPainter because that would give me a starting point to go on to do some drawing. However I'm wondering if using QSplashScreen might be a *very* quick way to simply fill the screen.
Something like this?
Code:
int main(int argc, char *argv[])
{
pixmap.fill(Qt::white);
splash->setPixmap( pixmap );
splash->show();
return app.exec();
}
Can someone suggest a better method or even better post some example code.
Re: Fill Screen with a single colour.
Hi,
I used this to get rid of the window bar.
Code:
setFrameStyle
(QFrame::NoFrame);
// QFrame::Panel | QFrame::Raised setWindowFlags(Qt::FramelessWindowHint);
You may try to use QCoreApplication::setPalette
I used the following for changing my background color. Set a pixmap or use a QColor for the Brush.
Re: Fill Screen with a single colour.
Quote:
Originally Posted by
TotalNovice
Can someone suggest a better method or even better post some example code.
Code:
int main(int argc, char **argv){
w.setPalette(p);
w.setAutoFillBackground(true);
w.showFullScreen();
return w.exec();
}