diff options
| author | Sandro Jäckel <sandro.jaeckel@gmail.com> | 2018-02-23 01:45:58 +0100 |
|---|---|---|
| committer | Sandro Jäckel <sandro.jaeckel@gmail.com> | 2018-02-23 01:45:58 +0100 |
| commit | ea6292168a6acd4c263913f0ccd7dd64daf4f5cf (patch) | |
| tree | 312024abbd7c3c100274f3a8031d49096480b654 /src/lockeddialogbase.cpp | |
| parent | 5e5c9c07291f6b09623d31c92b1fb61c4ede576e (diff) | |
Revert "Applied clang-format on source"
This reverts commit 5e5c9c07291f6b09623d31c92b1fb61c4ede576e.
Diffstat (limited to 'src/lockeddialogbase.cpp')
| -rw-r--r-- | src/lockeddialogbase.cpp | 63 |
1 files changed, 39 insertions, 24 deletions
diff --git a/src/lockeddialogbase.cpp b/src/lockeddialogbase.cpp index 4cf158ea..b18f7429 100644 --- a/src/lockeddialogbase.cpp +++ b/src/lockeddialogbase.cpp @@ -22,37 +22,52 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. #include <QPoint> #include <QResizeEvent> #include <QWidget> -#include <Qt> // for Qt::FramelessWindowHint, etc +#include <Qt> // for Qt::FramelessWindowHint, etc -LockedDialogBase::LockedDialogBase(QWidget* parent, bool allowClose) - : QDialog(parent), m_Unlocked(false), m_Canceled(false), m_allowClose(allowClose) { - if (parent != nullptr) { - QPoint position = parent->mapToGlobal(QPoint(parent->width() / 2, parent->height() / 2)); - position.rx() -= this->width() / 2; - position.ry() -= this->height() / 2; - move(position); - } +LockedDialogBase::LockedDialogBase(QWidget *parent, bool allowClose) + : QDialog(parent) + , m_Unlocked(false) + , m_Canceled(false) + , m_allowClose(allowClose) +{ + if (parent != nullptr) { + QPoint position = parent->mapToGlobal(QPoint(parent->width() / 2, parent->height() / 2)); + position.rx() -= this->width() / 2; + position.ry() -= this->height() / 2; + move(position); + } } -void LockedDialogBase::resizeEvent(QResizeEvent* event) { - QWidget* par = parentWidget(); - if (par != nullptr) { - QPoint position = par->mapToGlobal(QPoint(par->width() / 2, par->height() / 2)); - position.rx() -= event->size().width() / 2; - position.ry() -= event->size().height() / 2; - move(position); - } +void LockedDialogBase::resizeEvent(QResizeEvent *event) +{ + QWidget *par = parentWidget(); + if (par != nullptr) { + QPoint position = par->mapToGlobal(QPoint(par->width() / 2, par->height() / 2)); + position.rx() -= event->size().width() / 2; + position.ry() -= event->size().height() / 2; + move(position); + } } -void LockedDialogBase::reject() { - if (m_allowClose) - unlock(); +void LockedDialogBase::reject() +{ + if (m_allowClose) + unlock(); } -bool LockedDialogBase::unlockForced() const { return m_Unlocked; } +bool LockedDialogBase::unlockForced() const { + return m_Unlocked; +} -bool LockedDialogBase::canceled() const { return m_Canceled; } +bool LockedDialogBase::canceled() const { + return m_Canceled; +} -void LockedDialogBase::unlock() { m_Unlocked = true; } +void LockedDialogBase::unlock() { + m_Unlocked = true; +} + +void LockedDialogBase::cancel() { + m_Canceled = true; +} -void LockedDialogBase::cancel() { m_Canceled = true; } |
