How to set QPoint variable as a global variable?
I want to set a
QPoint variableas a
global variablesuch that it can be accessible and changeable from 3
I tried creating a new
globalsas shown below
#ifndef GLOBALS_H #define GLOBALS_H //#include <QPoint> extern QPoint firstPoint , secondPoint; #endif // GLOBALS_H
#include "globals.h" #include <QPoint> QPoint firstPoint = 0; //(0,0); QPoint secondPoint = 100; //(10,10);
if i include
this is the error
conversion from 'int' to non-scalar type 'QPoint' requested
if i do not include
QPoint does not name a type
Does anyone know whats wrong in this and how to add a global variable in any other method?
This may help:
Essentially, you don't want the definition to be defined as 'int' zero. Instead:
QPoint firstPoint = QPoint(0,0,);
Hope this helps.
@Carmoneer Thats the perfect solution
Thanks a lot... :)