Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.0
-
None
Description
The style sheet documentation lists "accent" as a valid palette role, but this doesn't seem to work. I guess if this is not expected to work, then the documentation should be adjusted. I also expected "placeholder-text" to work, although this isn't documented and much less useful.
#include <QApplication> #include <QFormLayout> #include <QFrame> #include <QWidget> static const QStringList kNames = { "alternate-base", "accent", "base", "bright-text", "button", "button-text", "dark", "highlight", "highlighted-text", "light", "link", "link-visited", "mid", "midlight", "placeholder-text", "shadow", "text", "window", "window-text" }; int main(int argc, char *argv[]) { QApplication app(argc, argv); QWidget window; QFormLayout *layout = new QFormLayout(&window); foreach (const QString &name, kNames) { QFrame *widget = new QFrame(&window); widget->setStyleSheet( QString("QFrame {background: palette(%1)}").arg(name)); widget->setMinimumSize(32, 32); layout->addRow(name, widget); } window.show(); return app.exec(); }
Attachments
Issue Links
- relates to
-
QTBUG-116107 Rename QPalette's accentColor role to accent
- Closed