Skip to content

Commit

Permalink
Merge 63da22b into 6999d18
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Nov 28, 2019
2 parents 6999d18 + 63da22b commit c048208
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,18 @@ void SimulationExperimentViewSimulationWidget::changeEvent(QEvent *pEvent)
// Check whether we are becoming enabled/disabled, in which case we want to
// update our output widget while keeping its scrollbars, if any, still at
// the same position
// Note: we used to do this only when we were visible, but in some cases
// (e.g. when running a simulation from our Python console) this may
// result in our output widget not being re-enabled. So, now, we
// want to update our output widget even when it's not visible.
// However, to be able to do so, we must have been visible at least
// once, hence our use of mCanHandleChangeEvent...

if (pEvent->type() == QEvent::EnabledChange) {
if (isVisible()) {
mCanHandleChangeEvent = true;
}

if (mCanHandleChangeEvent && (pEvent->type() == QEvent::EnabledChange)) {
int horizontalSliderPosition = mOutputWidget->horizontalScrollBar()->sliderPosition();
int verticalSliderPosition = mOutputWidget->verticalScrollBar()->sliderPosition();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ class SimulationExperimentViewSimulationWidget : public Core::Widget

Core::UserMessageWidget *mInvalidModelMessageWidget;

bool mCanHandleChangeEvent = false;

QTextEdit *mOutputWidget;
QString mOutputMessage;

Expand Down

0 comments on commit c048208

Please sign in to comment.