Esempio n. 1
0
void QQnxWindow::setParent(const QPlatformWindow *window)
{
    qWindowDebug() << Q_FUNC_INFO << "window =" << this->window() << "platformWindow =" << window;
    // Cast away the const, we need to modify the hierarchy.
    QQnxWindow* const newParent = static_cast<QQnxWindow*>(const_cast<QPlatformWindow*>(window));

    if (newParent == m_parentWindow)
        return;

    removeFromParent();
    m_parentWindow = newParent;

    // Add to new hierarchy position.
    if (m_parentWindow) {
        if (m_parentWindow->m_screen != m_screen)
            setScreen(m_parentWindow->m_screen);

        m_parentWindow->m_childWindows.push_back(this);

        // we don't need any buffers, since
        // Qt will draw to the parent TLW
        // backing store.
        setBufferSize(QSize(1, 1));
    } else {
        m_screen->addWindow(this);

        // recreate buffers, in case the
        // window has been reparented and
        // becomes a TLW
        adjustBufferSize();
    }

    m_screen->updateHierarchy();
}
void QQnxRasterWindow::setParent(const QPlatformWindow *wnd)
{
    QQnxWindow::setParent(wnd);
    adjustBufferSize();
}