diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/dialogs/qdialog.cpp | 14 | ||||
-rw-r--r-- | src/gui/dialogs/qdialog.h | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 24 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem_p.h | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsproxywidget.cpp | 2 | ||||
-rw-r--r-- | src/gui/graphicsview/qgraphicsview.cpp | 22 | ||||
-rw-r--r-- | src/gui/kernel/qcocoaview_mac.mm | 3 | ||||
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/qmenu_mac.mm | 3 |
9 files changed, 56 insertions, 22 deletions
diff --git a/src/gui/dialogs/qdialog.cpp b/src/gui/dialogs/qdialog.cpp index e4f45ba..a6bd78a 100644 --- a/src/gui/dialogs/qdialog.cpp +++ b/src/gui/dialogs/qdialog.cpp @@ -393,6 +393,7 @@ void QDialogPrivate::resetModalitySetByOpen() resetModalityTo = -1; } +#if defined(Q_WS_WINCE) || defined(Q_WS_S60) #ifdef Q_WS_WINCE_WM void QDialogPrivate::_q_doneAction() { @@ -407,12 +408,12 @@ void QDialogPrivate::_q_doneAction() bool QDialog::event(QEvent *e) { bool result = QWidget::event(e); -#if defined(Q_WS_WINCE) +#ifdef Q_WS_WINCE if (e->type() == QEvent::OkRequest) { accept(); result = true; - } else -#elif defined(Q_WS_S60) + } +#else if ((e->type() == QEvent::StyleChange) || (e->type() == QEvent::Resize )) { if (!testAttribute(Qt::WA_Moved)) { Qt::WindowStates state = windowState(); @@ -421,14 +422,11 @@ bool QDialog::event(QEvent *e) if (state != windowState()) setWindowState(state); } - } else -#endif - if (e->type() == QEvent::Move) { - setAttribute(Qt::WA_Moved, true); // as explicit as the user wants it to be } - +#endif return result; } +#endif /*! Returns the modal dialog's result code, \c Accepted or \c Rejected. diff --git a/src/gui/dialogs/qdialog.h b/src/gui/dialogs/qdialog.h index 7ab0cb6..777256a 100644 --- a/src/gui/dialogs/qdialog.h +++ b/src/gui/dialogs/qdialog.h @@ -107,7 +107,9 @@ public Q_SLOTS: protected: QDialog(QDialogPrivate &, QWidget *parent, Qt::WindowFlags f = 0); +#if defined(Q_WS_WINCE) || defined(Q_WS_S60) bool event(QEvent *e); +#endif void keyPressEvent(QKeyEvent *); void closeEvent(QCloseEvent *); void showEvent(QShowEvent *); diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 6cc3f7d..326f130 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -7325,6 +7325,18 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints) { Q_D(QGraphicsItem); d->imHints = hints; + if (!hasFocus()) + return; + d->scene->d_func()->updateInputMethodSensitivityInViews(); +#if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) + QWidget *fw = QApplication::focusWidget(); + if (!fw) + return; + for (int i = 0 ; i < scene()->views().count() ; ++i) + if (scene()->views().at(i) == fw) + if (QInputContext *inputContext = fw->inputContext()) + inputContext->update(); +#endif } /*! @@ -7337,13 +7349,11 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints) void QGraphicsItem::updateMicroFocus() { #if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) - if (QWidget *fw = qApp->focusWidget()) { - if (qt_widget_private(fw)->ic || qApp->d_func()->inputContext) { - if (QInputContext *ic = fw->inputContext()) { - if (ic) - ic->update(); - } - } + if (QWidget *fw = QApplication::focusWidget()) { + for (int i = 0 ; i < scene()->views().count() ; ++i) + if (scene()->views().at(i) == fw) + if (QInputContext *inputContext = fw->inputContext()) + inputContext->update(); #ifndef QT_NO_ACCESSIBILITY // ##### is this correct QAccessible::updateAccessibility(fw, 0, QAccessible::StateChanged); diff --git a/src/gui/graphicsview/qgraphicsitem_p.h b/src/gui/graphicsview/qgraphicsitem_p.h index 8c7fbb4..6b22607 100644 --- a/src/gui/graphicsview/qgraphicsitem_p.h +++ b/src/gui/graphicsview/qgraphicsitem_p.h @@ -861,7 +861,7 @@ inline void QGraphicsItemPrivate::markParentDirty(bool updateBoundingRect) static_cast<QGraphicsItemEffectSourcePrivate *>(parentp->graphicsEffect->d_func() ->source->d_func())->invalidateCache(); } - if (parentp->graphicsEffect->isEnabled()) { + if (parentp->scene && parentp->graphicsEffect->isEnabled()) { parentp->dirty = 1; parentp->fullUpdatePending = 1; } diff --git a/src/gui/graphicsview/qgraphicsproxywidget.cpp b/src/gui/graphicsview/qgraphicsproxywidget.cpp index 1f89714..320395e 100644 --- a/src/gui/graphicsview/qgraphicsproxywidget.cpp +++ b/src/gui/graphicsview/qgraphicsproxywidget.cpp @@ -975,6 +975,7 @@ bool QGraphicsProxyWidget::eventFilter(QObject *object, QEvent *event) d->styleChangeMode = QGraphicsProxyWidgetPrivate::NoMode; } break; +#ifndef QT_NO_TOOLTIP case QEvent::ToolTipChange: // Propagate tooltip change to the proxy. if (!d->tooltipChangeMode) { @@ -983,6 +984,7 @@ bool QGraphicsProxyWidget::eventFilter(QObject *object, QEvent *event) d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::NoMode; } break; +#endif default: break; } diff --git a/src/gui/graphicsview/qgraphicsview.cpp b/src/gui/graphicsview/qgraphicsview.cpp index 114de85..c951dce 100644 --- a/src/gui/graphicsview/qgraphicsview.cpp +++ b/src/gui/graphicsview/qgraphicsview.cpp @@ -1037,10 +1037,28 @@ QList<QGraphicsItem *> QGraphicsViewPrivate::findItems(const QRegion &exposedReg void QGraphicsViewPrivate::updateInputMethodSensitivity() { Q_Q(QGraphicsView); - bool enabled = scene && scene->focusItem() - && (scene->focusItem()->flags() & QGraphicsItem::ItemAcceptsInputMethod); + QGraphicsItem *focusItem = 0; + bool enabled = scene && (focusItem = scene->focusItem()) + && (focusItem->d_ptr->flags & QGraphicsItem::ItemAcceptsInputMethod); q->setAttribute(Qt::WA_InputMethodEnabled, enabled); q->viewport()->setAttribute(Qt::WA_InputMethodEnabled, enabled); + + if (!enabled) { + q->setInputMethodHints(0); + return; + } + + QGraphicsProxyWidget *proxy = focusItem->d_ptr->isWidget && focusItem->d_ptr->isProxyWidget() + ? static_cast<QGraphicsProxyWidget *>(focusItem) : 0; + if (!proxy) { + q->setInputMethodHints(focusItem->inputMethodHints()); + } else if (QWidget *widget = proxy->widget()) { + if (QWidget *fw = widget->focusWidget()) + widget = fw; + q->setInputMethodHints(widget->inputMethodHints()); + } else { + q->setInputMethodHints(0); + } } /*! diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm index dd12f65..4953c48 100644 --- a/src/gui/kernel/qcocoaview_mac.mm +++ b/src/gui/kernel/qcocoaview_mac.mm @@ -1554,7 +1554,8 @@ Qt::DropAction QDragManager::drag(QDrag *o) qt_button_down = 0; [dndParams.view release]; [image release]; - dragPrivate()->executed_action = Qt::IgnoreAction; + if (dragPrivate()) + dragPrivate()->executed_action = Qt::IgnoreAction; object = 0; Qt::DropAction performedAction(qt_mac_mapNSDragOperation(qMacDnDParams()->performedAction)); // do post drag processing, if required. diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index cf952aa..20d1d30 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -7312,9 +7312,9 @@ void QWidgetPrivate::show_helper() setVisible(false). - \note Since Qt 4.7, when calling hide() and then show() on QDialog - derived widgets will show on the previous (as in "Where the user moved it to") - position. + \note If you are working with QDialog or its subclasses and you invoke + the show() function after this function, the dialog will be displayed in + its original position. \sa hideEvent(), isHidden(), show(), setVisible(), isVisible(), close() */ diff --git a/src/gui/widgets/qmenu_mac.mm b/src/gui/widgets/qmenu_mac.mm index e8400d6..aaa113b 100644 --- a/src/gui/widgets/qmenu_mac.mm +++ b/src/gui/widgets/qmenu_mac.mm @@ -2066,6 +2066,7 @@ bool QMenuBarPrivate::macUpdateMenuBarImmediatly() cancelAllMenuTracking(); QWidget *w = findWindowThatShouldDisplayMenubar(); QMenuBar *mb = findMenubarForWindow(w); + extern bool qt_mac_app_fullscreen; //qapplication_mac.mm // We need to see if we are in full screen mode, if so we need to // switch the full screen mode to be able to show or hide the menubar. @@ -2074,12 +2075,14 @@ bool QMenuBarPrivate::macUpdateMenuBarImmediatly() if(w->isFullScreen()) { // Ok, switch to showing the menubar when hovering over it. SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar); + qt_mac_app_fullscreen = true; } } else if(w) { // Removing a menubar if(w->isFullScreen()) { // Ok, switch to not showing the menubar when hovering on it SetSystemUIMode(kUIModeAllHidden, 0); + qt_mac_app_fullscreen = true; } } |