58 lines
986 B
C++
58 lines
986 B
C++
|
|
|
|
#pragma once
|
|
|
|
#include "nglwidgets_export.h"
|
|
|
|
#include <QtWidgets/QDialog>
|
|
#include "nglstandardbutton.h"
|
|
|
|
class NGLWIDGETS_EXPORT NGLDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit NGLDialog(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
|
|
|
|
void setHelpContext(const QString &helpContext);
|
|
|
|
|
|
static void centerWidget(QWidget *widgetToCenter);
|
|
|
|
|
|
static void printWidget(QWidget *widgetToPrint);
|
|
|
|
|
|
void setWindowTitle(const QString &title);
|
|
|
|
|
|
QString windowTitle() const;
|
|
|
|
|
|
void setDialogReadOnly(bool bReadOnly, const QString &reason = QString());
|
|
|
|
|
|
bool isDialogReadOnly() const;
|
|
|
|
Q_SIGNALS:
|
|
|
|
|
|
void invokeHelp(const QString &helpContext);
|
|
|
|
protected:
|
|
virtual void showEvent(QShowEvent *e);
|
|
virtual void keyPressEvent(QKeyEvent *e);
|
|
void centerWidget();
|
|
void printWidget();
|
|
protected Q_SLOTS:
|
|
|
|
|
|
void onInvokeHelp();
|
|
|
|
private:
|
|
QString m_helpContext;
|
|
bool m_bReadOnly;
|
|
QString m_readOnlyReason;
|
|
QString m_realWindowTitle;
|
|
};
|