- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document
C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+
Build status: BUILD_RTI=OFF successful (0 errors, warnings only)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
82 lines
1.4 KiB
C++
82 lines
1.4 KiB
C++
#include "lts_splash.h"
|
|
|
|
#include <LtsWidgets/lts_global_wait_dialog.h>
|
|
|
|
#include <QtCore/QCoreApplication>
|
|
#include <QtCore/QFile>
|
|
#include <QtCore/QEvent>
|
|
|
|
|
|
namespace LtsWidgets
|
|
{
|
|
|
|
Splash::Splash()
|
|
: QSplashScreen()
|
|
, m_done(false)
|
|
{
|
|
static const auto splashFiles =
|
|
{
|
|
QStringLiteral(":/project/splash.png"),
|
|
QStringLiteral(":/project/splash.jpg"),
|
|
};
|
|
for (const QString &f : splashFiles)
|
|
{
|
|
if (!QFile::exists(f))
|
|
continue;
|
|
setPixmap(QPixmap(f));
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
bool Splash::event(QEvent *e)
|
|
{
|
|
if (e->type() == QEvent::MouseButtonPress ||
|
|
e->type() == QEvent::MouseButtonRelease ||
|
|
e->type() == QEvent::MouseButtonDblClick)
|
|
{
|
|
e->ignore();
|
|
return false;
|
|
}
|
|
|
|
return QSplashScreen::event(e);
|
|
}
|
|
|
|
|
|
void Splash::setMessage(const QString &message)
|
|
{
|
|
showMessage(message, Qt::AlignRight | Qt::AlignBottom);
|
|
}
|
|
|
|
|
|
void Splash::done()
|
|
{
|
|
if (m_done)
|
|
return;
|
|
m_done = true;
|
|
|
|
hide();
|
|
LtsWidgets::LtsGlobalWaitDialog::getInstance()->setVisible(true); // after the splash has finished, wait dlgs are allowed
|
|
}
|
|
|
|
|
|
static Splash *s_splashInstance = nullptr;
|
|
void Splash::cleanupSplashInstance()
|
|
{
|
|
delete s_splashInstance;
|
|
s_splashInstance = nullptr;
|
|
}
|
|
|
|
|
|
Splash *Splash::getInstance()
|
|
{
|
|
if (!s_splashInstance)
|
|
{
|
|
s_splashInstance = new Splash;
|
|
qAddPostRoutine(&Splash::cleanupSplashInstance);
|
|
}
|
|
return s_splashInstance;
|
|
}
|
|
|
|
} // namespace LtsWidgets
|