Results 1 to 5 of 5

Thread: Drawing an Arrow in QT

  1. #1
    Join Date
    Sep 2011
    Posts
    51
    Thanks
    2
    Qt products
    Qt4

    Default Drawing an Arrow in QT

    Hy all,

    i've to draw an arrow.

    i've the starting point and end point.

    No problem to draw the segment, but no ideas to insert arrow head.

    How can i add an arrow head to a segment ?

    Thanks Gabriele

    I try to search on Google but i did not find any code....

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,243
    Thanks
    303
    Thanked 866 Times in 853 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Drawing an Arrow in QT

    Maybe you didn't Google hard enough. Try this. It isn't Qt, but what you need is a lesson in geometry - one you understand how the math works, then it is simple to translate the drawing code into the equivalent QPainter method calls.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. The following user says thank you to d_stranz for this useful post:

    TheIndependentAquarius (10th March 2015)

  4. #3
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Drawing an Arrow in QT

    Quote Originally Posted by d_stranz View Post
    Maybe you didn't Google hard enough.


    Didn't even have to Google. Qt examples: Diagram Scene

  5. The following 2 users say thank you to norobro for this useful post:

    d_stranz (3rd September 2012), TheIndependentAquarius (10th March 2015)

  6. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,243
    Thanks
    303
    Thanked 866 Times in 853 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Drawing an Arrow in QT

    Qt examples: Diagram Scene
    yeah, mo' better.

  7. #5
    Join Date
    Sep 2011
    Posts
    51
    Thanks
    2
    Qt products
    Qt4

    Smile Re: Drawing an Arrow in QT

    Ok..thanks to all i will study the examples you give me !!!

Similar Threads

  1. QScrollBar up-down arrow icon
    By zgulser in forum Qt Programming
    Replies: 5
    Last Post: 1st April 2010, 13:13
  2. Removing down-arrow
    By zgulser in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2009, 09:55
  3. QScrollBar arrow display
    By sgg245 in forum Qt Programming
    Replies: 2
    Last Post: 16th February 2009, 07:57
  4. QScrollBar arrow display
    By sgg245 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 16th February 2009, 07:36
  5. arrow button
    By boss_bhat in forum Qt Programming
    Replies: 3
    Last Post: 5th June 2006, 13:16

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.