在mainwindow中创建并设置了Qmdiarea,
创建一个QWidget子类 附加到QSubwindow中添加到QMdiarea中
Form *form = new Form();
QSubWindow *subWindow = new QSubWindow();
subWindow->setWidget(form);
QMdiarea->addSubWindow(subWindow);
QRect = form->Geometry();此时得到的结果是,0,0,200,200
在form中我重写了mousePressEvent();事件,
void Form::mousePressEvent(QMouseEvent * event)
{
QRect rect = this->Geometry();//但是此时得到的form坐标是4,30,200,200
QWidget::mousePressEvent(event);
}
我想肯定是有相对坐标在作怪,那么我如何统一管理那,在form的内部包括mousePressEvent中想得到
QRect 为0,0,200,200
有可能吗?