Changeset View
Changeset View
Standalone View
Standalone View
src/lib/abstractbarcode.cpp
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | 63 | { | |||
---|---|---|---|---|---|
80 | return out; | 80 | return out; | ||
81 | } | 81 | } | ||
82 | 82 | | |||
83 | void AbstractBarcode::setData(const QString& data) { | 83 | void AbstractBarcode::setData(const QString& data) { | ||
84 | d->m_data=data; | 84 | d->m_data=data; | ||
85 | d->m_cache=QImage(); | 85 | d->m_cache=QImage(); | ||
86 | } | 86 | } | ||
87 | 87 | | |||
88 | #if PRISON_BUILD_DEPRECATED_SINCE(5, 71) | ||||
88 | QSizeF AbstractBarcode::minimumSize() const | 89 | QSizeF AbstractBarcode::minimumSize() const | ||
89 | { | 90 | { | ||
90 | d->recompute(); | 91 | d->recompute(); | ||
91 | 92 | | |||
92 | // ### backward compatibility: this is applying minimum size behavior that the specific | 93 | // ### backward compatibility: this is applying minimum size behavior that the specific | ||
93 | // implementations were doing prior to 5.69. This is eventually to be dropped. | 94 | // implementations were doing prior to 5.69. This is eventually to be dropped. | ||
94 | if (d->m_cache.isNull()) { | 95 | if (d->m_cache.isNull()) { | ||
95 | return {}; | 96 | return {}; | ||
96 | } | 97 | } | ||
97 | switch (d->m_dimension) { | 98 | switch (d->m_dimension) { | ||
98 | case NoDimensions: | 99 | case NoDimensions: | ||
99 | return {}; | 100 | return {}; | ||
100 | case OneDimension: | 101 | case OneDimension: | ||
101 | return QSizeF(d->m_cache.width(), std::max(d->m_cache.height(), 10)); | 102 | return QSizeF(d->m_cache.width(), std::max(d->m_cache.height(), 10)); | ||
102 | case TwoDimensions: | 103 | case TwoDimensions: | ||
103 | return d->m_cache.size() * 4; | 104 | return d->m_cache.size() * 4; | ||
104 | } | 105 | } | ||
105 | 106 | | |||
106 | return d->m_cache.size(); | 107 | return d->m_cache.size(); | ||
107 | } | 108 | } | ||
109 | #endif | ||||
108 | 110 | | |||
109 | QSizeF AbstractBarcode::trueMinimumSize() const | 111 | QSizeF AbstractBarcode::trueMinimumSize() const | ||
110 | { | 112 | { | ||
111 | d->recompute(); | 113 | d->recompute(); | ||
112 | return d->m_cache.size(); | 114 | return d->m_cache.size(); | ||
113 | } | 115 | } | ||
114 | 116 | | |||
115 | QSizeF AbstractBarcode::preferredSize(qreal devicePixelRatio) const | 117 | QSizeF AbstractBarcode::preferredSize(qreal devicePixelRatio) const | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |