Continues migration with DDS, Common
This commit is contained in:
1 parent
9b15cee841
commit
fa48db111e
668 files changed
+111841
-2
No files matched your search
Executable
+86
@@ -0,0 +1,86 @@
|
||||
#pragma once
|
||||
|
||||
#include "lts_widgets_export.h"
|
||||
#include "lts_frameless_dialog.h"
|
||||
|
||||
#include <QString>
|
||||
#include <QHash>
|
||||
|
||||
|
||||
class QWidget;
|
||||
class QHBoxLayout;
|
||||
|
||||
|
||||
namespace LtsWidgets
|
||||
{
|
||||
|
||||
|
||||
|
||||
enum class Button
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
Ok = 1,
|
||||
Yes = 2,
|
||||
No = 4,
|
||||
Cancel = 8,
|
||||
|
||||
Apply = 16,
|
||||
Discard = 32,
|
||||
};
|
||||
Q_DECLARE_FLAGS(Buttons, Button)
|
||||
inline uint qHash(LtsWidgets::Button b)
|
||||
{
|
||||
return ::qHash(static_cast<int>(b));
|
||||
}
|
||||
|
||||
|
||||
|
||||
namespace LtsMessageDialog
|
||||
{
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class LTSWIDGETS_EXPORT LtsMessageDialogNew : public QObject
|
||||
{
|
||||
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 );
|
||||
|
||||
private:
|
||||
LtsFramelessDialog *m_dialog;
|
||||
|
||||
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();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(LtsWidgets::Buttons)
|
||||
Reference in new issue
Block a user