[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: QGLWidget in a KDE application : no full-scene anti-aliasing
From:       Benoît_Jacob <jacob () math ! jussieu ! fr>
Date:       2008-04-08 15:51:41
Message-ID: 200804081751.46380.jacob () math ! jussieu ! fr
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Problem solved. For anyone interested, the solution consists in moving the 
lines

     QGLFormat defFormat = QGLFormat::defaultFormat();
     defFormat.setSampleBuffers(true);
     QGLFormat::setDefaultFormat(defFormat);

from the KPart's constructor to the main() function.

I am not sure why this is what was needed:
- does that mean it's not possible to set application-wide settings (such as 
the app's default GL format) from inside a KPart?
- is it because that KPart is embedded inside a dialog and that setting has to 
be set before the dialog itself is created?

Carsten: perhaps you know a better place than main() for this.

Cheers,

Benoît

On Monday 07 April 2008 13:50:10 Benoît Jacob wrote:
> Hi,
>
> In both KDE 4.0 and trunk, in Kalzium's molecule viewer, we can't get
> full-scene antialiasing.
>
> We use a Avogadro::GLWidget class from a library, libavogadro.
> Avogadro::GLWidget inherits QGLWidget. In Avogadro, a pure-Qt application,
> we do get full-scene antialiasing. When we use the same Avogadro::GLWidget
> class in Kalzium, we don't get antialiasing.
>
> Here is how Kalzium creates its Avogadro::GLWidget:
>
>     // use multi-sample (anti-aliased) OpenGL if available
>     QGLFormat defFormat = QGLFormat::defaultFormat();
>     defFormat.setSampleBuffers(true);
>     QGLFormat::setDefaultFormat(defFormat);
>     m_widget = new KalziumGLWidget();
>
> where KalziumGLWidget is a subclass of Avogadro::GLWidget. (see this file:
> /trunk/kdeedu/kalzium/compoundviewer/kalziumglpart.cpp)
>
> So, do you know what's preventing us from getting antialiasing? Is
> QGLFormat::setDefaultFormat overrid by some KDE setting?
>
> Cheers,
>
> Benoit



["signature.asc" (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic