| 148 | } |
| 149 | |
| 150 | static 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 | |
| 182 | static QWidget * |
| 183 | widget_from_path (const char *p, int xml_line) |