QT QLabel設置字體的顏色

第一種,使用setPalette()方法以下:c++ QLabel *label = new QLabel(tr("Hello Qt!")); QPalette pe; pe.setColor(QPalette::WindowText,Qt::white); label->setPalette(pe); 第二種,使用樣式表以下:web setStyleSheet("colo
相關文章
相關標籤/搜索