Migrated all remaining QRegExp usage to QRegularExpression for Qt6 compatibility: - Lts/Viewer/SituationMap/SymbologyImpl/symbol_dictionary_impl.cpp - Changed helper functions to use QRegularExpression::match().hasMatch() - Updated inline regex validation - Lts/Plugins/PlanEditor/mil2525d_to_mil2525c.cpp - Fixed m_sidcQuery.exactMatch() → match().hasMatch() - Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_dialog.cpp - Video file pattern matching migrated - Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_rx.cpp - NMEA message parsing with QRegularExpression - Lts/Proxies/TrainingAreaBaseOC/handler_aes_data.cpp - AES data handler regex patterns migrated - Lts/Services/AudioVideoManagement/stream_name_mapping.* - Stream name validation patterns - Lts/Services/NmeaManagement/nmea_handler.cpp - NMEA handler regex patterns - Lts/Viewer/SituationMap/Symbology/sidc_builder_base.cpp, sidc_codec.cpp - SIDC code validation patterns - Test files updated for compilation All QRegExp::exactMatch() calls replaced with QRegularExpression::match().hasMatch() All QRegExp::cap(n) calls replaced with QRegularExpressionMatch::captured(n) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
177 lines
3.8 KiB
C++
Executable File
177 lines
3.8 KiB
C++
Executable File
|
|
|
|
|
|
#include <nglapplication/nglapplication.h>
|
|
#include <NGLLogger/INGLLogger.h>
|
|
|
|
#include "../plan_overlay_dialog.h"
|
|
|
|
#include "../plan_overlay_model.h"
|
|
#include "../plan_overlay_view.h"
|
|
|
|
#include <LtsWidgets/lts_base_layout_widget.h>
|
|
#include <LtsPluginManager/lts_plugin_loader.h>
|
|
#include <PluginInterfaces/style_plugin_interface.h>
|
|
#include <PluginInterfaces/project_plugin_interface.h>
|
|
|
|
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
|
|
|
|
|
#include <QtCore/QDir>
|
|
#include <QtCore/QPointer>
|
|
#include <QtCore/QStandardPaths>
|
|
|
|
#include <QtGui/QSurface>
|
|
|
|
#include <QtWidgets/QMainWindow>
|
|
#include <QtWidgets/QDialog>
|
|
#include <QtWidgets/QHBoxLayout>
|
|
#include <QtWidgets/QMessageBox>
|
|
#include <QtWidgets/QLabel>
|
|
|
|
#include <iostream>
|
|
#include <memory>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int main (int argc, char* argv[])
|
|
{
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
|
|
#endif
|
|
|
|
|
|
NGLApplication app ( argc, argv );
|
|
|
|
|
|
app.createLogger("planOverlayTest", "log4cxx_planOverlayTest.props");
|
|
TRACE_LOG(app.baseLogger()) << LOGFUNCTION << " START";
|
|
|
|
STARTUP_LOG(app.baseLogger());
|
|
|
|
app.setOrganizationName(QLatin1String("RME"));
|
|
app.setApplicationName(QLatin1String("Plan Overlay Test Application"));
|
|
|
|
|
|
LtsPluginManager::LtsPluginLoader *pluginLoader = LtsPluginManager::LtsPluginLoader::getInstance();
|
|
|
|
pluginLoader->loadPlugins( LtsPluginManager::PluginType::STYLE , nullptr, QStringList() << QStringLiteral("rme.light") );
|
|
pluginLoader->loadPlugins( LtsPluginManager::PluginType::PROJECT, nullptr, QStringList() << QStringLiteral("legatus") );
|
|
|
|
|
|
|
|
QDir::setSearchPaths( QLatin1String( "icon" ), QStringList( QLatin1String( ":/style/icons/" ) ) );
|
|
QDir::setSearchPaths( QLatin1String( "icon" ), QStringList( QLatin1String( ":/style/" ) ) );
|
|
|
|
|
|
|
|
#ifdef BUILD_STATIC_LIBRARIES
|
|
|
|
Q_INIT_RESOURCE(lts_resources);
|
|
#endif
|
|
|
|
#define USE_QDIALOG
|
|
|
|
|
|
|
|
PlanOverlaysPlugin::PlanOverlayModel * planOverlayModel = new PlanOverlaysPlugin::PlanOverlayModel();
|
|
|
|
#ifdef USE_QDIALOG
|
|
PlanOverlaysPlugin::PlanOverlayDialog<QDialog> * dialog = new PlanOverlaysPlugin::PlanOverlayDialog<QDialog>( nullptr, planOverlayModel, nullptr, nullptr );
|
|
#endif
|
|
|
|
#ifdef USE_LTSFRAMELESS
|
|
PlanOverlaysPlugin::PlanOverlayDialog<LtsWidgets::LtsFramelessDialog> * dialog = new PlanOverlaysPlugin::PlanOverlayDialog<LtsWidgets::LtsFramelessDialog>( nullptr, planOverlayModel, nullptr );
|
|
#endif
|
|
|
|
#ifdef CHECK_ERROR
|
|
PlanOverlaysPlugin::PlanOverlayDialog<QWidget> * dialog = new PlanOverlaysPlugin::PlanOverlayDialog<QWidget>( nullptr, planOverlayModel, nullptr );
|
|
#endif
|
|
|
|
unsigned int counter = 1;
|
|
|
|
auto doReadFile = [dialog,&counter]( int )
|
|
{
|
|
PlanOverlaysPlugin::PlanOverlayModel::PlanItem planItem = dialog->dialogWidget()->planOverlayModel()->planItem(counter++);
|
|
|
|
planItem.m_folderId = 6;
|
|
planItem.m_fileId = 42;
|
|
planItem.m_dirPath = QString();
|
|
planItem.m_fileName = QStringLiteral("Hugo_%1").arg(planItem.m_fileId);
|
|
planItem.m_minScale = 250000;
|
|
planItem.m_maxScale = 12000;
|
|
planItem.m_opacity = 1;
|
|
planItem.m_visibility = true;
|
|
|
|
dialog->dialogWidget()->planOverlayModel()->updatePlanItem( planItem );
|
|
};
|
|
|
|
auto doReloadPlan = [](unsigned int planId)
|
|
{
|
|
Q_UNUSED(planId);
|
|
QMessageBox::information(nullptr,QObject::tr("Reload Plan"),QObject::tr("doReloadPlan has been called"),QMessageBox::StandardButton::Ok);
|
|
};
|
|
|
|
auto doUnloadPlan = [dialog](unsigned int planId)
|
|
{
|
|
dialog->dialogWidget()->planOverlayModel()->removeOverlay(planId);
|
|
};
|
|
|
|
|
|
dialog->dialogWidget()->initFileManagement( nullptr, nullptr, nullptr, doReadFile, doReloadPlan, doUnloadPlan );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dialog->show();
|
|
|
|
app.setQuitOnLastWindowClosed(true);
|
|
|
|
int retval = app.exec();
|
|
|
|
SHUTDOWN_LOG(app.baseLogger());
|
|
|
|
return retval;
|
|
}
|