diff options
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsitem.cpp | 13 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsscene.cpp | 15 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsview.cpp | 12 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicsview_p.h | 22 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicswidget.cpp | 16 | ||||
-rw-r--r-- | src/widgets/graphicsview/qgraphicswidget_p.cpp | 7 |
6 files changed, 7 insertions, 78 deletions
diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index ca30c72db5..6273de56a6 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -7566,19 +7566,6 @@ void QGraphicsItem::setInputMethodHints(Qt::InputMethodHints hints) */ void QGraphicsItem::updateMicroFocus() { -#if !defined(QT_NO_IM) && 0 /* Used to be included in Qt4 for Q_WS_X11 */ - if (QWidget *fw = QApplication::focusWidget()) { - if (scene()) { - for (int i = 0 ; i < scene()->views().count() ; ++i) { - if (scene()->views().at(i) == fw) { - if (qApp) - QGuiApplication::inputMethod()->update(Qt::ImQueryAll); - break; - } - } - } - } -#endif } /*! diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp index 313939e638..1208adfd17 100644 --- a/src/widgets/graphicsview/qgraphicsscene.cpp +++ b/src/widgets/graphicsview/qgraphicsscene.cpp @@ -4170,14 +4170,6 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent) wheelEvent->scenePos(), wheelEvent->widget()); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // On Mac, ignore the event if the first item under the mouse is not the last opened - // popup (or one of its descendant) - if (!d->popupWidgets.isEmpty() && !wheelCandidates.isEmpty() && wheelCandidates.first() != d->popupWidgets.back() && !d->popupWidgets.back()->isAncestorOf(wheelCandidates.first())) { - wheelEvent->accept(); - return; - } -#else // Find the first popup under the mouse (including the popup's descendants) starting from the last. // Remove all popups after the one found, or all or them if no popup is under the mouse. // Then continue with the event. @@ -4187,7 +4179,6 @@ void QGraphicsScene::wheelEvent(QGraphicsSceneWheelEvent *wheelEvent) break; d->removePopup(*iter); } -#endif bool hasSetFocus = false; for (QGraphicsItem *item : wheelCandidates) { @@ -4409,11 +4400,7 @@ void QGraphicsScenePrivate::drawItemHelper(QGraphicsItem *item, QPainter *painte QGraphicsItem::CacheMode cacheMode = QGraphicsItem::CacheMode(itemd->cacheMode); // Render directly, using no cache. - if (cacheMode == QGraphicsItem::NoCache -#if 0 // Used to be included in Qt4 for Q_WS_X11 - || !X11->use_xrender -#endif - ) { + if (cacheMode == QGraphicsItem::NoCache) { _q_paintItem(static_cast<QGraphicsWidget *>(item), painter, option, widget, true, painterStateProtection); return; } diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index 7f14218720..57be850829 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -3476,11 +3476,7 @@ void QGraphicsView::paintEvent(QPaintEvent *event) const QTransform viewTransform = painter.worldTransform(); // Draw background - if ((d->cacheMode & CacheBackground) -#if 0 // Used to be included in Qt4 for Q_WS_X11 - && X11->use_xrender -#endif - ) { + if (d->cacheMode & CacheBackground) { // Recreate the background pixmap, and flag the whole background as // exposed. if (d->mustResizeBackgroundPixmap) { @@ -3677,11 +3673,7 @@ void QGraphicsView::scrollContentsBy(int dx, int dy) d->updateLastCenterPoint(); - if ((d->cacheMode & CacheBackground) -#if 0 // Used to be included in Qt4 for Q_WS_X11 - && X11->use_xrender -#endif - ) { + if (d->cacheMode & CacheBackground) { // Below, QPixmap::scroll() works in device pixels, while the delta values // and backgroundPixmapExposed are in device independent pixels. const qreal dpr = d->backgroundPixmap.devicePixelRatio(); diff --git a/src/widgets/graphicsview/qgraphicsview_p.h b/src/widgets/graphicsview/qgraphicsview_p.h index 0428b9ce70..01af61d6ba 100644 --- a/src/widgets/graphicsview/qgraphicsview_p.h +++ b/src/widgets/graphicsview/qgraphicsview_p.h @@ -184,24 +184,10 @@ public: inline void dispatchPendingUpdateRequests() { -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // QWidget::update() works slightly different on the Mac without the raster engine; - // it's not part of our backing store so it needs special threatment. - if (QApplicationPrivate::graphics_system_name != QLatin1String("raster")) { - // At this point either HIViewSetNeedsDisplay (Carbon) or setNeedsDisplay: YES (Cocoa) - // is called, which means there's a pending update request. We want to dispatch it - // now because otherwise graphics view updates would require two - // round-trips in the event loop before the item is painted. - extern void qt_mac_dispatchPendingUpdateRequests(QWidget *); - qt_mac_dispatchPendingUpdateRequests(viewport->window()); - } else -#endif - { - if (qt_widget_private(viewport)->paintOnScreen()) - QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest); - else - QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest); - } + if (qt_widget_private(viewport)->shouldPaintOnScreen()) + QCoreApplication::sendPostedEvents(viewport, QEvent::UpdateRequest); + else + QCoreApplication::sendPostedEvents(viewport->window(), QEvent::UpdateRequest); } void setUpdateClip(QGraphicsItem *); diff --git a/src/widgets/graphicsview/qgraphicswidget.cpp b/src/widgets/graphicsview/qgraphicswidget.cpp index 643f073085..cf041b9817 100644 --- a/src/widgets/graphicsview/qgraphicswidget.cpp +++ b/src/widgets/graphicsview/qgraphicswidget.cpp @@ -716,22 +716,6 @@ void QGraphicsWidget::initStyleOption(QStyleOption *option) const option->state |= QStyle::State_Window; /* ### -#if 0 // Used to be included in Qt4 for Q_WS_MAC - extern bool qt_mac_can_clickThrough(const QGraphicsWidget *w); //qwidget_mac.cpp - if (!(option->state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget)) - option->state &= ~QStyle::State_Enabled; - - switch (QMacStyle::widgetSizePolicy(widget)) { - case QMacStyle::SizeSmall: - option->state |= QStyle::State_Small; - break; - case QMacStyle::SizeMini: - option->state |= QStyle::State_Mini; - break; - default: - ; - } -#endif #ifdef QT_KEYPAD_NAVIGATION if (widget->hasEditFocus()) state |= QStyle::State_HasEditFocus; diff --git a/src/widgets/graphicsview/qgraphicswidget_p.cpp b/src/widgets/graphicsview/qgraphicswidget_p.cpp index fd47f444ea..0156faf8e4 100644 --- a/src/widgets/graphicsview/qgraphicswidget_p.cpp +++ b/src/widgets/graphicsview/qgraphicswidget_p.cpp @@ -691,13 +691,6 @@ void QGraphicsWidgetPrivate::windowFrameHoverMoveEvent(QGraphicsSceneHoverEvent case Qt::TitleBarArea: windowData->buttonRect = q->style()->subControlRect( QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarCloseButton, 0); -#if 0 // Used to be included in Qt4 for Q_WS_MAC - // On mac we should hover if we are in the 'area' of the buttons - windowData->buttonRect |= q->style()->subControlRect( - QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarMinButton, 0); - windowData->buttonRect |= q->style()->subControlRect( - QStyle::CC_TitleBar, &bar, QStyle::SC_TitleBarMaxButton, 0); -#endif if (windowData->buttonRect.contains(pos.toPoint())) windowData->buttonMouseOver = true; event->ignore(); |