32 #include <qcompilerdetection.h>
35 #include <QStringList>
57 #define SceneSize 50000
288 S22=22,
S24=24,
S26=26,
S28=28,
S30=30,
S32=32,
S34=34,
S36=36,
S38=38,
S40=40,
289 S42=42,
S44=44,
S46=46,
S48=48,
S50=50,
S52=52,
S54=54,
S56=56,
S58=58,
S60=60,
298 #define QIMAGE_MAX 32768
317 #define SCASSERT(cond) \
321 qCritical("ASSERT: %s in %s (%s:%u)", \
322 #cond, Q_FUNC_INFO , __FILE__, __LINE__); \
329 #define SCASSERT(cond) qt_noop();
332 #ifndef __has_cpp_attribute
333 # define __has_cpp_attribute(x) 0
336 #if __cplusplus > 201402L && __has_cpp_attribute(fallthrough)
337 # define V_FALLTHROUGH [[fallthrough]];
338 #elif defined(Q_CC_CLANG) && __cplusplus >= 201103L
340 # define V_FALLTHROUGH [[clang::fallthrough]];
341 #elif defined(Q_CC_MSVC)
347 # define V_FALLTHROUGH __fallthrough;
348 #elif defined(Q_CC_GNU) && (__GNUC__ >= 7)
349 # define V_FALLTHROUGH [[gnu::fallthrough]];
351 # define V_FALLTHROUGH
355 bool IsOptionSet(
int argc,
char *argv[],
const char *option);
361 extern const QString
sin_F;
362 extern const QString
cos_F;
363 extern const QString
tan_F;
364 extern const QString
asin_F;
365 extern const QString
acos_F;
366 extern const QString
atan_F;
367 extern const QString
sinh_F;
368 extern const QString
cosh_F;
369 extern const QString
tanh_F;
373 extern const QString
sinD_F;
374 extern const QString
cosD_F;
375 extern const QString
tanD_F;
379 extern const QString
log2_F;
381 extern const QString
log_F;
382 extern const QString
ln_F;
383 extern const QString
exp_F;
384 extern const QString
sqrt_F;
385 extern const QString
sign_F;
386 extern const QString
rint_F;
387 extern const QString
abs_F;
388 extern const QString
min_F;
389 extern const QString
max_F;
390 extern const QString
sum_F;
391 extern const QString
avg_F;
392 extern const QString
fmod_F;
446 extern const QString
unitMM;
447 extern const QString
unitCM;
449 extern const QString
unitPX;
451 void SetItemOverrideCursor(QGraphicsItem *item,
const QString & pixmapPath,
int hotX = -1,
int hotY = -1);
455 Q_REQUIRED_RESULT
double ToPixel(
double val,
const Unit &unit);
456 Q_REQUIRED_RESULT
double FromPixel(
double pix,
const Unit &unit);
459 Q_REQUIRED_RESULT QMarginsF
UnitConvertor(
const QMarginsF &margins,
const Unit &from,
const Unit &to);
465 Q_REQUIRED_RESULT QString
strippedName(
const QString &fullFileName);
466 Q_REQUIRED_RESULT QString
RelativeMPath(
const QString &patternPath,
const QString &absoluteMPath);
467 Q_REQUIRED_RESULT QString
AbsoluteMPath(
const QString &patternPath,
const QString &relativeMPath);
470 QPrinter::PrinterMode mode = QPrinter::ScreenResolution);
475 Q_REQUIRED_RESULT QPixmap
darkenPixmap(
const QPixmap &pixmap);
481 Q_REQUIRED_RESULT
static inline bool VFuzzyComparePoints(
const QPointF &p1,
const QPointF &p2,
486 return QLineF(p1, p2).length() <= accuracy;
494 return qFuzzyIsNull(p2);
496 else if(qFuzzyIsNull(p2))
502 return qFuzzyCompare(p1, p2);
541 #define QXT_DECLARE_PRIVATE(PUB) friend class PUB##Private; QxtPrivateInterface<PUB, PUB##Private> qxt_d;
542 #define QXT_DECLARE_PUBLIC(PUB) friend class PUB;
543 #define QXT_INIT_PRIVATE(PUB) qxt_d.setPublic(this);
544 #define QXT_D(PUB) PUB##Private& d = qxt_d()
545 #define QXT_P(PUB) PUB& p = qxt_p()
547 template <
typename PUB>
583 template <typename PUB, typename PVT>
597 pvt->QXT_setPublic(pub);
601 return *
static_cast<PVT*
>(pvt);
605 return *
static_cast<PVT*
>(pvt);
609 return static_cast<PVT*
>(pvt);
613 return static_cast<PVT*
>(pvt);
624 template <typename T, template <typename> class C>
627 return QSet<T>(list.begin(), list.end());
634 template <
typename T,
typename C>
637 return QSet<T>(list.begin(), list.end());
644 template <
typename T,
template <
typename>
class C>
647 return QList<T>(set.begin(), set.end());
const PVT & operator()() const
const PVT * operator->() const
void QXT_setPublic(PUB *pub)
const PUB * qxt_ptr() const
const PUB & qxt_p() const
const QString pl_customer
Unit StrToUnits(const QString &unit)
static const int heightStep
QString makeHeaderName(const QString &name)
makeHeaderName make a 1 char tablewidgetitem header name based on a translated string.
const QString cursorArrowOpenHand
const QStringList builInFunctions
Q_REQUIRED_RESULT QString AbsoluteMPath(const QString &patternPath, const QString &relativeMPath)
void InitHighDpiScaling(int argc, char *argv[])
Q_REQUIRED_RESULT QSharedPointer< QPrinter > PreparePrinter(const QPrinterInfo &info, QPrinter::PrinterMode mode=QPrinter::ScreenResolution)
const QString pl_pFoldPosition
QMarginsF GetPrinterFields(const QSharedPointer< QPrinter > &printer)
constexpr qreal accuracyPointOnLine
static Q_REQUIRED_RESULT bool VFuzzyComparePossibleNulls(double p1, double p2)
QSet< T > convertToSet(const C< T > &list)
Q_REQUIRED_RESULT QPixmap darkenPixmap(const QPixmap &pixmap)
QString notchSubTypeToString(NotchSubType type)
QList< T > convertToList(const C< T > &set)
@ ToolPointOfIntersectionArcs
@ ToolPointFromCircleAndTangent
@ ToolPointOfIntersectionCurves
@ ToolPointFromArcAndTangent
@ ToolPointOfIntersectionCircles
@ ToolPointOfIntersection
static Q_REQUIRED_RESULT bool VFuzzyComparePoints(const QPointF &p1, const QPointF &p2, qreal accuracy=accuracyPointOnLine)
const QString pl_pQuantity
const QString LONG_OPTION_NO_HDPI_SCALING
const QString strIntersection
const QStringList labelTemplatePlaceholders
const QString strStraightforward
const QString pl_mFileName
const QString pl_patternName
const QString pl_pAnnotation
Q_REQUIRED_RESULT QString RelativeMPath(const QString &patternPath, const QString &absoluteMPath)
void ShowInGraphicalShell(const QString &filePath)
const QString cursorArrowCloseHand
Q_REQUIRED_RESULT QStringList SupportedLocales()
const QStringList builInPostfixOperators
Q_REQUIRED_RESULT QString strippedName(const QString &fullFileName)
strippedName the function call around curFile to exclude the path to the file.
const QString pl_patternNumber
bool IsOptionSet(int argc, char *argv[], const char *option)
const QString degreeSymbol
void InitLanguages(QComboBox *combobox)
const QString pl_pFileName
static const int sizeStep
@ PointOfIntersectionCurves
@ PointOfIntersectionCircles
@ PointFromCircleAndTangent
@ PointOfIntersectionArcs
Q_REQUIRED_RESULT double ToPixel(double val, const Unit &unit)
Q_DECLARE_TYPEINFO(CustomSARecord, Q_MOVABLE_TYPE)
void SetItemOverrideCursor(QGraphicsItem *item, const QString &pixmapPath, int hotX=-1, int hotY=-1)
const QString pl_mInterfacing
Q_REQUIRED_RESULT qreal UnitConvertor(qreal value, const Unit &from, const Unit &to)
const QString pl_pOrientation
const QString pl_pRotation
const QString pl_mInterlining
Q_REQUIRED_RESULT double FromPixel(double pix, const Unit &unit)
QMarginsF GetMinPrinterFields(const QSharedPointer< QPrinter > &printer)
NotchType stringToNotchType(const QString &value)
QString UnitsToStr(const Unit &unit, const bool translate=false)
UnitsToStr translate unit to string.
const QString strBisector
QString notchTypeToString(NotchType type)
NotchSubType stringToNotchSubType(const QString &value)
The CustomSA struct contains record about custom seam allowanse (SA).
PiecePathIncludeType includeType
#define translate(context, source)