Results 1 to 3 of 3

Thread: QGLWidget : changing anti aliasing during run time

  1. #1
    Join Date
    Oct 2010
    Posts
    95
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QGLWidget : changing anti aliasing during run time

    Hi,

    I have anti-aliasing in my QGLWidget, I set it the following way :
    Qt Code:
    1. GLViewport(QWidget *parent) : QGLWidget(QGLFormat(QGL::SampleBuffers), parent) ...
    To copy to clipboard, switch view to plain text mode 

    Later I try to change the format this way:
    Qt Code:
    1. QGLFormat currentFormat = format();
    2. currentFormat.setSampleBuffers(true);
    3. currentFormat.setSamples(0);
    4. setFormat(currentFormat);
    To copy to clipboard, switch view to plain text mode 

    It has 2 effects :

    1) it does not work
    2) the mouse event are never called after this change !

    Does someone have an idea ?

  2. #2
    Join Date
    Oct 2010
    Posts
    95
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGLWidget : changing anti aliasing during run time

    Nobody know ?

  3. #3
    Join Date
    Aug 2011
    Location
    Seoul, Korea
    Posts
    46
    Thanks
    9
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGLWidget : changing anti aliasing during run time

    Quote Originally Posted by pl01 View Post
    Hi,

    I have anti-aliasing in my QGLWidget, I set it the following way :
    Qt Code:
    1. GLViewport(QWidget *parent) : QGLWidget(QGLFormat(QGL::SampleBuffers), parent) ...
    To copy to clipboard, switch view to plain text mode 

    Later I try to change the format this way:
    Qt Code:
    1. QGLFormat currentFormat = format();
    2. currentFormat.setSampleBuffers(true);
    3. currentFormat.setSamples(0);
    4. setFormat(currentFormat);
    To copy to clipboard, switch view to plain text mode 

    It has 2 effects :

    1) it does not work
    2) the mouse event are never called after this change !

    Does someone have an idea ?
    Hi,

    When you said "it does not work", you mean multisampling is not working or something else?

    The mouse event part is also bit weird. I don't think they are related each other, are they?
    Try to use setMouseTracking(true) within the GLViewport.

    Regards,
    Dong Back Kim

Similar Threads

  1. Replies: 1
    Last Post: 21st August 2008, 08:29
  2. Replies: 0
    Last Post: 7th April 2008, 14:27
  3. changing files lastmodified time
    By ramazangirgin in forum Qt Programming
    Replies: 2
    Last Post: 27th March 2008, 10:04
  4. Replies: 1
    Last Post: 8th May 2006, 07:07
  5. Replies: 6
    Last Post: 17th March 2006, 17:48

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.