-3

I am having a crash in main window QWidget destructor on the line below. For some unknown reason, d->focus_next contains a dangling pointer. Anyone has any tips what could be causing it?

enter image description here

Danol
  • 368
  • 1
  • 15
  • @eyllanesc I feel like the screenshot was appropriate here. It wasn't there to "lazily copy the code", the code is from QWidget.cpp that is available online. By pasting a screenshot, I wanted to show the stack trace and values of d->focus_prev and d->focus_next. I believe doing so in a non-screenshot manner would create a mess. – Danol Jul 12 '18 at 23:30
  • I think that error is caused by another part of your code. – eyllanesc Jul 12 '18 at 23:32
  • I think in the most time [MCVE](https://stackoverflow.com/help/mcve) is not only the way to demonstrating the problem. it also helps you find the problem by yourself when you minimize & trying to recreate a small demo to reproduce the error. – JustWe Jul 13 '18 at 01:03
  • I was not opposing the MCVE, just reacting to the complaint that I pasted a screenshot. However, since I've at least found a workaround and it doesn't seem to me the bug is in my code, I won't be investigating it further for now, at least not until I encounter the bug again. – Danol Jul 13 '18 at 09:25

1 Answers1

1

Related bug report with example: https://bugreports.qt.io/browse/QTBUG-68393?attachmentOrder=desc

Looks like a Qt bug related with QTabWidget tab order. Found a workaround where setting the QTabWidget focusPolicy to NoFocus removed the crash.

Danol
  • 368
  • 1
  • 15