代码如下:
Q_Widget * dlgRight = new Q_Widget(NULL);
QDesktopWidget *deskTop=QApplication::desktop();
auto deskRect=deskTop->availableGeometry();
QPoint normalPoint;
normalPoint.setX(deskRect.width()-dlgRight->width()-1);
normalPoint.setY(deskRect.height()-dlgRight->height());
dlgRight->setGeometry(normalPoint.x(),normalPoint.y(),dlgRight->width(),dlgRight->height());
dlgRight->show();
- 实现效果:
dlgXXX的窗体在右下方放置