本文整理汇总了C++中QPlatformIntegration::screens方法的典型用法代码示例。如果您正苦于以下问题:C++ QPlatformIntegration::screens方法的具体用法?C++ QPlatformIntegration::screens怎么用?C++ QPlatformIntegration::screens使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPlatformIntegration
的用法示例。
在下文中一共展示了QPlatformIntegration::screens方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
QPlatformScreen * QPlatformScreen::platformScreenForWidget(const QWidget *widget)
{
QWidget *window = widget->window();
QWidgetPrivate *windowPrivate = qt_widget_private(window);
QTLWExtra * topData = windowPrivate->topData();
QPlatformIntegration *integration =
QApplicationPrivate::platformIntegration();
return integration->screens()[topData->screenIndex];
}
示例2: screenGeometry
const QRect QDesktopWidget::screenGeometry(int screenNo) const
{
QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
QList<QPlatformScreen *> screens = pi->screens();
if (screenNo == -1)
screenNo = 0;
if (screenNo < 0 || screenNo >= screens.size())
return QRect();
else
return screens[screenNo]->geometry();
}
示例3: screenNumber
int QDesktopWidget::screenNumber(const QPoint &p) const
{
QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
QList<QPlatformScreen *> screens = pi->screens();
for (int i = 0; i < screens.size(); ++i)
if (screens[i]->geometry().contains(p))
return i;
return primaryScreen(); //even better would be closest screen
}
示例4: while
QWidget *QApplication::topLevelAt(const QPoint &pos)
{
QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
QList<QPlatformScreen *> screens = pi->screens();
QList<QPlatformScreen *>::const_iterator screen = screens.constBegin();
QList<QPlatformScreen *>::const_iterator end = screens.constEnd();
// The first screen in a virtual environment should know about all top levels
if (pi->isVirtualDesktop()) {
QWidget *w = (*screen)->topLevelAt(pos);
return w;
}
while (screen != end) {
if ((*screen)->geometry().contains(pos))
return (*screen)->topLevelAt(pos);
++screen;
}
return 0;
}
示例5: numScreens
int QDesktopWidget::numScreens() const
{
QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
return qMax(pi->screens().size(), 1);
}