Results 1 to 3 of 3

Thread: Qt drawable surface problems going from Qt4 to Qt5

  1. #1
    Join Date
    Aug 2014
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Qt drawable surface problems going from Qt4 to Qt5

    Hello,

    I'm currently trying to port a widget created in Qt4 to Qt5. The widget is using third party libraries that require a handle to a x11 drawable surface, in Qt4 it was done by the widget being a subclass to QLabel and by letting it have a QPixmap::Handle(). In Qt5 this function has been removed from QPixmap and I have been trying to find a way around this.

    The only solution that I have found is to take the QWidget::winId() from the widget itself and use that as the required handle.
    That works and as long as I use setAttribute( Qt::WA_PaintOnScreen, true ) on the widget, but after I do that every change in the drawing is always one step behind what it's actually supposed to be showing and it doesn't update until I redraw it the next time.

    Is there some difference between using the old QPixmap::Handle() from QWidget::winId() that could cause the delayed drawing?
    It seems like if I don't use setAttribute( Qt::WA_PaintOnScreen, true ), then it fights with Qt for drawing to that surface but then it is not delayed anymore. Is there something else I should do after setting this attribute to make it update correctly?

    I would greatly appreciate any help I could get with this.

  2. #2
    Join Date
    Jul 2015
    Posts
    1
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11

    Default Re: Qt drawable surface problems going from Qt4 to Qt5

    Hi, which 3rd party library did you use? I'm trying to paint using libcairo but with no luck.

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Qt drawable surface problems going from Qt4 to Qt5

    Maybe you can make libcairo draw into a pixel buffer and the use QImage on that buffer to draw the image into the widget?

    Cheers,
    _

Similar Threads

  1. Qt3D Cube, No surface texture but with edges, how to?
    By jiapei100 in forum Qt Programming
    Replies: 0
    Last Post: 23rd February 2013, 18:15
  2. Qt 4.7.1 DirectFB surface not released?
    By djstava in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd November 2011, 06:36
  3. Replies: 13
    Last Post: 21st September 2010, 15:12
  4. Replies: 0
    Last Post: 7th March 2010, 13:13
  5. opengl bezier surface
    By zorro68 in forum Qt Programming
    Replies: 6
    Last Post: 22nd February 2007, 17:44

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.