Results 1 to 8 of 8

Thread: QwtDial: how to move drawing of the scale to the edges ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2012
    Posts
    63
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    5

    Default Re: QwtDial: how to move drawing of the scale to the edges ?

    Quote Originally Posted by Uwe View Post
    Of course it is, but the code for the scales is a couple of years older ( written for QwtKnob ) than QwtDial and I took what was available at that time.



    The difficult part is the layout code to avoid, that tick labels overlap ( sizeHint ... ) - usually a dial has more than only 1-2 labels like in your example. Note that QwtRoundScaleDraw is also used in the qwtpolar package.

    If you have something useful please upload a patch to: http://sourceforge.net/p/qwt/patches/?source=navbar

    Uwe
    I had a few minutes to look at this. It is not perfect. But starting to look quite allright for my purposes. For ticks code I just changed radius to radius - len( tick length from argument). Labels are harder. In drawLabel I'm just estimating radius (radius = radius - ticklen(MajorTick)*3. Sorry, Uwe I'm abusing your beautiful code It's not that easy to calculate correct radius. Font size should be taken into account too..

    Where is this white arc drawn that follows ticks? It might look better if I could remove it ?


  2. #2
    Join Date
    Jun 2012
    Posts
    63
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    5

    Default Re: QwtDial: how to move drawing of the scale to the edges ?

    Quote Originally Posted by phenoboy View Post
    Where is this white arc drawn that follows ticks? It might look better if I could remove it ?
    Found it. It's the drawBackbone function.

Similar Threads

  1. Graph (nodes, edges) Drawing in Qt
    By Sabbir in forum Qt Programming
    Replies: 2
    Last Post: 20th February 2018, 07:50
  2. QwtDial label
    By lvsteenson in forum Qwt
    Replies: 1
    Last Post: 21st December 2012, 08:17
  3. Graphics View: Drawing Items that don't scale
    By Disperato in forum Qt Programming
    Replies: 5
    Last Post: 6th July 2009, 17:16
  4. Refresh axis scale drawing
    By jmsbc in forum Qwt
    Replies: 1
    Last Post: 14th June 2009, 14:45
  5. QWTDial problem
    By zaferaltug in forum Qwt
    Replies: 2
    Last Post: 20th November 2008, 15:40

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.