18#include <QAbstractSpinBox>
19#include <QApplication>
20#include <QStandardPaths>
22static inline bool clipLineToEdge(qreal& t0, qreal& t1, qreal p, qreal q)
38 qreal x1 = line.
x1(), x2 = line.
x2(), dx = line.
dx(), y1 = line.
y1(), y2 = line.
y2(), dy = line.
dy();
40 if ((t0 == 0 && t1 == 1 && ((x1 < left && x2 < left) ||
41 (x1 > right && x2 > right) ||
42 (y1 < top && y2 < top) ||
43 (y1 > bottom && y2 > bottom))) ||
44 !clipLineToEdge(t0, t1, -dx, x1 - left) ||
45 !clipLineToEdge(t0, t1, dx, right - x1) ||
46 !clipLineToEdge(t0, t1, -dy, y1 - top) ||
47 !clipLineToEdge(t0, t1, dy, bottom - y1)) {
52 return {line.
x1() + line.
dx() * t0,
53 line.
y1() + line.
dy() * t0,
54 line.
x1() + line.
dx() * t1,
55 line.
y1() + line.
dy() * t1};
105quint64 imageSize(
const QImage& img)
107#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
116 static const char alphanum[] =
"0123456789abcdefghijklmnopqrstuvwxyz";
117 const int alphanumLen =
sizeof(alphanum);
119 if (len > 128) len = 128;
122 for (
int i = 0; i < len; ++i)
124 s[i] = alphanum[rand() % (alphanumLen - 1)];
QString applicationDirPath()
int byteCount() const const
qsizetype sizeInBytes() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString findExecutable(const QString &executableName, const QStringList &paths)
QString fromUtf8(const char *str, int size)
bool isEmpty() const const
QTextStream & left(QTextStream &stream)
QTextStream & right(QTextStream &stream)