Results 1 to 8 of 8

Thread: drawing contours

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    101
    Thanked 15 Times in 15 Posts

    Default Re: drawing contours

    If you have so many little spline pieces, maybe you could replace the cubicTo() call with a lineTo() call without a noticeable visual difference?

  2. #2
    Join Date
    Jul 2017
    Posts
    37
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: drawing contours

    It's very noticeable when magnified. Should I check how far a spline is from straight, in window coordinates, and substitute a line if it isn't?

  3. #3
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    101
    Thanked 15 Times in 15 Posts

    Default Re: drawing contours

    I am not sure. The code could become cumbersome for not much speedup. I think the most promising next step would be to cache the QPainterPath so that you only have to paint it and not regenerate it. You could use an OpenGL environment to do your drawing so that you can cache everything and only need to modify the painter or view transformation. There is a QOpenGLWidget that might come in handy. Then there is the QGLViewer library, just google it.

Similar Threads

  1. Replies: 1
    Last Post: 7th November 2017, 07:11
  2. Replies: 3
    Last Post: 11th July 2014, 14:45
  3. Qt Drawing
    By Talguy in forum Newbie
    Replies: 4
    Last Post: 12th January 2011, 04:14
  4. 2D drawing
    By WXNSNW in forum Qt Programming
    Replies: 3
    Last Post: 5th October 2010, 23:01
  5. Drawing
    By chethana in forum Qt Programming
    Replies: 1
    Last Post: 16th October 2007, 06:29

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