Results 1 to 13 of 13

Thread: 2 Questions about QPainter

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: 2 Questions about QPainter

    Quote Originally Posted by SkripT
    Sorry wysota, could you tell me the name of this example, please?
    demos/composition.

  2. #2
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    44
    Thanked 2 Times in 2 Posts

    Default Re: 2 Questions about QPainter

    wysota I've been looking the demo and I've noticed two main differences: they dont' use begin and end and they don't' paint in the paintEvent method (I think). I dont' know if these are the causes for my code not to work. But anyway I've seen that they repaint all the image everytime to delete the "old circle". And here's my question: do you think that painting all in a buffer(they use a qImage) and later paint this buffer on the destination widget (like a double buffering) is faster that paint every object to be drawn directly on the destination widget?? Thanks
    Last edited by SkripT; 22nd February 2006 at 09:36.

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

    Default Re: 2 Questions about QPainter

    I think the reason may be that different platforms use different paint enigines and probably not all of them support composing. Probably that's why they used qImage, as it uses the raster engine which probably has composing capabilities built in. Otherwise the demo might not work on all systems. For example Windows uses the rastering engine by default too, while X11 uses PostScript and Mac uses QuickDraw. Additionaly some platform support may be needed for composite to work on different renderers (like the COMPOSITE extension to X11).

  4. #4
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    44
    Thanked 2 Times in 2 Posts

    Default Re: 2 Questions about QPainter

    Ok thanks a lot

  5. #5
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    44
    Thanked 2 Times in 2 Posts

    Default Re: 2 Questions about QPainter

    Hi again, relating with my first question, I think that's impossible to paint under a widget without clearing the background in the way that I want. I've tried different ways: setting transparent background, different composition modes, etc. but no success: everytime clears the background. The only solution is to paint again all the image everytime that the rubberband changes its position or size. But as you can see, this is very inefficient specially if the image has a big size. The problem is that the rubberband is painted with some delay since the mouse cursor and it's a bit annoying. I'm thinking in other solutions: does anybody knows a way to paint the image in background mode and in a specified fixed position and size like if it was permanently "painted" on the widget? So it releases of painting everytime the image. I think that a QLabel wouldn't be useful because it wouldn't be able to paint the rubberband under the label...
    Last edited by SkripT; 22nd February 2006 at 15:14.

Similar Threads

  1. QPainter update()
    By csvivek in forum Qt Programming
    Replies: 5
    Last Post: 24th March 2008, 09:42
  2. Memory management questions (im new to Qt)
    By scarvenger in forum Qt Programming
    Replies: 2
    Last Post: 6th May 2007, 07:41
  3. QPainter and QImage
    By beerkg in forum Newbie
    Replies: 3
    Last Post: 7th September 2006, 14:48
  4. Replies: 7
    Last Post: 20th March 2006, 20:03
  5. Qt related questions and thoughts about getting job
    By AlexKiriukha in forum General Discussion
    Replies: 4
    Last Post: 26th January 2006, 12:25

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
  •  
Qt is a trademark of The Qt Company.