以下代码可以使窗口显示在桌面右下角
// Get the size of screen
QDesktopWidget* desktop = QApplication::desktop();
int desktopWidth = desktop->width();
int desktopHeight = desktop->height();
//move the dialog
move((desktopWidth - width()), (desktopHeight -height()));
以上的代码在Linux下显示没有问题,在Windows下却有一部分被遮住!
即使用
//move the dialog
move((desktopWidth - frameGeometry().width()), (desktopHeight -frameGeometry().height()));
也是一样!
因为在Windows下它是从整个屏幕右下角算起的!而不是从任务栏上方算起的!
请教各位有什么办法使它正常显示在右下角的任务栏上方?