From aaf564cab7cbb0a79c37098bd9642a72cef9a9ba Mon Sep 17 00:00:00 2001 From: Knud Dollereder Date: Fri, 16 Oct 2020 16:45:44 +0200 Subject: CurveEditor: Fix bounding rect computation for the graphicsscene MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QDS-2957 Change-Id: I0019d538e7460e923b35024bd02f7186e1935f6b Reviewed-by: Henning Gründl Reviewed-by: Thomas Hartmann --- .../components/curveeditor/curveeditormodel.cpp | 6 ++--- .../components/curveeditor/curveeditormodel.h | 2 +- .../components/curveeditor/curveeditorstyle.h | 9 +++++++- .../components/curveeditor/curveeditorview.cpp | 4 ++-- .../components/curveeditor/detail/curveitem.cpp | 10 ++++++++ .../curveeditor/detail/graphicsscene.cpp | 27 +++++++++++++++++++++- .../components/curveeditor/detail/graphicsscene.h | 4 ++++ .../components/curveeditor/detail/graphicsview.cpp | 4 ++-- 8 files changed, 56 insertions(+), 10 deletions(-) (limited to 'src/plugins/qmldesigner/components') diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp b/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp index db58ce4dbb..56b91d0af6 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.cpp @@ -39,10 +39,10 @@ namespace DesignTools { -CurveEditorModel::CurveEditorModel(double minTime, double maxTime, QObject *parent) +CurveEditorModel::CurveEditorModel(QObject *parent) : TreeModel(parent) - , m_minTime(minTime) - , m_maxTime(maxTime) + , m_minTime(CurveEditorStyle::defaultTimeMin) + , m_maxTime(CurveEditorStyle::defaultTimeMax) {} CurveEditorModel::~CurveEditorModel() {} diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.h b/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.h index 952dc46c63..cf7575ca5c 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.h +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditormodel.h @@ -57,7 +57,7 @@ signals: void curveChanged(PropertyTreeItem *item); public: - CurveEditorModel(double minTime, double maxTime, QObject *parent = nullptr); + CurveEditorModel(QObject *parent = nullptr); ~CurveEditorModel() override; diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h index 6d6acebc51..854fabff23 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h @@ -105,6 +105,13 @@ struct Shortcuts struct CurveEditorStyle { + static constexpr double defaultTimeMin = 0.0; + static constexpr double defaultTimeMax = 100.0; + static constexpr double defaultValueMin = -1.0; + static constexpr double defaultValueMax = 1.0; + + static double defaultValueRange() { return std::abs(defaultValueMin - defaultValueMax); } + Shortcuts shortcuts; QBrush backgroundBrush = QBrush(QColor(5, 0, 100)); @@ -124,7 +131,7 @@ struct CurveEditorStyle double valueAxisWidth = 60.0; double valueOffsetTop = 10.0; double valueOffsetBottom = 10.0; - double labelDensityY = 1.5; + double labelDensityY = 2.0; HandleItemStyleOption handleStyle; KeyframeItemStyleOption keyframeStyle; diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp b/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp index 9d858d684c..b84d386f8e 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditorview.cpp @@ -42,7 +42,7 @@ namespace QmlDesigner { CurveEditorView::CurveEditorView(QObject *parent) : AbstractView(parent) , m_block(false) - , m_model(new DesignTools::CurveEditorModel(0., 500.)) + , m_model(new DesignTools::CurveEditorModel()) , m_editor(new DesignTools::CurveEditor(m_model)) { Q_UNUSED(parent); @@ -267,7 +267,7 @@ ModelNode getTargetNode1(DesignTools::PropertyTreeItem *item, const QmlTimeline QString targetId = nodeItem->name(); if (timeline.isValid()) { for (auto &&target : timeline.allTargets()) { - if (target.displayName() == targetId) + if (target.isValid() && target.displayName() == targetId) return target; } } diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp index 86aae0b2cc..90818be74b 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/curveitem.cpp @@ -87,6 +87,16 @@ QRectF CurveItem::boundingRect() const for (auto *item : m_keyframes) bbox(bounds, item->keyframe()); + if (auto *s = qobject_cast(scene())) { + bounds.setLeft(s->animationRangeMin()); + bounds.setRight(s->animationRangeMax()); + } + + if (qFuzzyCompare(bounds.height(), 0.0)) { + auto tmp = CurveEditorStyle::defaultValueRange() / 2.0; + bounds.adjust(0.0, -tmp, 0.0, tmp); + } + return m_transform.mapRect(bounds); } diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp index aca41b4d6d..e9f9050f62 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.cpp @@ -114,9 +114,29 @@ double GraphicsScene::maximumValue() const return limits().top(); } +double GraphicsScene::animationRangeMin() const +{ + if (GraphicsView *gview = graphicsView()) + return gview->minimumTime(); + + return minimumTime(); +} + +double GraphicsScene::animationRangeMax() const +{ + if (GraphicsView *gview = graphicsView()) + return gview->maximumTime(); + + return maximumTime(); +} + QRectF GraphicsScene::rect() const { - return sceneRect(); + QRectF rect; + for (auto *curve : curves()) + rect |= curve->boundingRect(); + + return rect; } QVector GraphicsScene::curves() const @@ -410,6 +430,11 @@ QRectF GraphicsScene::limits() const } m_limits = QRectF(QPointF(min.x(), max.y()), QPointF(max.x(), min.y())); + if (qFuzzyCompare(m_limits.height(), 0.0)) { + auto tmp = CurveEditorStyle::defaultValueRange() / 2.0; + m_limits.adjust(0.0, tmp, 0.0, -tmp); + } + m_dirty = false; } return m_limits; diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.h b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.h index 9443130b3e..c19f72b130 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.h +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsscene.h @@ -67,6 +67,10 @@ public: double maximumValue() const; + double animationRangeMin() const; + + double animationRangeMax() const; + QRectF rect() const; QVector curves() const; diff --git a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp index 9fec8b2fc5..c162b5fd90 100644 --- a/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp +++ b/src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp @@ -126,12 +126,12 @@ double GraphicsView::maximumTime() const double GraphicsView::minimumValue() const { - return m_scene->empty() ? -1.0 : m_scene->minimumValue(); + return m_scene->empty() ? CurveEditorStyle::defaultValueMin : m_scene->minimumValue(); } double GraphicsView::maximumValue() const { - return m_scene->empty() ? 1.0 : m_scene->maximumValue(); + return m_scene->empty() ? CurveEditorStyle::defaultValueMax : m_scene->maximumValue(); } double GraphicsView::zoomX() const -- cgit v1.2.3 From 83da45adde46df9c7762dc0004c7b02154876548 Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Mon, 19 Oct 2020 12:03:46 +0300 Subject: QmlDesigner: Remove AnnotationTool Remove AnnotationTool from FormEditor's selected item's tools. Change-Id: I797ed4002d14c04956aaeb5d779f1cf3f326f849 Fixes: QDS-2970 Reviewed-by: Miikka Heikkinen Reviewed-by: Aleksei German Reviewed-by: Thomas Hartmann --- .../annotationeditor/annotationeditor.pri | 2 - .../components/annotationeditor/annotationtool.cpp | 259 --------------------- .../components/annotationeditor/annotationtool.h | 93 -------- 3 files changed, 354 deletions(-) delete mode 100644 src/plugins/qmldesigner/components/annotationeditor/annotationtool.cpp delete mode 100644 src/plugins/qmldesigner/components/annotationeditor/annotationtool.h (limited to 'src/plugins/qmldesigner/components') diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.pri b/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.pri index e597e6862c..b1773c2dcf 100644 --- a/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.pri +++ b/src/plugins/qmldesigner/components/annotationeditor/annotationeditor.pri @@ -1,11 +1,9 @@ -HEADERS += $$PWD/annotationtool.h HEADERS += $$PWD/annotationcommenttab.h HEADERS += $$PWD/annotationeditordialog.h HEADERS += $$PWD/annotationeditor.h HEADERS += $$PWD/globalannotationeditor.h HEADERS += $$PWD/globalannotationeditordialog.h -SOURCES += $$PWD/annotationtool.cpp SOURCES += $$PWD/annotationcommenttab.cpp SOURCES += $$PWD/annotationeditordialog.cpp SOURCES += $$PWD/annotationeditor.cpp diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationtool.cpp b/src/plugins/qmldesigner/components/annotationeditor/annotationtool.cpp deleted file mode 100644 index 9db5d0d81c..0000000000 --- a/src/plugins/qmldesigner/components/annotationeditor/annotationtool.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#include "annotationtool.h" - -#include "formeditorscene.h" -#include "formeditorview.h" -#include "formeditorwidget.h" -#include "itemutilfunctions.h" -#include "formeditoritem.h" - -#include "nodemetainfo.h" -#include "qmlitemnode.h" -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -namespace QmlDesigner { - -class AnnotationToolAction : public AbstractAction -{ -public: - AnnotationToolAction() : AbstractAction(QCoreApplication::translate("AnnotationToolAction","Edit Annotation")) - { - } - - QByteArray category() const override - { - return QByteArray(); - } - - QByteArray menuId() const override - { - return "AnnotationTool"; - } - - int priority() const override - { - return CustomActionsPriority + 5; - } - - Type type() const override - { - return FormEditorAction; - } - -protected: - bool isVisible(const SelectionContext &selectionContext) const override - { - return selectionContext.singleNodeIsSelected(); - } - - bool isEnabled(const SelectionContext &selectionContext) const override - { - return isVisible(selectionContext); - } -}; - -AnnotationTool::AnnotationTool() -{ - auto annotationToolAction = new AnnotationToolAction; - QmlDesignerPlugin::instance()->designerActionManager().addDesignerAction(annotationToolAction); - connect(annotationToolAction->action(), &QAction::triggered, [=]() { - view()->changeCurrentToolTo(this); - }); -} - -AnnotationTool::~AnnotationTool() = default; - -void AnnotationTool::clear() -{ - if (m_annotationEditor) - m_annotationEditor->deleteLater(); - - AbstractFormEditorTool::clear(); -} - -void AnnotationTool::mousePressEvent(const QList &itemList, - QGraphicsSceneMouseEvent *event) -{ - AbstractFormEditorTool::mousePressEvent(itemList, event); -} - -void AnnotationTool::mouseMoveEvent(const QList & /*itemList*/, - QGraphicsSceneMouseEvent * /*event*/) -{ -} - -void AnnotationTool::hoverMoveEvent(const QList & /*itemList*/, - QGraphicsSceneMouseEvent * /*event*/) -{ -} - -void AnnotationTool::keyPressEvent(QKeyEvent * /*keyEvent*/) -{ -} - -void AnnotationTool::keyReleaseEvent(QKeyEvent * /*keyEvent*/) -{ -} - -void AnnotationTool::dragLeaveEvent(const QList &/*itemList*/, QGraphicsSceneDragDropEvent * /*event*/) -{ -} - -void AnnotationTool::dragMoveEvent(const QList &/*itemList*/, QGraphicsSceneDragDropEvent * /*event*/) -{ -} - -void AnnotationTool::mouseReleaseEvent(const QList &itemList, - QGraphicsSceneMouseEvent *event) -{ - AbstractFormEditorTool::mouseReleaseEvent(itemList, event); -} - - -void AnnotationTool::mouseDoubleClickEvent(const QList &itemList, QGraphicsSceneMouseEvent *event) -{ - AbstractFormEditorTool::mouseDoubleClickEvent(itemList, event); -} - -void AnnotationTool::itemsAboutToRemoved(const QList &removedItemList) -{ - if (m_annotationEditor.isNull()) - return; - - if (removedItemList.contains(m_formEditorItem)) - view()->changeToSelectionTool(); -} - -void AnnotationTool::selectedItemsChanged(const QList &itemList) -{ - if (!itemList.isEmpty()) { - m_formEditorItem = itemList.constFirst(); - - ModelNode itemModelNode = m_formEditorItem->qmlItemNode().modelNode(); - m_oldCustomId = itemModelNode.customId(); - m_oldAnnotation = itemModelNode.annotation(); - - if (m_annotationEditor.isNull()) { - m_annotationEditor = new AnnotationEditorDialog(view()->formEditorWidget()->parentWidget(), - itemModelNode.displayName(), - m_oldCustomId, m_oldAnnotation); - - connect(m_annotationEditor, &AnnotationEditorDialog::accepted, this, &AnnotationTool::annotationDialogAccepted); - connect(m_annotationEditor, &QDialog::rejected, this, &AnnotationTool::annotationDialogRejected); - - m_annotationEditor->show(); - m_annotationEditor->raise(); - } - } else { - view()->changeToSelectionTool(); - } -} - -void AnnotationTool::instancesCompleted(const QList & /*itemList*/) -{ -} - -void AnnotationTool::instancesParentChanged(const QList & /*itemList*/) -{ -} - -void AnnotationTool::instancePropertyChange(const QList > & /*propertyList*/) -{ -} - -void AnnotationTool::formEditorItemsChanged(const QList & /*itemList*/) -{ -} - -int AnnotationTool::wantHandleItem(const ModelNode & /*modelNode*/) const -{ - return 5; -} - -QString AnnotationTool::name() const -{ - return tr("Annotation Tool"); -} - -void AnnotationTool::annotationDialogAccepted() -{ - if (m_annotationEditor) { - saveNewCustomId(m_annotationEditor->customId()); - saveNewAnnotation(m_annotationEditor->annotation()); - - m_annotationEditor->close(); - m_annotationEditor->deleteLater(); - } - - m_annotationEditor = nullptr; - - view()->changeToSelectionTool(); -} - -void AnnotationTool::saveNewCustomId(const QString &customId) -{ - if (m_formEditorItem) { - m_oldCustomId = customId; - m_formEditorItem->qmlItemNode().modelNode().setCustomId(customId); - } -} - -void AnnotationTool::saveNewAnnotation(const Annotation &annotation) -{ - if (m_formEditorItem) { - if (annotation.comments().isEmpty()) - m_formEditorItem->qmlItemNode().modelNode().removeAnnotation(); - else - m_formEditorItem->qmlItemNode().modelNode().setAnnotation(annotation); - - m_oldAnnotation = annotation; - } -} - -void AnnotationTool::annotationDialogRejected() -{ - if (m_annotationEditor) { - m_annotationEditor->close(); - m_annotationEditor->deleteLater(); - } - - m_annotationEditor = nullptr; - - view()->changeToSelectionTool(); -} - -} diff --git a/src/plugins/qmldesigner/components/annotationeditor/annotationtool.h b/src/plugins/qmldesigner/components/annotationeditor/annotationtool.h deleted file mode 100644 index 0073286dd6..0000000000 --- a/src/plugins/qmldesigner/components/annotationeditor/annotationtool.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include "annotation.h" -#include "annotationeditordialog.h" -#include "abstractcustomtool.h" -#include "selectionindicator.h" - -#include -#include -#include - -namespace QmlDesigner { - -class AnnotationTool : public QObject, public AbstractCustomTool -{ - Q_OBJECT -public: - AnnotationTool(); - ~AnnotationTool() override; - - void mousePressEvent(const QList &itemList, - QGraphicsSceneMouseEvent *event) override; - void mouseMoveEvent(const QList &itemList, - QGraphicsSceneMouseEvent *event) override; - void mouseReleaseEvent(const QList &itemList, - QGraphicsSceneMouseEvent *event) override; - void mouseDoubleClickEvent(const QList &itemList, - QGraphicsSceneMouseEvent *event) override; - void hoverMoveEvent(const QList &itemList, - QGraphicsSceneMouseEvent *event) override; - void keyPressEvent(QKeyEvent *event) override; - void keyReleaseEvent(QKeyEvent *keyEvent) override; - - void dragLeaveEvent(const QList &itemList, - QGraphicsSceneDragDropEvent * event) override; - void dragMoveEvent(const QList &itemList, - QGraphicsSceneDragDropEvent * event) override; - - void itemsAboutToRemoved(const QList &itemList) override; - - void selectedItemsChanged(const QList &itemList) override; //impl needed - - void instancesCompleted(const QList &itemList) override; - void instancesParentChanged(const QList &itemList) override; - void instancePropertyChange(const QList > &propertyList) override; - - void clear() override; - - void formEditorItemsChanged(const QList &itemList) override; - - int wantHandleItem(const ModelNode &modelNode) const override; - - QString name() const override; - -private: - void annotationDialogAccepted(); - void annotationDialogRejected(); - void saveNewCustomId(const QString &customId); - void saveNewAnnotation(const Annotation &annotation); - -private: - FormEditorItem *m_formEditorItem = nullptr; - QString m_oldCustomId; - Annotation m_oldAnnotation; - QPointer m_annotationEditor; -}; - -} -- cgit v1.2.3 From 3614ab81ce9726b17b0c725ff55e1ae5be3ab7d1 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 20 Oct 2020 11:05:46 +0200 Subject: QmlDesigner: Fix incorrect conversion between double and int/long And fix macOS build which complained that std::abs with doubles is ambiguous (between int and long and long long). Amends aaf564cab7cbb0a79c37098bd9642a72cef9a9ba Change-Id: I87d4453afa4dda676cc27c219d7dbfc22fcee70a Reviewed-by: Knud Dollereder Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/qmldesigner/components') diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h index 854fabff23..3eda30dfcd 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h @@ -110,7 +110,7 @@ struct CurveEditorStyle static constexpr double defaultValueMin = -1.0; static constexpr double defaultValueMax = 1.0; - static double defaultValueRange() { return std::abs(defaultValueMin - defaultValueMax); } + static double defaultValueRange() { return std::fabs(defaultValueMin - defaultValueMax); } Shortcuts shortcuts; -- cgit v1.2.3 From 675a85bef088d9d7f039ffb7054957ee2e90e11e Mon Sep 17 00:00:00 2001 From: Robert Loehning Date: Tue, 20 Oct 2020 12:18:10 +0200 Subject: QmlDesigner: Add missing include Amends 3614ab81ce9726b17b0c725ff55e1ae5be3ab7d1 Change-Id: Ib8a02fe5829462379ae9a665b5c0e8e8832cc090 Reviewed-by: Knud Dollereder Reviewed-by: Eike Ziller --- src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/plugins/qmldesigner/components') diff --git a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h index 3eda30dfcd..f6c6c378c5 100644 --- a/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h +++ b/src/plugins/qmldesigner/components/curveeditor/curveeditorstyle.h @@ -36,6 +36,8 @@ #include #include +#include + namespace DesignTools { struct TreeItemStyleOption -- cgit v1.2.3 From 6b8d8e414ac45ed74fd3968da9525c704178eae8 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 8 Oct 2020 10:50:15 +0300 Subject: QmlDesigner: Port 3D edit view to Qt6 Task-number: QDS-2899 Change-Id: Iedbe5e8561e5ab71ef32922e69da43cd3cc57e90 Reviewed-by: Thomas Hartmann --- src/plugins/qmldesigner/components/edit3d/edit3dcanvas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/qmldesigner/components') diff --git a/src/plugins/qmldesigner/components/edit3d/edit3dcanvas.cpp b/src/plugins/qmldesigner/components/edit3d/edit3dcanvas.cpp index 91aa006299..de3757e68c 100644 --- a/src/plugins/qmldesigner/components/edit3d/edit3dcanvas.cpp +++ b/src/plugins/qmldesigner/components/edit3d/edit3dcanvas.cpp @@ -92,7 +92,7 @@ void Edit3DCanvas::paintEvent(QPaintEvent *e) QPainter painter(this); - painter.drawImage(rect(), m_image, rect()); + painter.drawImage(rect(), m_image, QRect(0, 0, m_image.width(), m_image.height())); } void Edit3DCanvas::resizeEvent(QResizeEvent *e) -- cgit v1.2.3