Thursday, August 28th 2008, 5:03pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

jkelly

Beginner

Posts: 6

Location: singapore

Occupation: student

1

Wednesday, May 7th 2008, 2:43am

codes to draw nodes and lines

hi, is there any code to draw nodes and lines using QT3? i need a simple GUI with 3 nodes connected to each other by lines.

thanks
please help me, i'm only a student.. ..
  • Go to the top of the page

stinny

Beginner

Posts: 28

Location: Prague

Occupation: CS student

2

Wednesday, May 7th 2008, 11:37am

RE: codes to draw nodes and lines

QGraphicsScene is here for You.
  • Go to the top of the page

jkelly

Beginner

Posts: 6

Location: singapore

Occupation: student

3

Thursday, May 8th 2008, 9:30am

hi, what is QGraphicsScene? How do i use it? is that any sample codes for me to see? i need to draw a line first.

thanks
please help me, i'm only a student.. ..
  • Go to the top of the page

4

Thursday, May 8th 2008, 10:01am

create a QGraphicsScene

create a QGraphicsView
attach it to the scene

create a QGraphicsLineItem
add it to the scene

create a node (QGraphicsRectItem, QGraphicsEllipseItem, or what you want)
give him the line item as parentItem
position it at the end of the line item

...

have a look at examples/graphicsview/... examples
and QGraphics* classes documentation
Nicolas
  • Go to the top of the page

Rate this thread