Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
#pragma once
#include "lts_frameless_dialog.h"
#include "lts_message_dialog.h"
#include <QHash>
#include <QObject>
#include <QString>
class QPushButton;
class QHBoxLayout;
namespace LtsWidgets
{
/**
* @brief The LtsMessageDialogHelper class cannot be exported and only is a helper class which is actually instantiated, shows the LtsMessageDialog.
* To provide the blocking call to showMessage (call with return type), an event loop is created and exited when the user has selected a button to close the dialog.
* If the behaviour is non-modal, closing the Dialog by clicking outside of it will return Button::Cancel.
*/
class LtsMessageDialogHelper : public QObject
{
Q_OBJECT
public:
explicit LtsMessageDialogHelper(QObject *parent = nullptr);
~LtsMessageDialogHelper() = default;
Button showMessage(QWidget *parent,
const QString &message,
const QString &title,
Behaviour behaviour,
LtsWidgets::Buttons buttons,
const QHash<Button, QString> &buttonTexts);
private:
QPushButton *addButton(const QString &text, QHBoxLayout *thatLayout, LtsFramelessDialog *dialog, const Button &button, QWidget *parent);
Button m_result;
LtsFramelessDialog *m_dialog;
private slots:
void slotOkay();
void slotYes();
void slotNo();
void slotCancel();
void slotApply();
void slotDiscard();
signals:
void signalQuitEventLoop();
};
} // namespace LtsWidgets