- 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>
83 lines
2.5 KiB
C++
83 lines
2.5 KiB
C++
/**
|
|
* @RDE_HEADER@
|
|
* Helper Class, which manages a progress Dialog with two states.
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*
|
|
* Created by Mike Wille, SLSE, 2016-06-20
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "lts_widgets_export.h"
|
|
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QPointer>
|
|
|
|
class QLabel;
|
|
class QWidget;
|
|
|
|
namespace LtsWidgets
|
|
{
|
|
class LtsFramelessDialog;
|
|
|
|
/**
|
|
* @brief The LtsProgressDialogHelper class is a helper class, which can be used to easily
|
|
* show a Dialog with eather a wait state (indefinite progress bar), or a default message,
|
|
* adjusted to the result type (see ReplyResult)
|
|
*/
|
|
class LTSWIDGETS_EXPORT LtsProgressDialogHelper : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
/**
|
|
* @brief The ReplyResult enum describes the behaviour of the slotSopWaitForReplyWindow method.
|
|
*/
|
|
enum class ReplyResult
|
|
{
|
|
Close = 0, // say nothing, just close automatically
|
|
Success, // dialog with success message, has to be receipted
|
|
Failure, // dialog with failure message plus reply string, has to be receipted
|
|
TimeOut, // dialog with timeout message, has to be receipted
|
|
};
|
|
|
|
explicit LtsProgressDialogHelper(QWidget *parent = nullptr);
|
|
~LtsProgressDialogHelper();
|
|
bool isShown() const { return !!m_waitDlg; }
|
|
void setCustomText(const QString &customText = QString());
|
|
|
|
void setParentWidget(QWidget *newParent);
|
|
|
|
public slots:
|
|
/**
|
|
* @brief slotShowWaitForReplyWindow shows a centered wait dialog which does not allow the user to interact with the application and cannot be canceled.
|
|
*/
|
|
void slotShowWaitForReplyWindow(/*const QString &textToShow*/);
|
|
|
|
/**
|
|
* @brief slotStopWaitForReplyWindow closes the wait dialog. Nothing happens when there was no show wait dialog called before.
|
|
* @param replyResult The wait dialog is closed on ReplyResult::Close. A new centered, modal dialog is shown on ReplyResult::Failure/Success/Timeout with an error message in it.
|
|
* @param replyString An explanatory string shown on ReplyResult::Failure to tell the user what went wrong on.
|
|
*/
|
|
void slotStopWaitForReplyWindow(const LtsWidgets::LtsProgressDialogHelper::ReplyResult &replyResult = ReplyResult::Close /* say nothing, just close */,
|
|
const QString &replyString = QString());
|
|
|
|
private:
|
|
QPointer<LtsFramelessDialog> m_waitDlg;
|
|
QWidget *m_parentWidget;
|
|
QPointer<QLabel> m_textLabel;
|
|
|
|
signals:
|
|
/**
|
|
* @brief accepted is emitted when accept() was called (e.g. by clicking okay)
|
|
*/
|
|
void accepted();
|
|
|
|
private slots:
|
|
void accept();
|
|
};
|
|
|
|
}
|