Mouse double click zoom fit best current pattern piece.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-04-17 09:56:41 +03:00
parent 29b751b5a2
commit be2a706cc0
6 changed files with 25 additions and 1 deletions

View File

@ -49,6 +49,7 @@
- [#818] Improve Piece path validation. Check uniqueness.
- [#819] Use OpenGL as render for view.
- [#826] New Feature. Add and remove items to groups from the context menu.
- Mouse double click zoom fit best current pattern piece.
# Version 0.5.1 (unreleased)
- [#683] Tool Seam allowance's dialog is off screen on small resolutions.

View File

@ -71,6 +71,7 @@ public slots:
virtual void ShowToolTip(const QString &toolTip) Q_DECL_OVERRIDE;
virtual void UpdateVisibilityGroups() Q_DECL_OVERRIDE;
virtual void UpdateDetailsList() Q_DECL_OVERRIDE;
virtual void ZoomFitBestCurrent() Q_DECL_OVERRIDE;
signals:
void RefreshHistory();
@ -190,7 +191,6 @@ private slots:
void ClosedDialogPlaceLabel(int result);
void ClosedDialogInsertNode(int result);
void ZoomFitBestCurrent();
void LoadIndividual();
void LoadMultisize();
void UnloadMeasurements();

View File

@ -168,3 +168,9 @@ void VAbstractMainWindow::UpdateDetailsList()
{
// do nothing
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractMainWindow::ZoomFitBestCurrent()
{
// do nothing
}

View File

@ -48,6 +48,7 @@ public slots:
virtual void ShowToolTip(const QString &toolTip)=0;
virtual void UpdateVisibilityGroups();
virtual void UpdateDetailsList();
virtual void ZoomFitBestCurrent();
protected slots:
void WindowsLocale();

View File

@ -61,6 +61,7 @@
#include "vsimplecurve.h"
#include "../vmisc/vabstractapplication.h"
#include "../vmisc/vsettings.h"
#include "vabstractmainwindow.h"
const int GraphicsViewZoom::duration = 300;
const int GraphicsViewZoom::updateInterval = 40;
@ -607,6 +608,20 @@ void VMainGraphicsView::mouseReleaseEvent(QMouseEvent *event)
}
}
//---------------------------------------------------------------------------------------------------------------------
void VMainGraphicsView::mouseDoubleClickEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
{
if (VAbstractMainWindow *window = qobject_cast<VAbstractMainWindow *>(qApp->getMainWindow()))
{
window->ZoomFitBestCurrent();
}
}
QGraphicsView::mouseDoubleClickEvent(event);
}
//---------------------------------------------------------------------------------------------------------------------
qreal VMainGraphicsView::MinScale()
{

View File

@ -158,6 +158,7 @@ protected:
virtual void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
virtual void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
virtual void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
virtual void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
private:
Q_DISABLE_COPY(VMainGraphicsView)
GraphicsViewZoom* zoom;