MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / widgetNameWithTopLevel

Function widgetNameWithTopLevel

src/settingsutilities.cpp:134–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134QString widgetNameWithTopLevel(const QWidget* widget)
135{
136 QStringList components;
137
138 auto* tl = widget->window();
139
140 if (tl == widget) {
141 // this is a top level widget, such as a dialog
142 components.push_back(widget->objectName());
143 } else {
144 // this is a widget
145 const auto toplevelName = tl->objectName();
146 if (!toplevelName.isEmpty()) {
147 components.push_back(toplevelName);
148 }
149
150 const auto widgetName = widget->objectName();
151 if (!widgetName.isEmpty()) {
152 components.push_back(widgetName);
153 }
154 }
155
156 if (components.isEmpty()) {
157 // can't do much
158 return "unknown_widget";
159 }
160
161 return components.join("_");
162}
163
164QString widgetName(const QMainWindow* w)
165{

Callers 3

widgetNameFunction · 0.85
indexSettingNameFunction · 0.85
checkedSettingNameFunction · 0.85

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected