QT - QWidget의 색상은 어떻게 변경하는가?

mogi의 이미지

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: 
첨부파일 크기
Image icon 02.png6.12 KB
Forums: