equal
deleted
inserted
replaced
187 |
187 |
188 \sa QGraphicsScene::addWidget(), QGraphicsWidget |
188 \sa QGraphicsScene::addWidget(), QGraphicsWidget |
189 */ |
189 */ |
190 |
190 |
191 extern bool qt_sendSpontaneousEvent(QObject *, QEvent *); |
191 extern bool qt_sendSpontaneousEvent(QObject *, QEvent *); |
192 extern bool qt_tab_all_widgets; |
192 Q_GUI_EXPORT extern bool qt_tab_all_widgets; |
193 |
193 |
194 /*! |
194 /*! |
195 \internal |
195 \internal |
196 */ |
196 */ |
197 void QGraphicsProxyWidgetPrivate::init() |
197 void QGraphicsProxyWidgetPrivate::init() |
895 return true; |
895 return true; |
896 } |
896 } |
897 } |
897 } |
898 break; |
898 break; |
899 } |
899 } |
|
900 #ifndef QT_NO_TOOLTIP |
|
901 case QEvent::GraphicsSceneHelp: { |
|
902 // Propagate the help event (for tooltip) to the widget under mouse |
|
903 if (d->lastWidgetUnderMouse) { |
|
904 QGraphicsSceneHelpEvent *he = static_cast<QGraphicsSceneHelpEvent *>(event); |
|
905 QPoint pos = d->mapToReceiver(mapFromScene(he->scenePos()), d->lastWidgetUnderMouse).toPoint(); |
|
906 QHelpEvent e(QEvent::ToolTip, pos, he->screenPos()); |
|
907 QApplication::sendEvent(d->lastWidgetUnderMouse, &e); |
|
908 event->setAccepted(e.isAccepted()); |
|
909 return e.isAccepted(); |
|
910 } |
|
911 break; |
|
912 } |
|
913 case QEvent::ToolTipChange: { |
|
914 // Propagate tooltip change to the widget |
|
915 if (!d->tooltipChangeMode) { |
|
916 d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::ProxyToWidgetMode; |
|
917 d->widget->setToolTip(toolTip()); |
|
918 d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::NoMode; |
|
919 } |
|
920 break; |
|
921 } |
|
922 #endif |
900 default: |
923 default: |
901 break; |
924 break; |
902 } |
925 } |
903 return QGraphicsWidget::event(event); |
926 return QGraphicsWidget::event(event); |
904 } |
927 } |
950 d->styleChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode; |
973 d->styleChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode; |
951 setStyle(d->widget->style()); |
974 setStyle(d->widget->style()); |
952 d->styleChangeMode = QGraphicsProxyWidgetPrivate::NoMode; |
975 d->styleChangeMode = QGraphicsProxyWidgetPrivate::NoMode; |
953 } |
976 } |
954 break; |
977 break; |
|
978 case QEvent::ToolTipChange: |
|
979 // Propagate tooltip change to the proxy. |
|
980 if (!d->tooltipChangeMode) { |
|
981 d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::WidgetToProxyMode; |
|
982 setToolTip(d->widget->toolTip()); |
|
983 d->tooltipChangeMode = QGraphicsProxyWidgetPrivate::NoMode; |
|
984 } |
|
985 break; |
955 default: |
986 default: |
956 break; |
987 break; |
957 } |
988 } |
958 } |
989 } |
959 return QGraphicsWidget::eventFilter(object, event); |
990 return QGraphicsWidget::eventFilter(object, event); |
1433 Q_UNUSED(widget); |
1464 Q_UNUSED(widget); |
1434 if (!d->widget || !d->widget->isVisible()) |
1465 if (!d->widget || !d->widget->isVisible()) |
1435 return; |
1466 return; |
1436 |
1467 |
1437 // Filter out repaints on the window frame. |
1468 // Filter out repaints on the window frame. |
1438 const QRect exposedWidgetRect = (option->exposedRect & rect()).toRect(); |
1469 const QRect exposedWidgetRect = (option->exposedRect & rect()).toAlignedRect(); |
1439 if (exposedWidgetRect.isEmpty()) |
1470 if (exposedWidgetRect.isEmpty()) |
1440 return; |
1471 return; |
1441 |
1472 |
1442 // Disable QPainter's default pen being cosmetic. This allows widgets and |
1473 // Disable QPainter's default pen being cosmetic. This allows widgets and |
1443 // styles to follow Qt's existing defaults without getting ugly cosmetic |
1474 // styles to follow Qt's existing defaults without getting ugly cosmetic |