Beispiel #1
0
void QWidget::hideWindow()
{
    deactivateWidgetCleanup();

    if (req_region.isEmpty())	// Already invisible?
	return;

    if ( testWFlags(WType_TopLevel) ) {
	releaseMouse();
#ifndef QT_NO_QWS_MANAGER
	if (QWSManager::grabbedMouse() == this) {
	    if ( extra && extra->topextra && extra->topextra->qwsManager ) {
		extra->topextra->qwsManager->releaseGrab();
	    }
	}
#endif
	qwsDisplay()->requestRegion(winId(), QRegion());
	qwsDisplay()->requestFocus(winId(),FALSE);
    } else {
	QWidget *p = parentWidget();
	if ( p ) {
	    p->setChildrenAllocatedDirty( geometry(), this );
	    p->paintable_region_dirty = TRUE;
	    if ( p->overlapping_children )
		p->overlapping_children = -1;
	    if ( p->isVisible() ) {
		QApplication::postEvent( p, new QPaintEvent(geometry(), TRUE) );
		paint_children( p,geometry(),TRUE );
	    }
	}
    }
    updateRequestedRegion( mapToGlobal(QPoint(0,0)) );
}
Beispiel #2
0
void QWidgetPrivate::hide_sys()
{
    Q_Q(QWidget);

    QWindow *window = q->windowHandle();

    if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
        q->setAttribute(Qt::WA_Mapped, false);
        if (q->isWindow() && q->windowModality() != Qt::NonModal && window) {
            // remove our window from the modal window list
            QGuiApplicationPrivate::hideModalWindow(window);
        }
        // do not return here, if window non-zero, we must hide it
    }

    deactivateWidgetCleanup();

    if (!q->isWindow()) {
        QWidget *p = q->parentWidget();
        if (p &&p->isVisible()) {
            invalidateBuffer(q->rect());
        }
    } else {
        invalidateBuffer(q->rect());
    }

    if (window)
        window->setVisible(false);
}
Beispiel #3
0
void QWidget::destroy( bool destroyWindow, bool destroySubWindows )
{
    deactivateWidgetCleanup();
    if ( testWState(WState_Created) ) {
	clearWState( WState_Created );
	if ( children() ) {
	    QObjectListIt it(*children());
	    register QObject *obj;
	    while ( (obj=it.current()) ) {	// destroy all widget children
		++it;
		if ( obj->isWidgetType() )
		    ((QWidget*)obj)->destroy(destroySubWindows,
					     destroySubWindows);
	    }
	}
	releaseMouse();
	if ( qt_pressGrab == this )
	  qt_pressGrab = 0;
#ifndef QT_NO_QWS_MANAGER
	if (QWSManager::grabbedMouse() == this) {
	    if ( extra && extra->topextra && extra->topextra->qwsManager ) {
		extra->topextra->qwsManager->releaseGrab();
	    }
	}
#endif
	if ( keyboardGrb == this )
	    releaseKeyboard();
	if ( testWFlags(WShowModal) )		// just be sure we leave modal
	    qt_leave_modal( this );
	else if ( testWFlags(WType_Popup) )
	    qApp->closePopup( this );
	if ( testWFlags(WType_Desktop) ) {
	} else {
	    if ( parentWidget() && parentWidget()->testWState(WState_Created) ) {
		hideWindow();
	    }
	    if ( destroyWindow && isTopLevel() )
		qwsDisplay()->destroyRegion( winId() );
	}
	setWinId( 0 );
    }
}
Beispiel #4
0
void QWidgetPrivate::hide_sys()
{
    Q_Q(QWidget);
    deactivateWidgetCleanup();

    if (q->isWindow()) {
        q->releaseMouse();
//        requestWindowRegion(QRegion());

        extra->topextra->backingStore->releaseBuffer();


        QWidget::qwsDisplay()->requestFocus(data.winid,false);
    } else {
        QWidget *p = q->parentWidget();
        if (p &&p->isVisible()) {
            invalidateBuffer(q->rect());
        }
    }
}