/*! Find the sibling screen corresponding to \a globalPos. Returns this screen if no suitable screen is found at the position. */ const QPlatformScreen *QPlatformScreen::screenForPosition(const QPoint &point)const { if (!geometry().contains(point)) { constauto screens = virtualSiblings(); for (const QPlatformScreen *screen : screens) { if (screen->geometry().contains(point)) return screen; } } returnthis; }
我们可以看到,注释和代码里都提到了一个词:sibling
来看一下Qt文档的解释
1 2 3 4
QList<QScreen *> QScreen::virtualSiblings()const //Get the screen's virtual siblings.
//The virtual siblings are the screen instances sharing the same virtual desktop. They share a common coordinate system, and windows can //freely be moved or positioned across them without having to be re-created.