Sunday, July 6th 2008, 4:47pm UTC+1

You are not logged in.

  • Login
  • Register

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: 26

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