tools/templates/mainform.cpp
changeset 10208 f04fdb35fc33
parent 8442 535a00ca0d35
equal deleted inserted replaced
10207:9dd3a44805a1 10208:f04fdb35fc33
    96         sl << stream.readLine();
    96         sl << stream.readLine();
    97     }
    97     }
    98     xy->rects.clear();
    98     xy->rects.clear();
    99     for (int i = 0; i < sl.size(); ++i)
    99     for (int i = 0; i < sl.size(); ++i)
   100     {
   100     {
   101         QRegExp re("x:\\s+(\\d+);\\sy:\\s+(\\d+);\\sw:\\s+(\\d+);\\sh:\\s+(\\d+)");
   101         QRegExp re("x:\\s*(\\d+);\\sy:\\s*(\\d+);\\sw:\\s*(\\d+);\\sh:\\s*(\\d+)");
   102         re.indexIn(sl.at(i));
   102         re.indexIn(sl.at(i));
   103         QStringList coords = re.capturedTexts();
   103         QStringList coords = re.capturedTexts();
   104         qDebug() << sl.at(i) << coords;
   104         qDebug() << sl.at(i) << coords;
   105         if ((coords.size() == 5) && (coords[0].size()))
   105         if ((coords.size() == 5) && (coords[0].size()))
   106             xy->rects.push_back(QRect(coords[1].toInt() / 4, coords[2].toInt() / 4, coords[3].toInt() / 4, coords[4].toInt() / 4));
   106             xy->rects.push_back(QRect(coords[1].toInt() / 4, coords[2].toInt() / 4, coords[3].toInt() / 4, coords[4].toInt() / 4));