diff options
author | Joanna Hulboj <joanna.hulboj@isode.com> | 2017-02-03 10:19:53 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2017-02-09 11:39:12 (GMT) |
commit | d81f9e750627a83c12afeb4718eb12bbb53f5270 (patch) | |
tree | a4bab5e20c5e5154941955a4da89a6ba49a6f574 /Swift/QtUI/Trellis/QtGridSelectionDialog.h | |
parent | 5fb2281fc8e6beab84f5e2b1117455a65d2ab3de (diff) | |
download | swift-d81f9e750627a83c12afeb4718eb12bbb53f5270.zip swift-d81f9e750627a83c12afeb4718eb12bbb53f5270.tar.bz2 |
Fix mouse movement when resizing trellis layout.
Test-Information:
From view menu choose "Change Layout", move mouse to resize trellis.
Trellis resizing works fine.
Change-Id: I112c0bd84dc57abb3bb95f825f74b2efa1f8e183
Diffstat (limited to 'Swift/QtUI/Trellis/QtGridSelectionDialog.h')
-rw-r--r-- | Swift/QtUI/Trellis/QtGridSelectionDialog.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Swift/QtUI/Trellis/QtGridSelectionDialog.h b/Swift/QtUI/Trellis/QtGridSelectionDialog.h index 3ccba55..2cb36ca 100644 --- a/Swift/QtUI/Trellis/QtGridSelectionDialog.h +++ b/Swift/QtUI/Trellis/QtGridSelectionDialog.h @@ -3,60 +3,64 @@ * 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; + int getDescriptionTextHeight() 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); + void timerEvent(QTimerEvent* event); + + private: + int getDescriptionTextHeight(int width) const; private: int padding; int horizontalMargin; int verticalMargin; + int timerId; QSize frameSize; QSize currentGridSize; QSize minGridSize; QSize maxGridSize; const QString descriptionText; }; } |