예제 #1
0
void QQuickMenuPopupWindow::setParentWindow(QQuickWindow *parentWindow)
{
    if (transientParent() != parentWindow)
        setTransientParent(parentWindow);
    if (parentWindow) {
        connect(parentWindow, SIGNAL(destroyed()), this, SLOT(dismissPopup()));
        if (QQuickMenuPopupWindow *pw = qobject_cast<QQuickMenuPopupWindow *>(parentWindow))
            connect(pw, SIGNAL(popupDismissed()), this, SLOT(dismissPopup()));
    }
}
예제 #2
0
void QQuickPopupWindow::forwardEventToTransientParent(QMouseEvent *e)
{
    if (!qobject_cast<QQuickPopupWindow*>(transientParent())
        && ((m_mouseMoved && e->type() == QEvent::MouseButtonRelease)
            || e->type() == QEvent::MouseButtonPress)) {
        // Clicked outside any popup
        dismissPopup();
    } else if (transientParent()) {
        QPoint parentPos = transientParent()->mapFromGlobal(mapToGlobal(e->pos()));
        QMouseEvent pe = QMouseEvent(e->type(), parentPos, e->button(), e->buttons(), e->modifiers());
        QGuiApplication::sendEvent(transientParent(), &pe);
    }
}
예제 #3
0
void QQuickPopupWindow::applicationStateChanged(Qt::ApplicationState state)
{
    if (state != Qt::ApplicationActive)
        dismissPopup();
}
예제 #4
0
파일: shake.c 프로젝트: ginocorrales/shake
static void down_click_handler(ClickRecognizerRef recognizer, void *context) {
text_layer_set_text(name_layer, "Neel");
text_layer_set_text(phone_layer, "Ready");
dismissPopup();
 
}
예제 #5
0
파일: shake.c 프로젝트: ginocorrales/shake
static void up_click_handler(ClickRecognizerRef recognizer, void *context) {
text_layer_set_text(name_layer, "FETCHING CONTACT...");
send_cmd();
dismissPopup();
}