Results 1 to 12 of 12

Thread: Problem with graphics in Qt embedded Linux

  1. #1
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Problem with graphics in Qt embedded Linux

    Welcome everyone. I couldn't find anything on the forum, so here is my problem. Writing software in Qt for embedded Linux 4.4.3 environment I came across following problem. The application contains quite much graphics, that is drawn on the screen by using a function drawImage(). All looks nice and neatly. However, to improve performance (since the software is being written for not fast processor), we started to load QPixmaps (managed with QWS) and draw them using drawPixmap(QPoint&, QPixmap&). Nevertheless some of the graphics are drawn in a wrong way - some assembles of pixels are not drawn at all, or are white. Moreover this is not a fault of graphic files itself, since if these images are shifted by few pixels, they are correct. Also, the same program compiled and run on Win XP or Mac OS X looks fine. Maybe some of You experienced similar problem or has any idea for overcoming it. We would like to use QPixmaps since they indeed get better performance.



    Qt for Embedded Linux 4.4.3
    QWindowsServer
    graphic files PNG (not scaled in the program)
    libQtCore.so.4.4.3
    libQtGui.so.4.4.3


    Thanks in advance for any help!
    Chris.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with graphics in Qt embedded Linux

    What's the device? Do you experience the same problems while running the application on Desktop Linux and/or a simulator?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: Problem with graphics in Qt embedded Linux

    Hi,

    the QPaintDevice is just custom widget and the hardware device is my custom device based on ARMv4T processor, with LCD display.
    If You have any clues, please say them because I'm eating my teeth on that.

    Best regards,
    Chris.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with graphics in Qt embedded Linux

    I'd suspect a problem with the frame buffer. Does this happen only when you paint pixmaps or when you paint anything at all? What happens if you paint a solid black and solid colour (red? blue?) pixmap? Do the artifacts appear?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: Problem with graphics in Qt embedded Linux

    Hello,

    these things work correct. When I print into QPixmap (using QPainter) those rectangles (black, white and red) and then those pixmaps onto the screen, all is fine. Any suggestions?

    Thank You so much for help and being interested.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with graphics in Qt embedded Linux

    Maybe a colour you are using is interpreted as transparent by the device?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: Problem with graphics in Qt embedded Linux

    But the same graphics, when shifted by few pixels, is shown correct.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with graphics in Qt embedded Linux

    But if different graphics display fine without shifting, the thing has to be dependent on the content of the graphics (or something completely different). Is the effect random or repeatable?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: Problem with graphics in Qt embedded Linux

    This effect is repeatable in 100%. If we draw the same graphic in the same place, then that error occurs and looks the same (even after n-th compilation). And why it should be due to graphic images displayed? When it was printed with drawImage() everything was ok.

    What do You think, maybe this is the fault of version 4.4.3 and the update to 4.5.x would help in our case?

    Thanks

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with graphics in Qt embedded Linux

    Quote Originally Posted by Krzysztow View Post
    What do You think, maybe this is the fault of version 4.4.3 and the update to 4.5.x would help in our case?
    I don't think so but you can try it anyway. I'm out of ideas so better that than nothing. By the way, drawImage converts the image to a pixmap and draws that so the effect should be identical.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Jul 2009
    Posts
    26
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Windows

    Default Re: Problem with graphics in Qt embedded Linux

    Anyway, thank You for Your ideas.

    The update itself is quite costly, so it may be done only if the problem is solved.

    Images that are drawn are PNGs and lately we also tried to convert them to BMPs. It helped but not completely, there is a smaller amount of these bunches of bad pixels.

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Problem with graphics in Qt embedded Linux

    This further suggests the issues are colour-related. Once you start drawing, it doesn't matter what the original file format of the image was. Try creating images with different gradients and try to spot if the artifacts are consistant with the direction of the gradient. Create the gradient images directly in your application - don't load them from files.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Font Problem Porting from Windows to Linux
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2007, 11:25
  2. Linux Framebuffer Test Problem
    By jefflg in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 19th May 2007, 08:06
  3. graphics view FitInView problem
    By aamer4yu in forum Qt Programming
    Replies: 6
    Last Post: 25th January 2007, 11:24
  4. Problem in porting Main window on linux
    By jyoti kumar in forum Qt Tools
    Replies: 2
    Last Post: 2nd June 2006, 09:35
  5. problem of porting from windows to linux
    By jyoti kumar in forum Qt Programming
    Replies: 4
    Last Post: 22nd May 2006, 09:42

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.