forked from qt-creator/qt-creator
QmlDesigner: Disable TransitionEditorView when not visible
Change-Id: I76a1829dae18d651168f92558d65beb8b94f1f88 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -72,6 +72,10 @@ TransitionEditorView::~TransitionEditorView() = default;
|
|||||||
void TransitionEditorView::modelAttached(Model *model)
|
void TransitionEditorView::modelAttached(Model *model)
|
||||||
{
|
{
|
||||||
AbstractView::modelAttached(model);
|
AbstractView::modelAttached(model);
|
||||||
|
|
||||||
|
if (!isEnabled())
|
||||||
|
return;
|
||||||
|
|
||||||
if (m_transitionEditorWidget)
|
if (m_transitionEditorWidget)
|
||||||
m_transitionEditorWidget->init();
|
m_transitionEditorWidget->init();
|
||||||
}
|
}
|
||||||
|
@@ -385,10 +385,24 @@ void TransitionEditorWidget::setupScrollbar(int min, int max, int current)
|
|||||||
void TransitionEditorWidget::showEvent(QShowEvent *event)
|
void TransitionEditorWidget::showEvent(QShowEvent *event)
|
||||||
{
|
{
|
||||||
Q_UNUSED(event)
|
Q_UNUSED(event)
|
||||||
|
|
||||||
|
m_transitionEditorView->setEnabled(true);
|
||||||
|
|
||||||
|
if (m_transitionEditorView->model())
|
||||||
|
init();
|
||||||
|
|
||||||
graphicsScene()->setWidth(m_graphicsView->viewport()->width());
|
graphicsScene()->setWidth(m_graphicsView->viewport()->width());
|
||||||
graphicsScene()->invalidateLayout();
|
graphicsScene()->invalidateLayout();
|
||||||
graphicsScene()->invalidate();
|
graphicsScene()->invalidate();
|
||||||
graphicsScene()->onShow();
|
graphicsScene()->onShow();
|
||||||
|
|
||||||
|
QWidget::showEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TransitionEditorWidget::hideEvent(QHideEvent *event)
|
||||||
|
{
|
||||||
|
m_transitionEditorView->setEnabled(false);
|
||||||
|
QWidget::hideEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransitionEditorWidget::resizeEvent(QResizeEvent *event)
|
void TransitionEditorWidget::resizeEvent(QResizeEvent *event)
|
||||||
|
@@ -74,6 +74,7 @@ public slots:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent *event) override;
|
void showEvent(QShowEvent *event) override;
|
||||||
|
void hideEvent(QHideEvent *event) override;
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
void resizeEvent(QResizeEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user