Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_lock_handler.h
T
torsten f14faa04e5 Qt6-Migration: QObject-Include-Fixes + ui_requirement umbenannt
- #include <QObject> zu 106+ Header-Dateien hinzugefügt (Qt6 benötigt explizites Include)
- ui_requirement.h/cpp zu requirement_widget.h/cpp umbenannt (vermeidet AutoUIC-Scan)
- CMakeLists.txt aktualisiert
- Qt6Positioning-Dependency in Dockerfile hinzugefügt

Fixes:
- AutoUIC-Fehler bei AesBaseGui (requirement.ui nicht gefunden)
- QObject-Missing-Include-Fehler in Qt6
- Qt6Location-Modul nicht gefunden (qtpositioning fehlte)
2026-08-19 02:29:53 +02:00

89 lines
1.8 KiB
C++
Executable File

#pragma once
#include <QObject>
#include <LtsSession/ltssession_export.h>
#include <LtsWidgets/lts_dialog.h>
#include <DDS/Core/core_ftc.h>
#include <QPointer>
#include <memory>
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace LtsSession
{
class LTSSESSION_EXPORT TopicLockHandler : public QObject
{
Q_OBJECT
public:
TopicLockHandler();
~TopicLockHandler();
bool init(const std::shared_ptr<Core::Interface::Ftc> &coreFtc, int exerciseId);
bool isLocked() const { return m_locked; }
LtsWidgets::TopicInfo getTopicInfo() const { return m_topicInfo; }
public slots:
void slotTryLock(const LtsWidgets::TopicInfo &topicInfo);
bool slotUnlock();
void slotFinalize();
signals:
void signalLockDialog(const QString &lockedBy);
void signalUnlockDialog();
private:
bool lock();
bool unlock();
std::string objStateAsString() const;
std::shared_ptr<Core::Interface::Ftc> m_coreFtc;
LtsWidgets::TopicInfo m_topicInfo;
int m_lockEntityId{0};
int m_exerciseId{0};
bool m_locked{false};
bool m_askedForLock{false};
bool m_deleteAfterAnswer{false};
NGL::INGLLogger &m_logger;
};
class LTSSESSION_EXPORT TopicLockHanderData : public QObject
{
Q_OBJECT
public:
TopicLockHanderData();
~TopicLockHanderData();
void init(const std::shared_ptr<Core::Interface::Ftc> &coreFtc, int exerciseId);
void unlock();
void slotTryLock(const LtsWidgets::TopicInfo &topicInfo);
bool isLocked() const;
LtsWidgets::TopicInfo getTopicInfo() const;
const QString &getLockedBy() const { return m_lockedBy; }
Q_SIGNALS:
void lockDataChanged();
private Q_SLOTS:
void slotLock(const QString &lockedBy);
void slotUnlock();
public:
QString m_debugName;
private:
QPointer<TopicLockHandler> m_topicLockHandler;
QString m_lockedBy;
};
}