MCPcopy Create free account
hub / github.com/KLayout/klayout / extract_widget_path

Function extract_widget_path

src/laybasic/laybasic/gtf.cc:150–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150static bool extract_widget_path (tl::Extractor &x, std::string &name, std::string &cls, int &nwidget)
151{
152 name.clear ();
153 cls.clear ();
154
155 nwidget = 1;
156
157 if (! x.at_end ()) {
158 x.read (name, "(.#");
159 if (*x == '(') {
160 ++x;
161 x.read (cls, ")#");
162 if (*x == ')') {
163 ++x;
164 }
165 }
166 if (*x == '#') {
167 ++x;
168 x.read (nwidget);
169 }
170 }
171
172 if (! x.test (".")) {
173 if (! x.at_end ()) {
174 throw tl::Exception (tl::to_string (QObject::tr ("Invalid widget path: expected '.'")));
175 }
176 return false;
177 } else {
178 return true;
179 }
180}
181
182static QWidget *
183widget_from_path (const char *p, int xml_line)

Callers 2

widget_from_pathFunction · 0.85
equalsMethod · 0.85

Calls 7

ExceptionClass · 0.50
to_stringFunction · 0.50
trFunction · 0.50
clearMethod · 0.45
at_endMethod · 0.45
readMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected