diff options
author | Joanna Hulboj <joanna.hulboj@isode.com> | 2017-01-12 11:10:23 (GMT) |
---|---|---|
committer | Joanna Hulboj <joanna.hulboj@isode.com> | 2017-01-18 10:39:02 (GMT) |
commit | fa068e62cbf70d93296de7887cbcfdda5d36d2b2 (patch) | |
tree | 8993c4d5bddb7446dcd675f522af73c519e3db44 /Swift/QtUI/Trellis/QtGridSelectionDialog.h | |
parent | e649c54daa666c99d2f934b223acd0262c05e11a (diff) | |
download | swift-fa068e62cbf70d93296de7887cbcfdda5d36d2b2.zip swift-fa068e62cbf70d93296de7887cbcfdda5d36d2b2.tar.bz2 |
Set cursor position to the center of the screen to show layout window in the middle of the screen
Test-Information:
Tested with multiple screen setup.
Tested only on Windows.
From view menu choose "Change Layout", the layout window appears in the
middle of the screen.
Change-Id: Iab4ba64d54766426be39926773aa5b5bb628b9e9
Diffstat (limited to 'Swift/QtUI/Trellis/QtGridSelectionDialog.h')
-rw-r--r-- | Swift/QtUI/Trellis/QtGridSelectionDialog.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Swift/QtUI/Trellis/QtGridSelectionDialog.h b/Swift/QtUI/Trellis/QtGridSelectionDialog.h index 557963d..3ccba55 100644 --- a/Swift/QtUI/Trellis/QtGridSelectionDialog.h +++ b/Swift/QtUI/Trellis/QtGridSelectionDialog.h @@ -2,59 +2,61 @@ * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include <QSize> #include <QWidget> 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 = 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; + QSize getFrameSize() 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; }; } |