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.
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
RE: QGraphicsLineItem
Try adding
|
Source code
|
1
|
#include <QGraphicsLineItem>
|
to the source file.
RE: QGraphicsLineItem
That worked, thanks!