Changeset 769 for trunk/src/gui/kernel/qwidget_mac.mm
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qwidget_mac.mm
r651 r769 153 153 QWidget *mac_mouse_grabber = 0; 154 154 QWidget *mac_keyboard_grabber = 0; 155 extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp 155 156 156 157 #ifndef QT_MAC_USE_COCOA … … 563 564 // below 'stays on top' windows. Add 1 to get above pure stay-on-top windows. 564 565 qt_mac_set_window_group(window, Qt::Popup, qt_mac_get_group_level(kOverlayWindowClass)+1); 566 } 567 #endif 568 569 #ifdef QT_MAC_USE_COCOA 570 void qt_mac_set_needs_display(QWidget *widget, QRegion region) 571 { 572 NSView *theNSView = qt_mac_nativeview_for(widget); 573 if (region.isEmpty()) { 574 [theNSView setNeedsDisplay:YES]; 575 return; 576 } 577 578 QVector<QRect> rects = region.rects(); 579 for (int i = 0; i<rects.count(); ++i) { 580 const QRect &rect = rects.at(i); 581 NSRect nsrect = NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height()); 582 [theNSView setNeedsDisplayInRect:nsrect]; 583 } 584 565 585 } 566 586 #endif … … 848 868 QApplication::sendSpontaneousEvent(widget, &e); 849 869 } 850 extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp851 870 qt_button_down = 0; 852 871 } else if(ekind == kEventWindowCollapsed) { … … 876 895 QEvent e(QEvent::Hide); 877 896 QApplication::sendSpontaneousEvent(widget, &e); 878 extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp879 897 qt_button_down = 0; 880 898 } else if(ekind == kEventWindowToolbarSwitchMode) { … … 1250 1268 if(widget->testAttribute(Qt::WA_WState_InPaintEvent)) 1251 1269 qWarning("QWidget::repaint: Recursive repaint detected"); 1270 if (widget->isWindow() && !widget->d_func()->isOpaque 1271 && !widget->testAttribute(Qt::WA_MacBrushedMetal)) { 1272 QRect qrgnRect = qrgn.boundingRect(); 1273 CGContextClearRect(cg, CGRectMake(qrgnRect.x(), qrgnRect.y(), qrgnRect.width(), qrgnRect.height())); 1274 } 1252 1275 1253 1276 QPoint redirectionOffset(0, 0); … … 1299 1322 widget->d_func()->restoreRedirected(); 1300 1323 } 1301 1302 if (widget->isWindow() && !widget->d_func()->isOpaque1303 && !widget->testAttribute(Qt::WA_MacBrushedMetal)) {1304 QRect qrgnRect = qrgn.boundingRect();1305 CGContextClearRect(cg, CGRectMake(qrgnRect.x(), qrgnRect.y(), qrgnRect.width(), qrgnRect.height()));1306 }1307 1308 1324 1309 1325 if(!HIObjectIsOfClass((HIObjectRef)hiview, kObjectQWidget)) … … 1503 1519 qt_event_request_window_change(widget); 1504 1520 if (!HIViewIsVisible(HIViewRef(widget->winId()))) { 1505 extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp1506 1521 if (widget == qt_button_down) 1507 1522 qt_button_down = 0; … … 1512 1527 case kEventClassMouse: { 1513 1528 bool send_to_app = false; 1514 extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp1515 1529 if(qt_button_down) 1516 1530 send_to_app = true; … … 3389 3403 if((q->windowType() == Qt::Desktop)) //you can't hide the desktop! 3390 3404 return; 3391 3392 3405 QMacCocoaAutoReleasePool pool; 3393 3406 if(q->isWindow()) { … … 3511 3524 if (!QWidget::mouseGrabber()){ 3512 3525 QWidget *enterWidget = QApplication::widgetAt(QCursor::pos()); 3526 if (enterWidget && enterWidget->data->in_destructor) 3527 enterWidget = 0; 3513 3528 QApplicationPrivate::dispatchEnterLeave(enterWidget, qt_mouseover); 3514 3529 qt_mouseover = enterWidget; … … 4455 4470 } 4456 4471 4472 // ### Scroll the dirty regions as well, the following is not correct. 4473 QRegion displayRegion = r.isNull() ? dirtyOnWidget : (dirtyOnWidget & r); 4474 const QVector<QRect> &rects = dirtyOnWidget.rects(); 4475 const QVector<QRect>::const_iterator end = rects.end(); 4476 QVector<QRect>::const_iterator it = rects.begin(); 4477 while (it != end) { 4478 const QRect rect = *it; 4479 const NSRect dirtyRect = NSMakeRect(rect.x() + dx, rect.y() + dy, 4480 rect.width(), rect.height()); 4481 [view setNeedsDisplayInRect:dirtyRect]; 4482 ++it; 4483 } 4484 4457 4485 NSSize deltaSize = NSMakeSize(dx, dy); 4458 [view translateRectsNeedingDisplayInRect:scrollRect by:deltaSize];4459 4486 [view scrollRect:scrollRect by:deltaSize]; 4460 4487 [view setNeedsDisplayInRect:deltaXRect]; … … 4656 4683 return; 4657 4684 4658 if (extra->hasMask && extra->maskBits.size() != q->size()) { 4659 extra->maskBits = QImage(q->size(), QImage::Format_Mono); 4685 if (extra->hasMask) { 4686 if(extra->maskBits.size() != q->size()) { 4687 extra->maskBits = QImage(q->size(), QImage::Format_Mono); 4688 } 4660 4689 extra->maskBits.fill(QColor(Qt::color1).rgba()); 4661 4690 extra->maskBits.setNumColors(2);
Note:
See TracChangeset
for help on using the changeset viewer.