打开报错文件的相应位置,改为如下代码
qreal QLineF::length() const
{
// using std::hypot;
return hypot(dx(), dy());
}
后面还有几个类似错误,都是由std::导致的,相应代码删掉或注释掉报错的std::就行。
例如qt源码中
float applyInverseExtended(float x) const
{
if (x >= 0.0f && x <= 1.0f)
return applyInverse(x);
if (m_type == Type::Function)
// return std::copysign(applyInverse(x), x);
return copysign(applyInverse(x), x);
if (m_type == Type::Table)
return x < 0.0f ? 0.0f : 1.0f;
return x;
}
static inline bool canUseFastMatrixPath(const qreal cx, const qreal cy, const qsizetype length, const QSpanData *data)
{
if (Q_UNLIKELY(!data->fast_matrix))
return false;
qreal fx = (data->m21 * cy + data->m11 * cx + data->dx) * fixed_scale;
qreal fy = (data->m22 * cy + data->m12 * cx + data->dy) * fixed_scale;
qreal minc = std::min(fx, fy);
qreal maxc = std::max(fx, fy);
// fx += std::trunc(data->m11 * fixed_scale) * length;
// fy += std::trunc(data->m12 * fixed_scale) * length;
fx += trunc(data->m11 * fixed_scale) * length;
fy += trunc(data->m12 * fixed_scale) * length;
minc = std::min(minc, std::min(fx, fy));
maxc = std::max(maxc, std::max(fx, fy));
return minc >= std::numeric_limits<int>::min() && maxc <= std::numeric_limits<int>::max();
}
int QRhi::mipLevelsForSize(const QSize &size) const
{
// return qFloor(std::log2(qMax(size.width(), size.height()))) + 1;
return qFloor(log2(qMax(size.width(), size.height()))) + 1;
}
ReturnedValue MathObject::method_trunc(const FunctionObject *, const Value *, const Value *argv, int argc)
{
double v = argc ? argv[0].toNumber() : qt_qnan();
#ifdef Q_OS_ANDROID // incomplete std :-(
if (std::isnan(v) || qt_is_inf(v) || qIsNull(v))
RETURN_RESULT(Encode(v));
// Nearest integer not greater in magnitude:
quint64 whole = std::abs(v);
RETURN_RESULT(Encode(copySign(whole, v)));
#else
// RETURN_RESULT(Encode(std::trunc(v)));
RETURN_RESULT(Encode(trunc(v)));
#endif
}
还有些就不依次列举了
1668

被折叠的 条评论
为什么被折叠?



