MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / roleToToken

Function roleToToken

pj_widgets/src/MessageBox.cpp:24–36  ·  view source on GitHub ↗

Maps the C++ enum to the string the QSS selectors key off.

Source from the content-addressed store, hash-verified

22
23// Maps the C++ enum to the string the QSS selectors key off.
24const char* roleToToken(MessageBox::ButtonRole role) {
25 switch (role) {
26 case MessageBox::kPrimaryRole:
27 return "primary";
28 case MessageBox::kNeutralRole:
29 return "neutral";
30 case MessageBox::kDestructiveRole:
31 return "destructive";
32 case MessageBox::kCancelRole:
33 return "cancel";
34 }
35 return "neutral";
36}
37
38// Layout insets used to derive the per-line wrap budget for button labels.
39// They mirror values set elsewhere — the card content margin in the ctor

Callers 1

addButtonMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected