diff options
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsproxywidget.cpp | 11 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 12 | ||||
-rw-r--r-- | src/widgets/platforms/mac/qfontdatabase_mac.cpp | 2 | ||||
-rw-r--r-- | src/widgets/platforms/mac/qpaintengine_mac.cpp | 5 | ||||
-rw-r--r-- | src/widgets/platforms/win/qprintengine_win.cpp | 3 | ||||
-rw-r--r-- | src/widgets/platforms/x11/qfontdatabase_x11.cpp | 6 | ||||
-rw-r--r-- | src/widgets/platforms/x11/qpaintengine_x11.cpp | 5 | ||||
-rw-r--r-- | src/widgets/widgets/qmaccocoaviewcontainer_mac.mm | 2 |
8 files changed, 21 insertions, 25 deletions
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index 127578c7c9..0b8cccaaeb 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -274,12 +274,12 @@ void QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(QGraphicsSceneMouseEvent pos = mapToReceiver(pos, receiver); // Send mouse event. - QMouseEvent *mouseEvent = QMouseEvent::createExtendedMouseEvent(type, pos, - receiver->mapToGlobal(pos.toPoint()), event->button(), - event->buttons(), event->modifiers()); + QMouseEvent mouseEvent(type, pos, + receiver->mapToGlobal(pos.toPoint()), event->button(), + event->buttons(), event->modifiers()); QWidget *embeddedMouseGrabberPtr = (QWidget *)embeddedMouseGrabber; - QApplicationPrivate::sendMouseEvent(receiver, mouseEvent, alienWidget, widget, + QApplicationPrivate::sendMouseEvent(receiver, &mouseEvent, alienWidget, widget, &embeddedMouseGrabberPtr, lastWidgetUnderMouse, event->spontaneous()); embeddedMouseGrabber = embeddedMouseGrabberPtr; @@ -302,8 +302,7 @@ void QGraphicsProxyWidgetPrivate::sendWidgetMouseEvent(QGraphicsSceneMouseEvent #endif } - event->setAccepted(mouseEvent->isAccepted()); - delete mouseEvent; + event->setAccepted(mouseEvent.isAccepted()); } void QGraphicsProxyWidgetPrivate::sendWidgetKeyEvent(QKeyEvent *event) diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index fd745c16b5..0e1b691b36 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1221,8 +1221,8 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis || event->type() == QEvent::LanguageChange || event->type() == QEvent::UpdateSoftKeys || event->type() == QEvent::InputMethod)) { - for (int i = 0; i < postedEvents->size(); ++i) { - const QPostEvent &cur = postedEvents->at(i); + for (QPostEventList::const_iterator it = postedEvents->constBegin(); it != postedEvents->constEnd(); ++it) { + const QPostEvent &cur = *it; if (cur.receiver != receiver || cur.event == 0 || cur.event->type() != event->type()) continue; if (cur.event->type() == QEvent::LayoutRequest @@ -2651,7 +2651,8 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) { if (w->testAttribute(Qt::WA_Hover) && (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) { Q_ASSERT(instance()); - QHoverEvent he(QEvent::HoverLeave, QPoint(-1, -1), w->mapFromGlobal(QApplicationPrivate::instance()->hoverGlobalPos)); + QHoverEvent he(QEvent::HoverLeave, QPoint(-1, -1), w->mapFromGlobal(QApplicationPrivate::instance()->hoverGlobalPos), + QApplication::keyboardModifiers()); qApp->d_func()->notify_helper(w, &he); } } @@ -2664,7 +2665,8 @@ void QApplicationPrivate::dispatchEnterLeave(QWidget* enter, QWidget* leave) { QApplication::sendEvent(w, &enterEvent); if (w->testAttribute(Qt::WA_Hover) && (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) { - QHoverEvent he(QEvent::HoverEnter, w->mapFromGlobal(posEnter), QPoint(-1, -1)); + QHoverEvent he(QEvent::HoverEnter, w->mapFromGlobal(posEnter), QPoint(-1, -1), + QApplication::keyboardModifiers()); qApp->d_func()->notify_helper(w, &he); } } @@ -3826,7 +3828,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) while (w) { if (w->testAttribute(Qt::WA_Hover) && (!QApplication::activePopupWidget() || QApplication::activePopupWidget() == w->window())) { - QHoverEvent he(QEvent::HoverMove, relpos, relpos - diff); + QHoverEvent he(QEvent::HoverMove, relpos, relpos - diff, mouse->modifiers()); d->notify_helper(w, &he); } if (w->isWindow() || w->testAttribute(Qt::WA_NoMousePropagation)) diff --git a/src/widgets/platforms/mac/qfontdatabase_mac.cpp b/src/widgets/platforms/mac/qfontdatabase_mac.cpp index 724dbf6c4a..b7335d684e 100644 --- a/src/widgets/platforms/mac/qfontdatabase_mac.cpp +++ b/src/widgets/platforms/mac/qfontdatabase_mac.cpp @@ -106,12 +106,14 @@ if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_5) { CTFontDescriptorRef font = (CTFontDescriptorRef)CFArrayGetValueAtIndex(fonts, i); QCFString family_name = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontFamilyNameAttribute); + QCFString style_name = (CFStringRef)CTFontDescriptorCopyAttribute(font, kCTFontStyleNameAttribute); QtFontFamily *family = db->family(family_name, true); for(int ws = 1; ws < QFontDatabase::WritingSystemsCount; ++ws) family->writingSystems[ws] = QtFontFamily::Supported; QtFontFoundry *foundry = family->foundry(foundry_name, true); QtFontStyle::Key styleKey; + styleKey.styleName = style_name; if(QCFType<CFDictionaryRef> styles = (CFDictionaryRef)CTFontDescriptorCopyAttribute(font, kCTFontTraitsAttribute)) { if(CFNumberRef weight = (CFNumberRef)CFDictionaryGetValue(styles, kCTFontWeightTrait)) { Q_ASSERT(CFNumberIsFloatType(weight)); diff --git a/src/widgets/platforms/mac/qpaintengine_mac.cpp b/src/widgets/platforms/mac/qpaintengine_mac.cpp index 802c455ab8..0d459a5d89 100644 --- a/src/widgets/platforms/mac/qpaintengine_mac.cpp +++ b/src/widgets/platforms/mac/qpaintengine_mac.cpp @@ -798,9 +798,6 @@ QCoreGraphicsPaintEngine::updateClipPath(const QPainterPath &p, Qt::ClipOperatio } else if(op == Qt::IntersectClip) { d->current.clip = d->current.clip.intersected(clipRegion); d->setClip(&d->current.clip); - } else if(op == Qt::UniteClip) { - d->current.clip = d->current.clip.united(clipRegion); - d->setClip(&d->current.clip); } } } @@ -822,8 +819,6 @@ QCoreGraphicsPaintEngine::updateClipRegion(const QRegion &clipRegion, Qt::ClipOp d->current.clip = d->current.clip.intersected(clipRegion); else if(op == Qt::ReplaceClip) d->current.clip = clipRegion; - else if(op == Qt::UniteClip) - d->current.clip = d->current.clip.united(clipRegion); d->setClip(&d->current.clip); } } diff --git a/src/widgets/platforms/win/qprintengine_win.cpp b/src/widgets/platforms/win/qprintengine_win.cpp index ebce404c3c..5ba33c043c 100644 --- a/src/widgets/platforms/win/qprintengine_win.cpp +++ b/src/widgets/platforms/win/qprintengine_win.cpp @@ -586,8 +586,7 @@ void QWin32PrintEngine::updateClipPath(const QPainterPath &clipPath, Qt::ClipOpe const int ops[] = { -1, // Qt::NoClip, covered above RGN_COPY, // Qt::ReplaceClip - RGN_AND, // Qt::IntersectClip - RGN_OR // Qt::UniteClip + RGN_AND // Qt::IntersectClip }; Q_ASSERT(op > 0 && unsigned(op) <= sizeof(ops) / sizeof(int)); SelectClipPath(d->hdc, ops[op]); diff --git a/src/widgets/platforms/x11/qfontdatabase_x11.cpp b/src/widgets/platforms/x11/qfontdatabase_x11.cpp index 958daa2506..ed94fa6be1 100644 --- a/src/widgets/platforms/x11/qfontdatabase_x11.cpp +++ b/src/widgets/platforms/x11/qfontdatabase_x11.cpp @@ -1034,13 +1034,14 @@ static void loadFontConfig() FcChar8 *file_value; int index_value; FcChar8 *foundry_value; + FcChar8 *style_value; FcBool scalable; { FcObjectSet *os = FcObjectSetCreate(); FcPattern *pattern = FcPatternCreate(); const char *properties [] = { - FC_FAMILY, FC_WEIGHT, FC_SLANT, + FC_FAMILY, FC_STYLE, FC_WEIGHT, FC_SLANT, FC_SPACING, FC_FILE, FC_INDEX, FC_LANG, FC_CHARSET, FC_FOUNDRY, FC_SCALABLE, FC_PIXEL_SIZE, FC_WEIGHT, FC_WIDTH, @@ -1085,6 +1086,8 @@ static void loadFontConfig() scalable = FcTrue; if (FcPatternGetString(fonts->fonts[i], FC_FOUNDRY, 0, &foundry_value) != FcResultMatch) foundry_value = 0; + if (FcPatternGetString(fonts->fonts[i], FC_STYLE, 0, &style_value) != FcResultMatch) + style_value = 0; QtFontFamily *family = db->family(familyName, true); FcLangSet *langset = 0; @@ -1142,6 +1145,7 @@ static void loadFontConfig() family->fontFileIndex = index_value; QtFontStyle::Key styleKey; + styleKey.styleName = style_value ? QString::fromUtf8((const char *) style_value) : QString(); styleKey.style = (slant_value == FC_SLANT_ITALIC) ? QFont::StyleItalic : ((slant_value == FC_SLANT_OBLIQUE) diff --git a/src/widgets/platforms/x11/qpaintengine_x11.cpp b/src/widgets/platforms/x11/qpaintengine_x11.cpp index a7ea84c918..6b480815cf 100644 --- a/src/widgets/platforms/x11/qpaintengine_x11.cpp +++ b/src/widgets/platforms/x11/qpaintengine_x11.cpp @@ -2078,11 +2078,6 @@ void QX11PaintEngine::updateClipRegion_dev(const QRegion &clipRegion, Qt::ClipOp else d->crgn = clipRegion; break; - case Qt::UniteClip: - d->crgn |= clipRegion; - if (!sysClip.isEmpty()) - d->crgn = d->crgn.intersected(sysClip); - break; default: break; } diff --git a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm index 92b8fb77fa..5bb7a3bbf2 100644 --- a/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm +++ b/src/widgets/widgets/qmaccocoaviewcontainer_mac.mm @@ -84,7 +84,7 @@ developer to provide the autorelease pool. The following is a snippet of subclassing QMacCocoaViewContainer to wrap a NSSearchField. - \snippet demos/macmainwindow/macmainwindow.mm 0 + \snippet examples/mainwindows/macmainwindow/macmainwindow.mm 0 */ |