Results 1 to 3 of 3

Thread: How to draw rubber band using XOR

  1. #1
    Join Date
    Dec 2006
    Posts
    426
    Thanks
    8
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default How to draw rubber band using XOR

    Hi,

    I remember I can create rubber band of various shapes (not just line or rectangle) using XOR in Qt3, now in Qt4 we have QRubberBand, but it only provides line and rectangle shapes.

    How can I create rubber band of various shapes (such as polygon, etc.) the same way as in Qt3?

    I am using Qt Graphics View Framework...

    Thanks

  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: How to draw rubber band using XOR

    Using the same way - you can't, as drawing is only allowed in paint events. But you can draw a rubber band of any shape in general. Just do it during a proper event call (or use a dedicated graphics item).
    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
    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: How to draw rubber band using XOR

    XOR mode has been reintroduced with Qt 4.5. So on platforms, where Qt::WA_PaintOutsidePaintEvent is supported ( X11) you can use it like with Qt3. On platforms like Windows you can post a dummy paint event, catch it using an event filter and paint there.

    Uwe

Similar Threads

  1. Replies: 6
    Last Post: 21st September 2009, 10:55
  2. partly draw in textEdit.
    By gikidy in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2009, 18:43
  3. Use delegate to draw different type of items
    By nifei in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2009, 13:16
  4. want to draw points in QGraphicsScene
    By ntp in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2008, 18:14
  5. Using QGLWidget paint engine to draw regular widgtes?
    By high_flyer in forum Qt Programming
    Replies: 11
    Last Post: 9th October 2006, 12:06

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.