Fix building.

This commit is contained in:
Roman Telezhynskyi 2023-11-09 17:46:34 +02:00
parent a4f2eefacd
commit 9d652aa3b5
15 changed files with 119 additions and 62 deletions

View File

@ -114,6 +114,7 @@
<key>public.mime-type</key>
<string>text/xml</string>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>

View File

@ -150,6 +150,7 @@
<key>public.mime-type</key>
<string>text/xml</string>
</dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>

View File

@ -32,7 +32,13 @@
class QxtCsvModel;
class QComboBox;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
class VTextCodec;
#else
class QTextCodec;
using VTextCodec = QTextCodec;
#endif
enum class KnownMeasurementsColumns : qint8
{

View File

@ -33,7 +33,13 @@
#include "../vformat/vdimensions.h"
class QxtCsvModel;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
class VTextCodec;
#else
class QTextCodec;
using VTextCodec = QTextCodec;
#endif
enum class IndividualMeasurementsColumns : qint8
{

View File

@ -332,7 +332,7 @@ MApplication::MApplication(int &argc, char **argv)
//---------------------------------------------------------------------------------------------------------------------
MApplication::~MApplication()
{
if (IsAppInGUIMode() && settings->IsCollectStatistic())
if (MApplication::IsAppInGUIMode() && settings->IsCollectStatistic())
{
auto *statistic = VGAnalytics::Instance();
@ -541,16 +541,27 @@ auto MApplication::event(QEvent *e) -> bool
// Mac specific).
case QEvent::FileOpen:
{
auto *fileOpenEvent =
static_cast<QFileOpenEvent *>(e); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast)
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
auto *fileOpenEvent = static_cast<QFileOpenEvent *>(e);
const QString macFileOpen = fileOpenEvent->file();
if (not macFileOpen.isEmpty())
{
if (macFileOpen.endsWith(".vkm"_L1))
{
TKMMainWindow *mw = MainKMWindow();
if (mw)
{
mw->LoadFile(macFileOpen); // open file in existing window
}
}
else
{
TMainWindow *mw = MainTapeWindow();
if (mw)
{
mw->LoadFile(macFileOpen); // open file in existing window
}
}
return true;
}
break;
@ -558,12 +569,24 @@ auto MApplication::event(QEvent *e) -> bool
#if defined(Q_OS_MAC)
case QEvent::ApplicationActivate:
{
Clean();
TMainWindow *mw = MainWindow();
if (m_knownMeasurementsMode)
{
CleanKMWindows();
TKMMainWindow *mw = MainKMWindow();
if (mw && not mw->isMinimized())
{
mw->show();
}
}
else
{
CleanTapeWindows();
TMainWindow *mw = MainTapeWindow();
if (mw && not mw->isMinimized())
{
mw->show();
}
}
return true;
}
#endif // defined(Q_OS_MAC)
@ -686,7 +709,7 @@ void MApplication::Preferences(QWidget *parent)
guard = preferences;
// Must be first
for (const auto &w : m_mainWindows)
for (const auto &w : qAsConst(m_mainWindows))
{
if (!w.isNull())
{
@ -697,7 +720,7 @@ void MApplication::Preferences(QWidget *parent)
}
}
for (const auto &w : m_kmMainWindows)
for (const auto &w : qAsConst(m_kmMainWindows))
{
if (!w.isNull())
{
@ -844,7 +867,7 @@ void MApplication::KnownMeasurementsPathChanged(const QString &oldPath, const QS
//---------------------------------------------------------------------------------------------------------------------
void MApplication::SyncKnownMeasurements()
{
for (const auto &w : m_mainWindows)
for (const auto &w : qAsConst(m_mainWindows))
{
if (!w.isNull())
{

View File

@ -1465,7 +1465,7 @@ void TKMMainWindow::SaveImageTitle()
//---------------------------------------------------------------------------------------------------------------------
#if defined(Q_OS_MAC)
//---------------------------------------------------------------------------------------------------------------------
void TKMainWindow::OpenAt(QAction *where)
void TKMMainWindow::OpenAt(QAction *where)
{
const QString path = m_curFile.left(m_curFile.indexOf(where->text())) + where->text();
if (path == m_curFile)

View File

@ -53,6 +53,9 @@ class DRW_Point;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
class VTextCodec;
#else
class QTextCodec;
using VTextCodec = QTextCodec;
#endif
class VDxfEngine final : public QPaintEngine

View File

@ -29,6 +29,10 @@
#include "../vmisc/def.h"
#include "vknownmeasurements_p.h"
#include <QMap>
#include <QSet>
#include <QString>
//---------------------------------------------------------------------------------------------------------------------
VKnownMeasurements::VKnownMeasurements()
: d(new VKnownMeasurementsData)
@ -36,7 +40,7 @@ VKnownMeasurements::VKnownMeasurements()
}
//---------------------------------------------------------------------------------------------------------------------
VKnownMeasurements::~VKnownMeasurements()
VKnownMeasurements::~VKnownMeasurements() // NOLINT(modernize-use-equals-default)
{
}

View File

@ -31,7 +31,11 @@
#include "../ifc/xml/vpatternimage.h"
#include "../vmisc/defglobal.h"
#include "vknownmeasurement.h"
#include <QHash>
#include <QMap>
#include <QSharedData>
#include <QString>
#include <QUuid>
QT_WARNING_PUSH

View File

@ -26,13 +26,12 @@
**
*************************************************************************/
#include "vknownmeasurementsdocument.h"
#include "../ifc/ifcdef.h"
#include "../ifc/xml/vknownmeasurementsconverter.h"
#include "../ifc/xml/vpatternimage.h"
#include "../vmisc/literals.h"
#include "../vmisc/projectversion.h"
#include "ifcdef.h"
#include "literals.h"
#include "quuid.h"
#include "vformat/knownmeasurements/vknownmeasurement.h"
#include "vknownmeasurement.h"
#include "vknownmeasurements.h"
#include <QUuid>

View File

@ -33,7 +33,6 @@
#include <QSet>
#include "../vmisc/def.h"
#include "qglobal.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"

View File

@ -109,6 +109,9 @@ inline namespace Literals
inline namespace StringLiterals
{
QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wreserved-identifier")
//---------------------------------------------------------------------------------------------------------------------
Q_DECL_CONSTEXPR inline auto operator"" _L1(char ch) Q_DECL_NOEXCEPT->QLatin1Char
{
@ -121,6 +124,8 @@ Q_DECL_CONSTEXPR inline auto operator"" _L1(const char *str, size_t size) Q_DECL
return QLatin1String(str, static_cast<vsizetype>(size));
}
QT_WARNING_POP
//---------------------------------------------------------------------------------------------------------------------
inline auto operator"" _ba(const char *str, size_t size) Q_DECL_NOEXCEPT->QByteArray
{

View File

@ -50,6 +50,9 @@ class QxtCsvModelPrivate;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
class VTextCodec;
#else
class QTextCodec;
using VTextCodec = QTextCodec;
#endif
class QxtCsvModel final : public QAbstractTableModel

View File

@ -55,6 +55,9 @@ class VKnownMeasurementsDatabase;
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
class VTextCodec;
#else
class QTextCodec;
using VTextCodec = QTextCodec;
#endif
QT_WARNING_PUSH