di_zou
14th October 2009, 22:38
In the Draggable Icons examples, there is a mouse press event with this code:
void DragWidget::mousePressEvent(QMouseEvent *event)
{
QLabel *child = static_cast<QLabel*>(childAt(event->pos()));
...
}
How would I change it so that I can determine what class the object childAt(event->pos()) is? I looked at the QWidget documentation, and I couldn't find a function similar to something like getClass() or getObjectType(). Any help would be appreciated.
void DragWidget::mousePressEvent(QMouseEvent *event)
{
QLabel *child = static_cast<QLabel*>(childAt(event->pos()));
...
}
How would I change it so that I can determine what class the object childAt(event->pos()) is? I looked at the QWidget documentation, and I couldn't find a function similar to something like getClass() or getObjectType(). Any help would be appreciated.