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

Method labelRect

pj_widgets/src/ToggleSwitch.cpp:141–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141QRect ToggleSwitch::labelRect() const {
142 if (text_.isEmpty()) {
143 return {};
144 }
145 const QRect track = trackRect();
146 if (label_side_ == LabelSide::Left) {
147 return {0, 0, track.left() - kLabelSpacing, height()};
148 }
149 return {track.right() + 1 + kLabelSpacing, 0, width() - (track.right() + 1 + kLabelSpacing), height()};
150}
151
152QRect ToggleSwitch::thumbRect() const {
153 const QRect track = trackRect();

Callers

nothing calls this directly

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected