#include <QtGui>
int main(int argc, char **argv){
mw.setCentralWidget(w);
w->setAutoFillBackground(true);
w->setStyleSheet("background-color: red;");
mw.show();
return app.exec();
}
#include <QtGui>
int main(int argc, char **argv){
QApplication app(argc, argv);
QMainWindow mw;
QWidget *w = new QWidget;
mw.setCentralWidget(w);
w->setAutoFillBackground(true);
w->setStyleSheet("background-color: red;");
mw.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
or...
#include <QtGui>
int main(int argc, char **argv){
mw.setCentralWidget(w);
w->setAutoFillBackground(true);
// w->setStyleSheet("background-color: red;");
p.
setColor(QPalette::Background, Qt
::yellow);
w->setPalette(p);
mw.show();
return app.exec();
}
#include <QtGui>
int main(int argc, char **argv){
QApplication app(argc, argv);
QMainWindow mw;
QWidget *w = new QWidget;
mw.setCentralWidget(w);
w->setAutoFillBackground(true);
// w->setStyleSheet("background-color: red;");
QPalette p = w->palette();
p.setColor(QPalette::Background, Qt::yellow);
w->setPalette(p);
mw.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks