diff options
Diffstat (limited to 'Swift/QtUI/Trellis/QtGridSelectionDialog.h')
-rw-r--r-- | Swift/QtUI/Trellis/QtGridSelectionDialog.h | 91 |
1 files changed, 47 insertions, 44 deletions
diff --git a/Swift/QtUI/Trellis/QtGridSelectionDialog.h b/Swift/QtUI/Trellis/QtGridSelectionDialog.h index abcc8b1..557963d 100644 --- a/Swift/QtUI/Trellis/QtGridSelectionDialog.h +++ b/Swift/QtUI/Trellis/QtGridSelectionDialog.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -11,47 +11,50 @@ namespace Swift { - class QtGridSelectionDialog : public QWidget { - Q_OBJECT - - Q_PROPERTY(QSize currentGridSize READ getCurrentGridSize WRITE setCurrentGridSize NOTIFY currentGridSizeChanged) - Q_PROPERTY(QSize minGridSize READ getMinGridSize WRITE setMinGridSize NOTIFY minGridSizeChanged) - Q_PROPERTY(QSize maxGridSize READ getMaxGridSize WRITE setMaxGridSize NOTIFY maxGridSizeChanged) - public: - explicit QtGridSelectionDialog(QWidget* parent = 0); - - virtual QSize sizeHint() const; - - void setCurrentGridSize(const QSize& size); - QSize getCurrentGridSize() const; - void setMinGridSize(const QSize& size); - QSize getMinGridSize() const; - void setMaxGridSize(const QSize& size); - QSize getMaxGridSize() const; - - signals: - void currentGridSizeChanged(QSize); - void minGridSizeChanged(QSize); - void maxGridSizeChanged(QSize); - - protected: - void keyReleaseEvent(QKeyEvent* event); - void mousePressEvent(QMouseEvent* event); - void mouseMoveEvent(QMouseEvent* event); - void paintEvent(QPaintEvent* event); - void showEvent(QShowEvent* event); - void hideEvent(QHideEvent* event); - void leaveEvent(QEvent *event); - - private: - int padding; - int horizontalMargin; - int verticalMargin; - - QSize frameSize; - - QSize currentGridSize; - QSize minGridSize; - QSize maxGridSize; - }; + class QtGridSelectionDialog : public QWidget { + Q_OBJECT + + Q_PROPERTY(QSize currentGridSize READ getCurrentGridSize WRITE setCurrentGridSize NOTIFY currentGridSizeChanged) + Q_PROPERTY(QSize minGridSize READ getMinGridSize WRITE setMinGridSize NOTIFY minGridSizeChanged) + Q_PROPERTY(QSize maxGridSize READ getMaxGridSize WRITE setMaxGridSize NOTIFY maxGridSizeChanged) + public: + explicit QtGridSelectionDialog(QWidget* parent = nullptr); + + virtual QSize sizeHint() const; + + void setCurrentGridSize(const QSize& size); + QSize getCurrentGridSize() const; + void setMinGridSize(const QSize& size); + QSize getMinGridSize() const; + void setMaxGridSize(const QSize& size); + QSize getMaxGridSize() const; + + signals: + void currentGridSizeChanged(QSize); + void minGridSizeChanged(QSize); + void maxGridSizeChanged(QSize); + + protected: + void keyReleaseEvent(QKeyEvent* event); + void mousePressEvent(QMouseEvent* event); + void mouseMoveEvent(QMouseEvent* event); + void paintEvent(QPaintEvent* event); + void showEvent(QShowEvent* event); + void hideEvent(QHideEvent* event); + void leaveEvent(QEvent *event); + bool event(QEvent* event); + + private: + int padding; + int horizontalMargin; + int verticalMargin; + + QSize frameSize; + + QSize currentGridSize; + QSize minGridSize; + QSize maxGridSize; + + const QString descriptionText; + }; } |