Results 1 to 16 of 16

Thread: QRubberBand problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QRubberBand problem

    I can try, but there are all kind of things that can play in to this.
    I will try the simple stuff first.
    Show the implementation of the constructor.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  2. #2
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QRubberBand problem

    thanks for your help high_flyer ,

    to be honest i just trying to figur out using of RubberBand on simply GLWidget, so there is no code at ctor,

  3. #3
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QRubberBand problem

    I really stuck with refresh CustomWidgets content, could you help figure out this ?

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QRubberBand problem

    I mean the ctor of your QGLWidget implementation.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QRubberBand problem

    hi, high_flyer ;

    As i said before for moment there is no code at ctor. I'm just trying using QRubberBand on QGLWidget so there is problem as you noticed QGLWidget doesn't refresh itself and there is problem like flooding QRubberBand, can i use QRubberBand on QGLWidget actually i wanna know this atm ... Thanks for your interest ...

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QRubberBand problem

    Ok, so it means you have default flags on it - but then I don't know why its not getting updates when you drag the rubber band on it.
    You can try sub classing QRubberBand, and override the resizeEvent() and send a signal from it.
    And in your QGLWidget, intercept that signal, and call update().
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  7. #7
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QRubberBand problem

    Thanks for advice high_flyer, i've actually tried bind a pushbutton clicked signal with qglwidget its , update and repaint slots but it doesn't any effect, i even tried custom rubberband which derived form Qrubberband override paint events also it's not working too =) , so let me know is it possible to use QRubberBand on QGLWdiget or not ?

  8. #8
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QRubberBand problem

    is it possible to use QRubberBand on QGLWdiget or not ?
    It must be possible, since QGLWidget is a QWidget.

    I don't know what it is you are doing wrong, based on the information you provided so far...

    Try to make a test project where you only have a widget and QRubberBand drawn on it.
    Once you get it to work there, try comparing between that and you QGLWidget usage of QRubberBand.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Change the color of QRubberBand
    By franco.amato in forum Qt Programming
    Replies: 14
    Last Post: 4th August 2011, 16:30
  2. How to draw QRubberBand with red color
    By lni in forum Qt Programming
    Replies: 15
    Last Post: 10th March 2010, 09:49
  3. Use of QRubberBand
    By lni in forum Qt Programming
    Replies: 0
    Last Post: 21st April 2009, 12:59
  4. slightly more advanced QRubberBand
    By momesana in forum Qt Programming
    Replies: 0
    Last Post: 4th November 2008, 01:00
  5. Using QRubberBand class?!?!?
    By nupul in forum Newbie
    Replies: 3
    Last Post: 1st April 2006, 17:19

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.