当前位置: 首页>>代码示例>>C++>>正文


C++ QPlatformIntegration::screens方法代码示例

本文整理汇总了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];
}
开发者ID:Blizzard,项目名称:qt4,代码行数:9,代码来源:qplatformscreen_qpa.cpp

示例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();
}
开发者ID:phen89,项目名称:rtqt,代码行数:11,代码来源:qdesktopwidget_qpa.cpp

示例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
}
开发者ID:phen89,项目名称:rtqt,代码行数:11,代码来源:qdesktopwidget_qpa.cpp

示例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;
}
开发者ID:TriggeredMessaging,项目名称:phantomjs,代码行数:21,代码来源:qapplication_qpa.cpp

示例5: numScreens

int QDesktopWidget::numScreens() const
{
    QPlatformIntegration *pi = QApplicationPrivate::platformIntegration();
    return qMax(pi->screens().size(), 1);
}
开发者ID:phen89,项目名称:rtqt,代码行数:5,代码来源:qdesktopwidget_qpa.cpp


注:本文中的QPlatformIntegration::screens方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。