QT - QWidget의 색상은 어떻게 변경하는가?
글쓴이: mogi / 작성시간: 화, 2009/11/17 - 3:37오후
QWidget의 배경색은 어떻게 변경 하는가??
#include <QApplication> #include <QWidget> #include <QLabel> int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget *window = new QWidget; QLabel *label = new QLabel(window); window->setStyleSheet("background:rgb(0,120,120)"); label->setStyleSheet("background:rgb(120,120,0)"); label->setText("Backgroud color"); label->move(85,40); window->setWindowTitle("Set backgroud color"); window->resize(260,100); window->show(); return app.exec(); }
참고 : http://doc.trolltech.com/4.5/stylesheet.html
File attachments:
첨부 | 파일 크기 |
---|---|
![]() | 6.12 KB |
Forums:
댓글 달기