子窗口 停靠

子窗口 停靠
 QRect rectWorkArea = qApp->desktop()->availableGeometry();
 QPoint ptLeftTop = geometry().topRight() + QPoint(2, 0);
 QSize sizeSettingsWindow = m_pSettingsWindow->size();
 if(ptLeftTop.x() + sizeSettingsWindow.width() > rectWorkArea.right())
  ptLeftTop.setX(rectWorkArea.right() - sizeSettingsWindow.width());
 m_pSettingsWindow->move(ptLeftTop);

你可能感兴趣的:(子窗口 停靠)