在我的系统上,正如您在picture中看到的那样,QTabWidget
的背景比窗口背景(#FCFCFC
vs #EFEFEF
)轻。< / p>
但是,当我尝试查询颜色时,
auto tab = new QTabWidget;
tab->addTab(new QWidget, "Test");
setCentralWidget(tab);
auto color = tab->palette.brush(tab->backgroundRole()).color();
qDebug() << color.name() << '\n';
它仍会返回#EFEFEF
(其他角色都没有给我正确的颜色)。
如何查询实际颜色?