Important: Please read the Qt Code of Conduct -

Debugging paint event = segmentation fault?

  • I've been trying to debug a QWidget paint event, nothing too fancy, just a rectangle being filled, and I keep on getting segmentation fault errors. I am using Creator and Qt 4.8.0. Any ideas?

  • I would not expect that the paint event while debugging is the source of your problem. It is more likely that there has been something messed up before the actual paint event. Some kind of a pointer error. Certainly something you need to worry about.
    If the paint event is at the beginning, there could be something with the initialization of some static classes.
    If the fault comes up later during execution, you may want to move it forward. Unfortunately, you may not see a fault, but the source of the problem is still before this execution step.
    Using different tools, such as profilers, may help or provide a hint.

  • It is not even a project, it is just a single widget with nothing but a paint event that fills a rectangle. The widget itself runs just fine, but any attempt to debug it ends up in a segmentation fault signal from the OS.

  • Still sounds strange. Setting a breakpoint in the paint event may cause the program to stop a lot and not update, but not to crash.

    Maybe you can post a backtrace along with some snippets of your code?

Log in to reply