pratik041
21st November 2011, 06:06
we have a class
class custom::public QObject
{
Q_OBJECT
public:
custom(QWidget *parent)
{
}
bool event (QEvent *e)
{
//get cursor position.
}
};
suppose we have the above child class. Inside child class event how can we get cursor position irrespective of whether the cursor is on the parent or on the other child of same parent. I have inherited from QObject because i dont want to create any widget in this class just i want to know cursor position to handle other objects.
class custom::public QObject
{
Q_OBJECT
public:
custom(QWidget *parent)
{
}
bool event (QEvent *e)
{
//get cursor position.
}
};
suppose we have the above child class. Inside child class event how can we get cursor position irrespective of whether the cursor is on the parent or on the other child of same parent. I have inherited from QObject because i dont want to create any widget in this class just i want to know cursor position to handle other objects.