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


C++ QScreen::subScreens方法代码示例

本文整理汇总了C++中QScreen::subScreens方法的典型用法代码示例。如果您正苦于以下问题:C++ QScreen::subScreens方法的具体用法?C++ QScreen::subScreens怎么用?C++ QScreen::subScreens使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在QScreen的用法示例。


在下文中一共展示了QScreen::subScreens方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: numScreens

int QDesktopWidget::numScreens() const
{
    QScreen *screen = QScreen::instance();
    if (!screen)
        return 0;

    const QList<QScreen*> subScreens = screen->subScreens();
    return qMax(subScreens.size(), 1);
}
开发者ID:,项目名称:,代码行数:9,代码来源:

示例2:

static inline QScreen *getPrimaryScreen()
{
    QScreen *screen = QScreen::instance();
    if (!screen->base()) {
        QList<QScreen*> subScreens = screen->subScreens();
        if (subScreens.size() < 1)
            return 0;
        screen = subScreens.at(0);
    }
    return screen;
}
开发者ID:AlekSi,项目名称:phantomjs,代码行数:11,代码来源:qwindowsurface_qws.cpp

示例3: while

QT_BEGIN_NAMESPACE

static QScreen *screenForDevice(QPaintDevice *device)
{
    QScreen *screen = qt_screen;
    if (!screen)
        return 0;
    if (screen->classId() == QScreen::MultiClass) {
        int screenNumber;
        if (device && device->devType() == QInternal::Widget)
            screenNumber = qApp->desktop()->screenNumber(static_cast<QWidget *>(device));
        else
            screenNumber = 0;
        screen = screen->subScreens()[screenNumber];
    }
    while (screen->classId() == QScreen::ProxyClass ||
           screen->classId() == QScreen::TransformedClass) {
        screen = static_cast<QProxyScreen *>(screen)->screen();
    }
    return screen;
}
开发者ID:phen89,项目名称:rtqt,代码行数:21,代码来源:qegl_qws.cpp

示例4: regionChanged

QT_BEGIN_NAMESPACE

#ifdef Q_WS_QWS
#ifndef QT_NO_DIRECTPAINTER

/*!
    \class QDirectPainter
    \ingroup painting
    \ingroup qws

    \brief The QDirectPainter class provides direct access to the
    underlying hardware in Qt for Embedded Linux.

    Note that this class is only available in \l{Qt for Embedded Linux}.

    QDirectPainter allows a client application to reserve a region of
    the framebuffer and render directly onto the screen. There are two
    ways of using the QDirectPainter class: You can either reserve a
    region using the provided static functions, or you can instantiate
    an object and make use of its more dynamic API.

    \tableofcontents

    \section1 Dynamic Allocation

    By instantiating a QDirectPainter object using the default
    QDirectPainter::NonReserved surface flag, the client application
    only gets some control over the reserved region, i.e., it can
    still render directly onto the screen but the allocated region may
    change (for example, if a window with a higher focus requests
    parts of the same region). The currently allocated region can be
    retrieved using the allocatedRegion() function, while the
    requestedRegion() function returns the originally reserved
    region.


    \section1 Static Allocation


    Using the static approach, the client application gets complete
    control over the reserved region, i.e., the affected region will
    never be modified by the screen driver.

    To create a static region, pass the QDirectPainter::Reserved
    surface flag to the constructor. After the reserved region is
    reported through regionChanged(), the allocated region will not
    change, unless setRegion() is called.

    If QDirectPainter::ReservedSynchronous is passed to the
    constructor, calls to setRegion() will block until the region is
    reserved, meaning that allocatedRegion() will be available immediately.
    Note that in the current version setRegion() will cause the application
    event loop to be entered, potentially causing reentrancy issues.

    \section1 Rendering

    To draw on a given region, the application must first get hold of
    a pointer to the framebuffer. In most cases, this pointer can be
    retrieved using the QDirectPainter::frameBuffer() function. But
    note that if the current screen has subscreens, you must query the
    screen driver instead to identify the correct subscreen. A pointer
    to the current screen driver can always be retrieved using the
    static QScreen::instance() function. Then use QScreen's \l
    {QScreen::}{subScreenIndexAt()} and \l {QScreen::}{subScreens()}
    functions to access the correct subscreen, and the subscreen's \l
    {QScreen::}{base()} function to retrieve a pointer to the
    framebuffer.

    Depending on the hardware, it might be necessary to lock the
    framebuffer for exclusive use while writing to it. This is
    possible using the lock() and unlock() functions. Note that
    calling lock() will prevent all other applications from working
    until unlock() is called.

    In addition, QDirectPainter provides several functions returning
    information about the framebuffer: the linestep() function returns
    the length (in bytes) of each scanline of the framebuffer while
    the screenDepth(), screenWidth() and screenHeight() function
    return the screen metrics.

    \sa QScreen, QWSEmbedWidget, {Qt for Embedded Linux Architecture}
*/

/*!
    \enum QDirectPainter::SurfaceFlag

    This enum describes the behavior of the region reserved by this
    QDirectPainter object.

    \value NonReserved The allocated region may change, e.g., if a
    window with a higher focus requests parts of the same region. See
    also \l {Dynamic Allocation}.

    \value Reserved The allocated region will never change. See also
    \l {Static Allocation}.

    \value ReservedSynchronous The allocated region will never change and
    each function that changes the allocated region will be blocking.

    \sa allocatedRegion()
//.........这里部分代码省略.........
开发者ID:Akheon23,项目名称:chromecast-mirrored-source.vendor,代码行数:101,代码来源:qdirectpainter_qws.cpp


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