Results 1 to 9 of 9

Thread: Qt Graphics

  1. #1
    Join Date
    Jul 2009
    Posts
    49
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Qt Graphics

    Hi all,

    I am working on qt form past 6 months but i am new to qt graphics.

    I need to draw the circle,line in 2D cartesian coordinate system.

    Whether to use Qpainter or Qcanvas or opengl?

    which one will be the better to getting started with qt graphics?

    Anyone can help me out asap.

    Thanks & Regards,
    soumya

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt Graphics

    1. The canvas is obsolete.
    2. OpenGL is huge thing for such a small graphics operation.
    3. The Graphics View Framework is based on the Cartesian coordinate system. So this is best suitable.

  3. #3
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Graphics

    If your work involves only painting,, and not moving objects,,,you can consider using QWidget also. You have QPainter in paintEvent and rest you code

  4. #4
    Join Date
    Jul 2009
    Posts
    49
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt Graphics

    Hi,

    Thanks for the reply.

    I am using qt3.3 i need to draw the coordinate system on the qframe

    whether it can be done using qpainter?

    Thanks & regards,
    soumya

  5. #5
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qt Graphics

    Yes !!
    Coz QFrame is derived from QWidget.

  6. #6
    Join Date
    Jul 2009
    Posts
    49
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt Graphics

    hi,

    Can u just send me the link to get started with

    the "The Graphics View Framework" for qt3.3
    Last edited by soumya; 19th August 2009 at 11:20.

  7. #7
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Graphics

    u are using qt 3.3
    so QGraphicsView is not supported ...

    here the link
    http://doc.trolltech.com/4.2/graphicsview.html
    Last edited by wagmare; 19th August 2009 at 11:22.
    "Behind every great fortune lies a crime" - Balzac

  8. #8
    Join Date
    Jul 2009
    Posts
    49
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Qt Graphics

    I have attached the .png file i need to make a graphics similar to that in qt-3.3.

    How this can be implemented.
    Attached Images Attached Images

  9. #9
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qt Graphics

    QGraphics wont support in qt 3.3 ...

    so u have to use QPainter to design the above
    and the dial movement u can refer
    http://doc.trolltech.com/4.2/widgets-analogclock.html ..

    and scale value check the plotter example in

    C++ GUI Programming with Qt 4, Second Edition
    by Jasmin Blanchette; Mark Summerfield

    chapter 05 ...
    "Behind every great fortune lies a crime" - Balzac

Similar Threads

  1. Problem with graphics in Qt embedded Linux
    By Krzysztow in forum Qt for Embedded and Mobile
    Replies: 11
    Last Post: 29th July 2009, 10:59
  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.