Results 1 to 7 of 7

Thread: A less demanding rubberband wanted

  1. #1
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default A less demanding rubberband wanted

    When I pull the rubberband over a graphicsview that contains a lot of items, the items inside the rubberband are redrawn as I move the mouse, and this makes the rubberband get stuck mometarily.
    How can I prevent this?
    In simpler systems, a rubberband was just making a line box using 'reverse' draw mode twice, leaving the image behind it untouched. This would not require any usage of the scene data.
    Is there a similar built-in function in Qt?
    It is not clear to me how to do this 'manually'.
    MacOSX user dabbling with Linux and Windows.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: A less demanding rubberband wanted

    I suppose you could change the style of the rubberband widget.
    J-P Nurmi

  3. #3
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: A less demanding rubberband wanted

    Quote Originally Posted by bnilsson View Post
    In simpler systems, a rubberband was just making a line box using 'reverse' draw mode twice, leaving the image behind it untouched. This would not require any usage of the scene data.
    Is there a similar built-in function in Qt?
    Painting in XOR mode is not possible in Qt4 anymore - one of substantial things, that are gone with the new graphics pipeline of Qt4.

    The Trolls thought that modern hardware is ( or will be ) fast enough to do rubberbanding by repaints. On my low budget notebook early Qt4 releases were not and even today its sometimes tricky to get repaints fast enough for the rubberband.

    Obviously the repaints of your scene are too slow and you need to find out how to speed them up.

    Uwe

    PS: You can try to use QwtPicker from the Qwt package. It implements a rubberband as a masked widget on top of your widget. But in the end your widget also needs to be fast enough to repaint the area below the previous position of the rubberband.

  4. #4
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: A less demanding rubberband wanted

    Ok, it seems this will be a showstopper for me using rubberband.
    If I want to zoom in covering an area containing millions of items, it just won't work.
    It looks more and more like I have to abandon Qt and go back to wxWidgets, as much as I would hate it.
    MacOSX user dabbling with Linux and Windows.

  5. #5
    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: A less demanding rubberband wanted

    Quote Originally Posted by bnilsson View Post
    Ok, it seems this will be a showstopper for me using rubberband.
    If I want to zoom in covering an area containing millions of items, it just won't work.
    You can manually turn off repainting for a short period of time. You can even grab a pixmap of your view and draw the pixmap instead of the items during rubberbanding. This way it'll be very fast. Once you release the mouse button, stop drawing the pixmap and let the graphics view handle the rest.

  6. #6
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Thanks
    37
    Thanked 53 Times in 40 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: A less demanding rubberband wanted

    Quote Originally Posted by wysota View Post
    You can manually turn off repainting for a short period of time. You can even grab a pixmap of your view and draw the pixmap instead of the items during rubberbanding. This way it'll be very fast. Once you release the mouse button, stop drawing the pixmap and let the graphics view handle the rest.
    Where do you manage to get those witty ideas man ?
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

  7. #7
    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: A less demanding rubberband wanted

    Quote Originally Posted by Gopala Krishna View Post
    Where do you manage to get those witty ideas man ?
    Deep space

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.