mirror of
https://gitlab.com/smart-pattern/valentina.git
synced 2024-09-18 23:04:03 +02:00
Compare commits
No commits in common. "6d04cd32a7e867e512c593764ee8f77efb9c44ce" and "7d19562cd2721ffaeea310c6ab35353f0800c114" have entirely different histories.
6d04cd32a7
...
7d19562cd2
32
appveyor.yml
32
appveyor.yml
|
@ -107,53 +107,53 @@ environment:
|
||||||
# DEPLOY: true
|
# DEPLOY: true
|
||||||
# RUN_TESTS: true
|
# RUN_TESTS: true
|
||||||
|
|
||||||
- job_name: MacOS_12_Qt_5_15 (qbs, multibundle)
|
- job_name: MacOS_10_15_Qt_5_15 (qbs, multibundle)
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
|
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
|
||||||
COMPILER: clang
|
COMPILER: clang
|
||||||
QT: Qt/5.15/clang_64
|
QT: Qt/5.15/clang_64
|
||||||
QT_VERSION: Qt5_15
|
QT_VERSION: Qt5_15
|
||||||
BUILD_SYSTEM: "qbs"
|
BUILD_SYSTEM: "qbs"
|
||||||
ARCH: x64
|
ARCH: x64
|
||||||
XCODE_VERSION: 14.2
|
XCODE_VERSION: 14.1
|
||||||
TARGET_PLATFORM: "macOS_10.13+"
|
TARGET_PLATFORM: "macOS_10.13+"
|
||||||
MACOS_DEPLOYMENT_TARGET: 10.13
|
MACOS_DEPLOYMENT_TARGET: 10.13
|
||||||
MULTI_BUNDLE: true
|
MULTI_BUNDLE: true
|
||||||
DEPLOY: true
|
DEPLOY: true
|
||||||
|
|
||||||
- job_name: MacOS_12_Qt_5_15 (qbs, singlebundle)
|
- job_name: MacOS_10_15_Qt_5_15 (qbs, singlebundle)
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
|
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
|
||||||
COMPILER: clang
|
COMPILER: clang
|
||||||
QT: Qt/5.15/clang_64
|
QT: Qt/5.15/clang_64
|
||||||
QT_VERSION: Qt5_15
|
QT_VERSION: Qt5_15
|
||||||
BUILD_SYSTEM: "qbs"
|
BUILD_SYSTEM: "qbs"
|
||||||
ARCH: x64
|
ARCH: x64
|
||||||
XCODE_VERSION: 14.2
|
XCODE_VERSION: 14.1
|
||||||
TARGET_PLATFORM: "macOS_10.13+"
|
TARGET_PLATFORM: "macOS_10.13+"
|
||||||
MACOS_DEPLOYMENT_TARGET: 10.13
|
MACOS_DEPLOYMENT_TARGET: 10.13
|
||||||
MULTI_BUNDLE: false
|
MULTI_BUNDLE: false
|
||||||
DEPLOY: true
|
DEPLOY: true
|
||||||
|
|
||||||
- job_name: MacOS_14_Qt_6_6 (multibundle)
|
- job_name: MacOS_12_Qt_6_4 (multibundle)
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: macos-sonoma
|
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
|
||||||
COMPILER: clang
|
COMPILER: clang
|
||||||
QT: Qt/6.6/macos
|
QT: Qt/6.4/macos
|
||||||
QT_VERSION: Qt6
|
QT_VERSION: Qt6
|
||||||
BUILD_SYSTEM: "qbs"
|
BUILD_SYSTEM: "qbs"
|
||||||
ARCH: x64
|
ARCH: x64
|
||||||
XCODE_VERSION: 15.2
|
XCODE_VERSION: 14.1
|
||||||
TARGET_PLATFORM: "macOS_11+"
|
TARGET_PLATFORM: "macOS_11+"
|
||||||
MACOS_DEPLOYMENT_TARGET: 11.0
|
MACOS_DEPLOYMENT_TARGET: 11.0
|
||||||
MULTI_BUNDLE: true
|
MULTI_BUNDLE: true
|
||||||
DEPLOY: true
|
DEPLOY: true
|
||||||
|
|
||||||
- job_name: MacOS_14_Qt_6_6 (singlebundle)
|
- job_name: MacOS_12_Qt_6_4 (singlebundle)
|
||||||
APPVEYOR_BUILD_WORKER_IMAGE: macos-sonoma
|
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
|
||||||
COMPILER: clang
|
COMPILER: clang
|
||||||
QT: Qt/6.6/macos
|
QT: Qt/6.4/macos
|
||||||
QT_VERSION: Qt6
|
QT_VERSION: Qt6
|
||||||
BUILD_SYSTEM: "qbs"
|
BUILD_SYSTEM: "qbs"
|
||||||
ARCH: x64
|
ARCH: x64
|
||||||
XCODE_VERSION: 15.2
|
XCODE_VERSION: 14.1
|
||||||
TARGET_PLATFORM: "macOS_11+"
|
TARGET_PLATFORM: "macOS_11+"
|
||||||
MACOS_DEPLOYMENT_TARGET: 11.0
|
MACOS_DEPLOYMENT_TARGET: 11.0
|
||||||
MULTI_BUNDLE: false
|
MULTI_BUNDLE: false
|
||||||
|
@ -538,7 +538,7 @@ for:
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
#- /Users/appveyor/.conan/data -> conanfile.py
|
#- /Users/appveyor/.conan/data -> conanfile.py
|
||||||
- $HOME/brew_cache_dir
|
- /Users/appveyor/brew_cache_dir
|
||||||
|
|
||||||
init:
|
init:
|
||||||
- find /Applications -maxdepth 1 -type d -name 'Xcode*.app'
|
- find /Applications -maxdepth 1 -type d -name 'Xcode*.app'
|
||||||
|
@ -598,7 +598,7 @@ for:
|
||||||
|
|
||||||
cache_tag=usr_local # this can be modified to rebuild deps
|
cache_tag=usr_local # this can be modified to rebuild deps
|
||||||
|
|
||||||
cdir=$HOME/brew_cache_dir
|
cdir=$HOME/cache_dir
|
||||||
cache_tar=$cdir/$cache_tag.tar
|
cache_tar=$cdir/$cache_tag.tar
|
||||||
cache=$cache_tar.xz
|
cache=$cache_tar.xz
|
||||||
|
|
||||||
|
@ -721,7 +721,7 @@ for:
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
#- /Users/appveyor/.conan/data -> conanfile.py
|
#- /Users/appveyor/.conan/data -> conanfile.py
|
||||||
- $HOME/brew_cache_dir
|
- /Users/appveyor/brew_cache_dir
|
||||||
|
|
||||||
init:
|
init:
|
||||||
- find /Applications -maxdepth 1 -type d -name 'Xcode*.app'
|
- find /Applications -maxdepth 1 -type d -name 'Xcode*.app'
|
||||||
|
@ -782,7 +782,7 @@ for:
|
||||||
|
|
||||||
cache_tag=usr_local # this can be modified to rebuild deps
|
cache_tag=usr_local # this can be modified to rebuild deps
|
||||||
|
|
||||||
cdir=$HOME/brew_cache_dir
|
cdir=$HOME/cache_dir
|
||||||
cache_tar=$cdir/$cache_tag.tar
|
cache_tar=$cdir/$cache_tag.tar
|
||||||
cache=$cache_tar.xz
|
cache=$cache_tar.xz
|
||||||
|
|
||||||
|
|
|
@ -83,11 +83,10 @@ auto StrToGrainlineType(const QString &string) -> GrainlineType
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __cplusplus < 202002L
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VPTransformationOrigon::operator==(const VPTransformationOrigon &origin) const -> bool
|
auto VPTransformationOrigon::operator==(const VPTransformationOrigon &origin) const -> bool
|
||||||
{
|
{
|
||||||
return origin == origin.origin && custom == origin.custom;
|
return this->origin == origin.origin && custom == origin.custom;
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -95,4 +94,3 @@ auto VPTransformationOrigon::operator!=(const VPTransformationOrigon &origin) co
|
||||||
{
|
{
|
||||||
return !VPTransformationOrigon::operator==(origin);
|
return !VPTransformationOrigon::operator==(origin);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
|
@ -55,15 +55,11 @@ auto StrToGrainlineType(const QString &string) -> GrainlineType;
|
||||||
|
|
||||||
struct VPTransformationOrigon
|
struct VPTransformationOrigon
|
||||||
{
|
{
|
||||||
QPointF origin{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
QPointF origin{}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||||
bool custom{false}; // NOLINT(misc-non-private-member-variables-in-classes)
|
bool custom{false}; // NOLINT(misc-non-private-member-variables-in-classes)
|
||||||
|
|
||||||
#if __cplusplus >= 202002L
|
|
||||||
auto operator==(const VPTransformationOrigon &origin) const -> bool = default;
|
|
||||||
#else
|
|
||||||
auto operator==(const VPTransformationOrigon &origin) const -> bool;
|
auto operator==(const VPTransformationOrigon &origin) const -> bool;
|
||||||
auto operator!=(const VPTransformationOrigon &origin) const -> bool;
|
auto operator!=(const VPTransformationOrigon &origin) const -> bool;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // LAYOUTDEF_H
|
#endif // LAYOUTDEF_H
|
||||||
|
|
|
@ -56,11 +56,6 @@
|
||||||
#include "../vmisc/compatibility.h"
|
#include "../vmisc/compatibility.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(BUILD_REVISION) && defined(QBS_BUILD)
|
|
||||||
#include <vcsRepoState.h>
|
|
||||||
#define BUILD_REVISION VCS_REPO_STATE_REVISION
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace Qt::Literals::StringLiterals;
|
using namespace Qt::Literals::StringLiterals;
|
||||||
|
|
||||||
QT_WARNING_PUSH
|
QT_WARNING_PUSH
|
||||||
|
@ -71,6 +66,11 @@ Q_LOGGING_CATEGORY(pApp, "p.application") // NOLINT
|
||||||
|
|
||||||
QT_WARNING_POP
|
QT_WARNING_POP
|
||||||
|
|
||||||
|
#if !defined(BUILD_REVISION) && defined(QBS_BUILD)
|
||||||
|
#include <vcsRepoState.h>
|
||||||
|
#define BUILD_REVISION VCS_REPO_STATE_REVISION
|
||||||
|
#endif
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &context,
|
inline void noisyFailureMsgHandler(QtMsgType type, const QMessageLogContext &context,
|
||||||
const QString &msg) // NOLINT(readability-function-cognitive-complexity)
|
const QString &msg) // NOLINT(readability-function-cognitive-complexity)
|
||||||
|
|
|
@ -39,7 +39,7 @@ class QGraphicsScene;
|
||||||
class VCommonSettings;
|
class VCommonSettings;
|
||||||
class QPainter;
|
class QPainter;
|
||||||
|
|
||||||
class VPTileFactory : public QObject
|
class VPTileFactory : QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT // NOLINT
|
Q_OBJECT // NOLINT
|
||||||
|
|
||||||
|
|
|
@ -28,11 +28,12 @@
|
||||||
#ifndef UTILS_H
|
#ifndef UTILS_H
|
||||||
#define UTILS_H
|
#define UTILS_H
|
||||||
|
|
||||||
#include <QtCore/qcontainerfwd.h>
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
#include <QtCore/qcontainerfwd.h>
|
||||||
|
|
||||||
class QMimeType;
|
class QMimeType;
|
||||||
class QString;
|
class QString;
|
||||||
|
class QMimeType;
|
||||||
class QByteArray;
|
class QByteArray;
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
|
|
@ -340,11 +340,11 @@ void VLayoutConverter::ConvertPiecesToV0_1_5()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto StringToPath = [](const QString &path)
|
auto StringToPath = [](const QString &path) -> QVector<QPointF>
|
||||||
{
|
{
|
||||||
auto StringToPoint = [](const QString &point) -> QPointF
|
auto StringToPoint = [](const QString &point) -> QPointF
|
||||||
{
|
{
|
||||||
QStringList const coordinates = point.split(coordintatesSep);
|
QStringList coordinates = point.split(coordintatesSep);
|
||||||
if (coordinates.count() == 2)
|
if (coordinates.count() == 2)
|
||||||
{
|
{
|
||||||
return {coordinates.at(0).toDouble(), coordinates.at(1).toDouble()};
|
return {coordinates.at(0).toDouble(), coordinates.at(1).toDouble()};
|
||||||
|
@ -359,7 +359,7 @@ void VLayoutConverter::ConvertPiecesToV0_1_5()
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList const points = path.split(pointsSep);
|
QStringList points = path.split(pointsSep);
|
||||||
p.reserve(points.size());
|
p.reserve(points.size());
|
||||||
for (const auto &point : points)
|
for (const auto &point : points)
|
||||||
{
|
{
|
||||||
|
@ -372,9 +372,9 @@ void VLayoutConverter::ConvertPiecesToV0_1_5()
|
||||||
const QVector<QPointF> path = StringToPath(node.text());
|
const QVector<QPointF> path = StringToPath(node.text());
|
||||||
if (not path.isEmpty())
|
if (not path.isEmpty())
|
||||||
{
|
{
|
||||||
auto LineToString = [](const QLineF &line)
|
auto LineToString = [](const QLineF &line) -> QString
|
||||||
{
|
{
|
||||||
auto PointToString = [](const QPointF &p)
|
auto PointToString = [](const QPointF &p) -> QString
|
||||||
{ return NumberToString(p.x()) + coordintatesSep + NumberToString(p.y()); };
|
{ return NumberToString(p.x()) + coordintatesSep + NumberToString(p.y()); };
|
||||||
|
|
||||||
return PointToString(line.p1()) + groupSep + PointToString(line.p2());
|
return PointToString(line.p1()) + groupSep + PointToString(line.p2());
|
||||||
|
|
|
@ -101,7 +101,7 @@ inline auto operator""_s(const char16_t *str, size_t size)Q_DECL_NOEXCEPT->QStri
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
template <typename T, template <typename> class C> inline auto ConvertToList(const C<T> &container) -> QList<T>
|
template <typename T, template <typename> class C> inline auto ConvertToList(const C<T> &container) -> QList<T>
|
||||||
{
|
{
|
||||||
return QList<T>(std::begin(container), std::end(container));
|
return QList<T>(container.begin(), container.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -113,25 +113,25 @@ template <typename T, template <typename> class C> inline auto ConvertToStringLi
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
template <typename T, template <typename> class C> inline auto ConvertToSet(const C<T> &container) -> QSet<T>
|
template <typename T, template <typename> class C> inline auto ConvertToSet(const C<T> &container) -> QSet<T>
|
||||||
{
|
{
|
||||||
return QSet<T>(std::begin(container), std::end(container));
|
return QSet<T>(container.begin(), container.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
template <typename T, typename C> inline auto ConvertToSet(const C &container) -> QSet<T>
|
template <typename T, typename C> inline auto ConvertToSet(const C &container) -> QSet<T>
|
||||||
{
|
{
|
||||||
return QSet<T>(std::begin(container), std::end(container));
|
return QSet<T>(container.begin(), container.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
template <typename T, template <typename> class C> inline auto ConvertToVector(const C<T> &container) -> QVector<T>
|
template <typename T, template <typename> class C> inline auto ConvertToVector(const C<T> &container) -> QVector<T>
|
||||||
{
|
{
|
||||||
return QVector<T>(std::begin(container), std::end(container));
|
return QVector<T>(container.begin(), container.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
template <typename T> inline auto ConvertToVector(const QSet<T> &container) -> QVector<T>
|
template <typename T> inline auto ConvertToVector(const QSet<T> &container) -> QVector<T>
|
||||||
{
|
{
|
||||||
return QVector<T>(std::begin(container), std::end(container));
|
return QVector<T>(container.begin(), container.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -159,7 +159,7 @@ inline auto Reverse(const C<T> &container) -> C<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
template <typename T, std::enable_if_t<std::is_same_v<T, QStringList>, T> * = nullptr>
|
template <typename T, typename std::enable_if<std::is_same<T, QStringList>::value, T>::type * = nullptr>
|
||||||
inline auto Reverse(const T &container) -> T
|
inline auto Reverse(const T &container) -> T
|
||||||
{
|
{
|
||||||
return Reverse<QString, QList>(container);
|
return Reverse<QString, QList>(container);
|
||||||
|
|
|
@ -6,19 +6,20 @@
|
||||||
#ifndef THREAD_DISPATCHER_H
|
#ifndef THREAD_DISPATCHER_H
|
||||||
#define THREAD_DISPATCHER_H
|
#define THREAD_DISPATCHER_H
|
||||||
|
|
||||||
#include <QCoreApplication>
|
|
||||||
#include <QMetaObject>
|
|
||||||
#include <QObject>
|
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <cassert>
|
#include <QMetaObject>
|
||||||
#include <functional>
|
#include <QThread>
|
||||||
#include <utility>
|
#include <QCoreApplication>
|
||||||
|
#include <QObject>
|
||||||
|
|
||||||
using voidBlock = std::function<void()>;
|
#include <functional>
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
|
typedef std::function<void()> voidBlock;
|
||||||
|
|
||||||
class WorkerClass : public QObject
|
class WorkerClass : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT // NOLINT
|
Q_OBJECT // NOLINT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WorkerClass(QThread *thread)
|
explicit WorkerClass(QThread *thread)
|
||||||
|
@ -27,43 +28,43 @@ public:
|
||||||
connect(QThread::currentThread(), &QThread::finished, this, &WorkerClass::deleteLater);
|
connect(QThread::currentThread(), &QThread::finished, this, &WorkerClass::deleteLater);
|
||||||
}
|
}
|
||||||
public slots:
|
public slots:
|
||||||
void DoWork(const voidBlock &block)
|
void DoWork(voidBlock block)
|
||||||
{
|
{
|
||||||
block();
|
block();
|
||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECL_UNUSED static inline void q_dispatch_async(QThread *thread, const voidBlock &block);
|
Q_DECL_UNUSED static inline void q_dispatch_async(QThread* thread, voidBlock block);
|
||||||
static inline void q_dispatch_async(QThread *thread, const voidBlock &block)
|
static inline void q_dispatch_async(QThread* thread, voidBlock block)
|
||||||
{
|
{
|
||||||
qRegisterMetaType<voidBlock>("voidBlock");
|
qRegisterMetaType<voidBlock>("voidBlock");
|
||||||
|
|
||||||
auto *worker = new WorkerClass(thread);
|
WorkerClass *worker = new WorkerClass(thread);
|
||||||
QMetaObject::invokeMethod(worker, "DoWork", Qt::QueuedConnection, Q_ARG(voidBlock, block));
|
QMetaObject::invokeMethod(worker, "DoWork", Qt::QueuedConnection, Q_ARG(voidBlock, block));
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_DECL_UNUSED static inline void q_dispatch_async_main(const voidBlock &block);
|
Q_DECL_UNUSED static inline void q_dispatch_async_main(voidBlock block);
|
||||||
static inline void q_dispatch_async_main(const voidBlock &block)
|
static inline void q_dispatch_async_main(voidBlock block)
|
||||||
{
|
{
|
||||||
QThread *mainThread = QCoreApplication::instance()->thread();
|
QThread *mainThread = QCoreApplication::instance()->thread();
|
||||||
q_dispatch_async(mainThread, block);
|
q_dispatch_async(mainThread, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
using msgHandlerBlock = std::function<void(QtMsgType, const QMessageLogContext &, const QString &)>;
|
typedef std::function<void(QtMsgType, const QMessageLogContext &, const QString &)> msgHandlerBlock;
|
||||||
|
|
||||||
class MsgHandlerWorkerClass : public QObject
|
class MsgHandlerWorkerClass : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT // NOLINT
|
Q_OBJECT // NOLINT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MsgHandlerWorkerClass(QThread *thread, QtMsgType type, const QMessageLogContext &context, QString msg)
|
MsgHandlerWorkerClass(QThread *thread, QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||||
: m_type(type),
|
: m_type(type),
|
||||||
m_msg(std::move(msg)),
|
m_msg(msg),
|
||||||
m_line(context.line),
|
m_line(context.line),
|
||||||
m_file(context.file),
|
m_file(context.file),
|
||||||
m_function(context.function),
|
m_function(context.function),
|
||||||
m_category(context.category)
|
m_category(context.category)
|
||||||
{
|
{
|
||||||
#ifndef V_NO_ASSERT
|
#ifndef V_NO_ASSERT
|
||||||
assert(context.version == 2);
|
assert(context.version == 2);
|
||||||
|
@ -72,15 +73,12 @@ public:
|
||||||
connect(QThread::currentThread(), &QThread::finished, this, &WorkerClass::deleteLater);
|
connect(QThread::currentThread(), &QThread::finished, this, &WorkerClass::deleteLater);
|
||||||
}
|
}
|
||||||
public slots:
|
public slots:
|
||||||
void DoWork(const msgHandlerBlock &block)
|
void DoWork(msgHandlerBlock block)
|
||||||
{
|
{
|
||||||
block(
|
block(m_type, QMessageLogContext(qUtf8Printable(m_file), m_line, qUtf8Printable(m_function),
|
||||||
m_type,
|
qUtf8Printable(m_category)), m_msg);
|
||||||
QMessageLogContext(qUtf8Printable(m_file), m_line, qUtf8Printable(m_function), qUtf8Printable(m_category)),
|
|
||||||
m_msg);
|
|
||||||
deleteLater();
|
deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QtMsgType m_type;
|
QtMsgType m_type;
|
||||||
QString m_msg;
|
QString m_msg;
|
||||||
|
@ -92,21 +90,21 @@ private:
|
||||||
QString m_category;
|
QString m_category;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECL_UNUSED static inline void q_dispatch_async(QThread *thread, const msgHandlerBlock &block, QtMsgType type,
|
Q_DECL_UNUSED static inline void q_dispatch_async(QThread* thread, msgHandlerBlock block, QtMsgType type,
|
||||||
const QMessageLogContext &context, const QString &msg);
|
const QMessageLogContext &context, const QString &msg);
|
||||||
static inline void q_dispatch_async(QThread *thread, const msgHandlerBlock &block, QtMsgType type,
|
static inline void q_dispatch_async(QThread* thread, msgHandlerBlock block, QtMsgType type,
|
||||||
const QMessageLogContext &context, const QString &msg)
|
const QMessageLogContext &context, const QString &msg)
|
||||||
{
|
{
|
||||||
qRegisterMetaType<msgHandlerBlock>("msgHandlerBlock");
|
qRegisterMetaType<msgHandlerBlock>("msgHandlerBlock");
|
||||||
|
|
||||||
auto *worker = new MsgHandlerWorkerClass(thread, type, context, msg);
|
MsgHandlerWorkerClass *worker = new MsgHandlerWorkerClass(thread, type, context, msg);
|
||||||
QMetaObject::invokeMethod(worker, "DoWork", Qt::QueuedConnection, Q_ARG(msgHandlerBlock, block));
|
QMetaObject::invokeMethod(worker, "DoWork", Qt::QueuedConnection, Q_ARG(msgHandlerBlock, block));
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_DECL_UNUSED static inline void q_dispatch_async_main(const msgHandlerBlock &block, QtMsgType type,
|
Q_DECL_UNUSED static inline void q_dispatch_async_main(msgHandlerBlock block, QtMsgType type,
|
||||||
const QMessageLogContext &context, const QString &msg);
|
const QMessageLogContext &context, const QString &msg);
|
||||||
static inline void q_dispatch_async_main(const msgHandlerBlock &block, QtMsgType type,
|
static inline void q_dispatch_async_main(msgHandlerBlock block, QtMsgType type, const QMessageLogContext &context,
|
||||||
const QMessageLogContext &context, const QString &msg)
|
const QString &msg)
|
||||||
{
|
{
|
||||||
QThread *mainThread = QCoreApplication::instance()->thread();
|
QThread *mainThread = QCoreApplication::instance()->thread();
|
||||||
q_dispatch_async(mainThread, block, type, context, msg);
|
q_dispatch_async(mainThread, block, type, context, msg);
|
||||||
|
|
|
@ -35,7 +35,7 @@ class VTranslator : public QTranslator
|
||||||
Q_OBJECT // NOLINT
|
Q_OBJECT // NOLINT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit VTranslator(QObject *parent = nullptr);
|
VTranslator(QObject *parent = nullptr);
|
||||||
|
|
||||||
auto translate(const char *context, const char *sourceText, const char *disambiguation = nullptr, int n = -1) const
|
auto translate(const char *context, const char *sourceText, const char *disambiguation = nullptr, int n = -1) const
|
||||||
-> QString override;
|
-> QString override;
|
||||||
|
|
|
@ -87,13 +87,11 @@ auto VFormula::operator==(const VFormula &formula) const -> bool
|
||||||
d->error == formula.error() && VFuzzyComparePossibleNulls(d->dValue, formula.getDoubleValue());
|
d->error == formula.error() && VFuzzyComparePossibleNulls(d->dValue, formula.getDoubleValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __cplusplus < 202002L
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VFormula::operator!=(const VFormula &formula) const -> bool
|
auto VFormula::operator!=(const VFormula &formula) const -> bool
|
||||||
{
|
{
|
||||||
return !VFormula::operator==(formula);
|
return !VFormula::operator==(formula);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
auto VFormula::GetFormula(FormulaType type) const -> QString
|
auto VFormula::GetFormula(FormulaType type) const -> QString
|
||||||
|
|
|
@ -59,10 +59,7 @@ public:
|
||||||
~VFormula();
|
~VFormula();
|
||||||
|
|
||||||
auto operator==(const VFormula &formula) const -> bool;
|
auto operator==(const VFormula &formula) const -> bool;
|
||||||
|
|
||||||
#if __cplusplus < 202002L
|
|
||||||
auto operator!=(const VFormula &formula) const -> bool;
|
auto operator!=(const VFormula &formula) const -> bool;
|
||||||
#endif
|
|
||||||
|
|
||||||
auto GetFormula(FormulaType type = FormulaType::ToUser) const -> QString;
|
auto GetFormula(FormulaType type = FormulaType::ToUser) const -> QString;
|
||||||
void SetFormula(const QString &value, FormulaType type = FormulaType::FromSystem);
|
void SetFormula(const QString &value, FormulaType type = FormulaType::FromSystem);
|
||||||
|
|
|
@ -78,16 +78,16 @@ void VPE::VPropertyFormWidget::build()
|
||||||
{
|
{
|
||||||
// Clear the old content, delete old widgets
|
// Clear the old content, delete old widgets
|
||||||
d_ptr->EditorWidgets.clear();
|
d_ptr->EditorWidgets.clear();
|
||||||
if (layout() != nullptr)
|
if (layout())
|
||||||
{
|
{
|
||||||
while (layout()->count() > 0)
|
QLayoutItem *child;
|
||||||
|
while (layout()->count() > 0 && (child = layout()->takeAt(0)) != nullptr)
|
||||||
{
|
{
|
||||||
QLayoutItem *child = layout()->takeAt(0);
|
if (child->widget())
|
||||||
if (child != nullptr)
|
|
||||||
{
|
{
|
||||||
delete child->widget();
|
delete child->widget();
|
||||||
delete child;
|
|
||||||
}
|
}
|
||||||
|
delete child;
|
||||||
}
|
}
|
||||||
delete layout();
|
delete layout();
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ void VPE::VPropertyFormWidget::build()
|
||||||
return; //... only if there are properties
|
return; //... only if there are properties
|
||||||
}
|
}
|
||||||
|
|
||||||
auto *tmpFormLayout = new QFormLayout(this);
|
QFormLayout *tmpFormLayout = new QFormLayout(this);
|
||||||
tmpFormLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
tmpFormLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||||
setLayout(tmpFormLayout);
|
setLayout(tmpFormLayout);
|
||||||
|
|
||||||
|
@ -116,10 +116,10 @@ void VPE::VPropertyFormWidget::build()
|
||||||
if (tmpProperty->propertyType() == Property::Complex)
|
if (tmpProperty->propertyType() == Property::Complex)
|
||||||
{
|
{
|
||||||
buildEditor(tmpProperty, tmpFormLayout, Property::Complex);
|
buildEditor(tmpProperty, tmpFormLayout, Property::Complex);
|
||||||
auto *group = new QWidget(this);
|
QWidget *group = new QWidget(this);
|
||||||
tmpFormLayout->addRow(group);
|
tmpFormLayout->addRow(group);
|
||||||
|
|
||||||
auto *subFormLayout = new QFormLayout(group);
|
QFormLayout *subFormLayout = new QFormLayout(group);
|
||||||
subFormLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
subFormLayout->setFieldGrowthPolicy(QFormLayout::ExpandingFieldsGrow);
|
||||||
QMargins margins = subFormLayout->contentsMargins();
|
QMargins margins = subFormLayout->contentsMargins();
|
||||||
margins.setTop(0);
|
margins.setTop(0);
|
||||||
|
|
Loading…
Reference in a new issue