Qt6 Migration: LtsWidgets, BUILD_RTI Guards, externe Dependencies dokumentiert
- LtsWidgets Verzeichnis vollständig migriert (Qt5→Qt6) - BUILD_RTI Guards für RTI-spezifische Module hinzugefügt - Externe Dependencies in EXTERNAL_DEPS.md dokumentiert - Qt6 API-Änderungen: QRegExp→QRegularExpression, enterEvent(QEnterEvent*) - AutoUic-Fehler bei ui_requirement behoben (SKIP_AUTOUIC) - Include-Pfade korrigiert (LtsElevation, LtsMultiMonitor, LtsUtilsCore) - MOC-Fehler behoben (Q_INTERFACES entfernt wo nicht benötigt) - CMakeLists.txt Anpassungen für Qt6 (PUBLIC statt INTERFACE) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
145 files changed
+17700
-14377
No files matched your search
@@ -1,67 +1,102 @@
|
||||
#pragma once
|
||||
|
||||
#include "lts_frameless_dialog.h"
|
||||
#include "lts_widgets_export.h"
|
||||
#include "lts_frameless_dialog.h"
|
||||
|
||||
#include <QHash>
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
|
||||
|
||||
class QWidget;
|
||||
class QHBoxLayout;
|
||||
|
||||
|
||||
namespace LtsWidgets
|
||||
{
|
||||
|
||||
enum class Button {
|
||||
UNKNOWN = 0,
|
||||
Ok = 1,
|
||||
Yes = 2,
|
||||
No = 4,
|
||||
Cancel = 8,
|
||||
/**
|
||||
* @brief The Button enum describes one or more buttons, which should be shown on a Dialog which supports LtsWidgets::Button. Also this enum
|
||||
* is the return type of LtsMessageDialog and provides the button clicked to close the Popup-Dialog.
|
||||
*/
|
||||
enum class Button
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
Ok = 1,
|
||||
Yes = 2,
|
||||
No = 4,
|
||||
Cancel = 8,
|
||||
|
||||
Apply = 16,
|
||||
Discard = 32,
|
||||
Apply = 16,
|
||||
Discard = 32,
|
||||
};
|
||||
Q_DECLARE_FLAGS(Buttons, Button)
|
||||
|
||||
inline uint qHash(LtsWidgets::Button b)
|
||||
{
|
||||
return ::qHash(static_cast<int>(b));
|
||||
return ::qHash(static_cast<int>(b));
|
||||
}
|
||||
|
||||
namespace LtsMessageDialog
|
||||
/**
|
||||
* @brief [Please consider using LtsMessageDialogNew] The LtsMessageDialog class provides a BLOCKING Popup-Dialog (based on LtsFramelessDialog) to show a message to the user with selectable buttons. This class is static and cannot be instantiated.
|
||||
* To show a message to the user class 'LtsMessageDialog::showMessage(..)'. And to get the button that was selected by the user to close the dialog, consider the return type 'LtsWidgets::Button'.
|
||||
* This Popup-Dialog closes automatically if any button on it is clicked.
|
||||
* The return type is an enum class instance which contains the information about the clicked button.
|
||||
* If no button was specified there is no chance to close the dialog if LtsWidgets::Behaviour::Modal was specified.
|
||||
*/
|
||||
namespace LtsMessageDialog // in reality this is the helper, but for "naming's sake", this is not called the helper
|
||||
{
|
||||
|
||||
LTSWIDGETS_EXPORT Button showMessage(QWidget* parent, const QString& message, const QString& title = QString(),
|
||||
const Behaviour behaviour = Behaviour::Modal, const Buttons buttons = Button::Ok,
|
||||
const QHash<Button, QString>& buttonTexts = QHash<Button, QString>());
|
||||
LTSWIDGETS_EXPORT Button askApplyDiscardCancel(QWidget* parent);
|
||||
/**
|
||||
* @brief showMessage shows a Popup-Dialog to show a message to the user with selectable buttons - method is blocking (creates new EventLoop)!
|
||||
* @param parent The widget to be covered.
|
||||
* @param message The message to the user.
|
||||
* @param behaviour How the Popup-Dialog should behave (see LtsFramelessDialog).
|
||||
* @param buttons A list of Buttons to provide to the user.
|
||||
* @param buttonTexts If set, the button texts are used from there instead the default ones
|
||||
* @return The button that has been clicked by the user to close this Popup-Dialog.
|
||||
*/
|
||||
LTSWIDGETS_EXPORT Button showMessage(QWidget* parent,
|
||||
const QString &message,
|
||||
const QString &title = QString(),
|
||||
const Behaviour behaviour = Behaviour::Modal,
|
||||
const Buttons buttons = Button::Ok,
|
||||
const QHash<Button, QString> &buttonTexts = QHash<Button, QString>());
|
||||
LTSWIDGETS_EXPORT Button askApplyDiscardCancel(QWidget *parent);
|
||||
} // namespace LtsMessageDialog
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief The LtsMessageDialog class provides a NON-BLOCKING Popup-Dialog (based on LtsFramelessDialog) to show a message to the user with selectable buttons.
|
||||
* To show a message to the user use: connect(new LtsMessageDialogNew(this, title, message), &LtsMessageDialogNew::ok, this, &MyDialog::mySlot);
|
||||
* This Popup-Dialog closes automatically if any button on it is clicked.
|
||||
* Keep in mind that as this dialog does not block, following code gets executed right afetr creating this dialog.
|
||||
*/
|
||||
class LTSWIDGETS_EXPORT LtsMessageDialogNew : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit LtsMessageDialogNew(QWidget* parent, const QString& message, const QString& title = QString(),
|
||||
const Behaviour behaviour = Behaviour::Modal, const Buttons buttons = Button::Ok,
|
||||
const QHash<Button, QString>& buttonTexts = QHash<Button, QString>(),
|
||||
bool deleteOnClose = true);
|
||||
public:
|
||||
explicit LtsMessageDialogNew(QWidget* parent,
|
||||
const QString &message,
|
||||
const QString &title = QString(),
|
||||
const Behaviour behaviour = Behaviour::Modal,
|
||||
const Buttons buttons = Button::Ok,
|
||||
const QHash<Button, QString> &buttonTexts = QHash<Button, QString>(),
|
||||
bool deleteOnClose = true /* retain c++ conformity by this convenience bool */);
|
||||
|
||||
private:
|
||||
LtsFramelessDialog* m_dialog;
|
||||
private:
|
||||
LtsFramelessDialog *m_dialog;
|
||||
|
||||
QPushButton* addButton(const QString& text, QHBoxLayout* thatLayout, LtsFramelessDialog* dialog,
|
||||
const Button& button, QWidget* parent);
|
||||
QPushButton *addButton(const QString &text, QHBoxLayout *thatLayout, LtsFramelessDialog *dialog, const Button &button, QWidget *parent);
|
||||
|
||||
|
||||
signals:
|
||||
void ok();
|
||||
void yes();
|
||||
void no();
|
||||
void apply();
|
||||
void discard();
|
||||
void cancel();
|
||||
|
||||
signals:
|
||||
void ok();
|
||||
void yes();
|
||||
void no();
|
||||
void apply();
|
||||
void discard();
|
||||
void cancel();
|
||||
};
|
||||
|
||||
} // namespace LtsWidgets
|
||||
|
||||
Reference in new issue
Block a user