Qt-jambi-interest Archive, February 2007
Uncaucht exceptions
Message 1 in thread
Hello. I got some exceptions from the QGraphicsView initialization which
printed this on stderr:
"QGLFramebufferObject: Unsupported framebuffer format.
QGLOffscreen: Invalid offscreen fbo (size 1024x1024)
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there."
Two questions arise:
1) How can I fix the GL settings. Here is my code now:
QGLWidget qglWidget = new QGLWidget();
qglWidget.setFormat(new QGLFormat(new
QGL.FormatOptions(QGL.FormatOption.SampleBuffers)));
setViewport(qglWidget);
2) How do I reimplement QApplication::notify()? I QApplication access
were static mostly?
Best regards,
Helge Fredriksen
Message 2 in thread
Helge Fredriksen wrote:
> Hello. I got some exceptions from the QGraphicsView initialization which
> printed this on stderr:
>
> "QGLFramebufferObject: Unsupported framebuffer format.
> QGLOffscreen: Invalid offscreen fbo (size 1024x1024)
> Qt has caught an exception thrown from an event handler. Throwing
> exceptions from an event handler is not supported in Qt. You must
> reimplement QApplication::notify() and catch all exceptions there."
This is actually a C++ exception being caught right here. You won't get
this in java.
> Two questions arise:
>
> 1) How can I fix the GL settings. Here is my code now:
>
> QGLWidget qglWidget = new QGLWidget();
> qglWidget.setFormat(new QGLFormat(new
> QGL.FormatOptions(QGL.FormatOption.SampleBuffers)));
> setViewport(qglWidget);
What I suspect happens here is that when anti-aliasing is enabled, we're
using a framebuffer object to do high-quality anti-aliasing. Are you
using antialiasing on this GL widget, via the QGraphicsView's renderhint?
We've seen some cases where older graphics drivers have had problems
with use of framebuffer objects which led to crashes. Upgrading to the
latest version has solved this problem.
In the main branch of Qt (not the Qt Jambi 4.3 branch) there is also the
option of switching between different techniques for doing antialiasing,
so one can switch between standard GL multisampling or our high-quality
antialiasing.
If the problem persists after upgrading the driver we would need some
more details on the hardware present so we hopefully can try to
reproduce here
> 2) How do I reimplement QApplication::notify()? I QApplication access
> were static mostly?
You should be able to reimplement QApplication and just call super(args)
from your subclass constructor.
Another alternative is to implement an eventFilter for the widgets that
you want to intercept events for.
-
Gunnar