Sunday, July 6th 2008, 4:48pm 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.

1

Wednesday, May 7th 2008, 6:17pm

QGraphicsLineItem

Hi everyone,

I'm new to this forum. I'm using Qt 4 in Windows and I'm having trouble building a basic GUI that uses the QGraphicsScene class.

I declared a pointer as

QGraphicsLineItem *verLine;

and tried to implement it with

verLine = new QGraphicsLineItem(this);

But when I compile the application I get the following error:

gdisplay.cpp: In constructor `GDisplay::GDisplay(QWidget*)':
gdisplay.cpp:19: error: invalid use of undefined type `struct QGraphicsLineItem'
../../../../Qt/4.3.4/include/QtGui/../../src/gui/graphicsview/qgraphicsscene.h:68: error: forward declaration of `struct QGraphicsLineItem'

Can someone tell what I'm doing wrong from this?

Thank you,

Dante
  • Go to the top of the page

stinny

Beginner

Posts: 26

Location: Prague

Occupation: CS student

2

Wednesday, May 7th 2008, 7:34pm

RE: QGraphicsLineItem

Try adding

Source code

1
#include <QGraphicsLineItem>
to the source file.
  • Go to the top of the page

3

Wednesday, May 7th 2008, 9:52pm

RE: QGraphicsLineItem

That worked, thanks!
  • Go to the top of the page

Rate this thread