63QQuickGridScaledImage::QQuickGridScaledImage()
64: _l(-1), _r(-1), _t(-1), _b(-1),
65 _h(QQuickBorderImage::Stretch), _v(QQuickBorderImage::Stretch)
69QQuickGridScaledImage::QQuickGridScaledImage(
const QQuickGridScaledImage &o)
70: _l(o._l), _r(o._r), _t(o._t), _b(o._b), _h(o._h), _v(o._v), _pix(o._pix)
86QQuickGridScaledImage::QQuickGridScaledImage(QIODevice *data)
87: _l(-1), _r(-1), _t(-1), _b(-1), _h(QQuickBorderImage::Stretch), _v(QQuickBorderImage::Stretch)
96 while (raw = data->readLine(), !raw.isEmpty()) {
97 QString line = QString::fromUtf8(raw.trimmed());
98 if (line.isEmpty() || line.startsWith(QLatin1Char(
'#')))
101 int colonId = line.indexOf(QLatin1Char(
':'));
105 const QStringView property = QStringView{line}.left(colonId).trimmed();
106 QStringView value = QStringView{line}.mid(colonId + 1).trimmed();
108 if (property == QLatin1String(
"border.left")) {
110 }
else if (property == QLatin1String(
"border.right")) {
112 }
else if (property == QLatin1String(
"border.top")) {
114 }
else if (property == QLatin1String(
"border.bottom")) {
116 }
else if (property == QLatin1String(
"source")) {
117 if (value.startsWith(QLatin1Char(
'"')) && value.endsWith(QLatin1Char(
'"')))
118 value = value.mid(1, value.size() - 2);
119 imgFile = value.toString();
120 }
else if (property == QLatin1String(
"horizontalTileRule") || property == QLatin1String(
"horizontalTileMode")) {
121 _h = stringToRule(value);
122 }
else if (property == QLatin1String(
"verticalTileRule") || property == QLatin1String(
"verticalTileMode")) {
123 _v = stringToRule(value);
127 if (l < 0 || r < 0 || t < 0 || b < 0 || imgFile.isEmpty())
130 _l = l; _r = r; _t = t; _b = b;