Changeset 651 for trunk/src/gui/kernel/qapplication_mac.mm
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qapplication_mac.mm
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 228 228 static void qt_mac_read_fontsmoothing_settings() 229 229 { 230 NSInteger appleFontSmoothing = [[NSUserDefaults standardUserDefaults] integerForKey:@"AppleFontSmoothing"]; 231 qt_applefontsmoothing_enabled = (appleFontSmoothing > 0); 230 qt_applefontsmoothing_enabled = true; 231 int w = 10, h = 10; 232 QImage image(w, h, QImage::Format_RGB32); 233 image.fill(0xffffffff); 234 QPainter p(&image); 235 p.drawText(0, h, "X\\"); 236 p.end(); 237 238 const int *bits = (const int *) ((const QImage &) image).bits(); 239 int bpl = image.bytesPerLine() / 4; 240 for (int y=0; y<w; ++y) { 241 for (int x=0; x<h; ++x) { 242 int r = qRed(bits[x]); 243 int g = qGreen(bits[x]); 244 int b = qBlue(bits[x]); 245 if (r != g || r != b) { 246 qt_applefontsmoothing_enabled = true; 247 return; 248 } 249 } 250 bits += bpl; 251 } 252 qt_applefontsmoothing_enabled = false; 232 253 } 233 254 … … 773 794 it->lastUpdateWidget = widget; 774 795 } else if (it->lastUpdateWidget == widget) { 775 // Update the gl wigets that the widget intersected the last time around, 776 // and that we are not intersecting now. This prevents paint errors when the 796 // Update the gl wigets that the widget intersected the last time around, 797 // and that we are not intersecting now. This prevents paint errors when the 777 798 // intersecting widget leaves a gl widget. 778 799 qt_post_window_change_event(glWidget); 779 it->lastUpdateWidget = 0; 800 it->lastUpdateWidget = 0; 780 801 } 781 802 } … … 809 830 // don't remove this line! 810 831 qt_event_request_window_change(); 811 812 // Post update request on gl widgets unconditionally. 832 833 // Post update request on gl widgets unconditionally. 813 834 if (qt_widget_private(widget)->isGLWidget == true) { 814 835 qt_post_window_change_event(widget); … … 1215 1236 QApplicationPrivate::qt_mac_apply_settings(); 1216 1237 1217 qt_mac_read_fontsmoothing_settings();1218 1219 1238 // Cocoa application delegate 1220 1239 #ifdef QT_MAC_USE_COCOA … … 1254 1273 priv->native_modal_dialog_active = false; 1255 1274 1275 qt_mac_read_fontsmoothing_settings(); 1256 1276 } 1257 1277 … … 1706 1726 // (actually two events; one for horizontal and one for vertical). 1707 1727 // As a results of this, and to make sure we dont't receive duplicate events, 1708 // we try to detect when this happend by checking the 'compatibilityEvent'. 1728 // we try to detect when this happend by checking the 'compatibilityEvent'. 1709 1729 SInt32 mdelt = 0; 1710 1730 GetEventParameter(event, kEventParamMouseWheelSmoothHorizontalDelta, typeSInt32, 0, … … 2577 2597 delete QApplicationPrivate::popupWidgets; 2578 2598 QApplicationPrivate::popupWidgets = 0; 2579 2599 2580 2600 // Special case for Tool windows: since they are activated and deactived together 2581 2601 // with a normal window they never become the QApplicationPrivate::active_window.
Note:
See TracChangeset
for help on using the changeset viewer.