Results 1 to 4 of 4

Thread: Qt-Graphics

  1. #1
    Join Date
    Jul 2009
    Location
    Bangalore
    Posts
    68
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Qt-Graphics

    Hi All,

    I need to draw a circle which is shown in the attachments, the user will input the center(x, y) and radius from QlineEdits and when the enter key is pressed circle has to draw on a frame for the following case:

    1. If the center(x, y) both are positive(refer circle.jpg)
    2. If the center(x, y) x=negative, y=positive(refer circle1.jpg)
    3. If the center(x, y) x=negative, y=negative(refer circle1.jpg)
    4. If the center(x, y) x=positive, y=negative(refer circle1.jpg)

    Note: the axis should be displayed.
    Even i read the assistant but i didn't get any idea. How to resolve this is issue.
    Attached Images Attached Images
    Thanks & Regards
    Sandeep G.R.

  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: Qt-Graphics

    So what's the problem? What is that you don't know how to do?
    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
    Jul 2009
    Location
    Bangalore
    Posts
    68
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt-Graphics

    I have drawn horizontal line and vertical line in QFrame using
    Qt Code:
    1. painter.drawLine(195,395,195,10);//horizontal line
    2. painter.drawLine(385,195,5,195);//vertical line
    To copy to clipboard, switch view to plain text mode 
    now the centre of the co-ordinate sytem is (195,195) .

    The circle center may be anything but it should fit in the co-ordinate system it may
    lie in the 1st,2nd, 3rd or 4th quadrant or may be in the centre.How do i proceed further??
    Thanks & Regards
    Sandeep G.R.

  4. #4
    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: Qt-Graphics

    I still don't get what the problem is... You don't know how to draw a circle? QPainter::drawEllipse() is used to do that.
    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.


Similar Threads

  1. Performance trouble in Graphics View
    By zgulser in forum Qt Programming
    Replies: 8
    Last Post: 14th September 2009, 22:11
  2. Learning 2D Graphics
    By ShaChris23 in forum Qt Programming
    Replies: 4
    Last Post: 23rd October 2007, 14:12
  3. Replies: 1
    Last Post: 5th March 2007, 20:50
  4. Adding Rectangular overlay on graphics view
    By forrestfsu in forum Qt Programming
    Replies: 10
    Last Post: 21st November 2006, 19:42

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.