// 例:获取 label 控件中的字体颜色
QLabel *label = new QLabel("Hello", nullptr);
QPalette pl = label->palette();
QColor textColor = pl.color(QPalette::Text);
Qt 在代码中获取样式表中定义的字体颜色方法
最新推荐文章于 2023-11-23 22:05:41 发布
// 例:获取 label 控件中的字体颜色
QLabel *label = new QLabel("Hello", nullptr);
QPalette pl = label->palette();
QColor textColor = pl.color(QPalette::Text);