Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/kernel/qapplication_mac.mm

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    228228static void qt_mac_read_fontsmoothing_settings()
    229229{
    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;
    232253}
    233254
     
    773794            it->lastUpdateWidget = widget;
    774795        } 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
    777798            // intersecting widget leaves a gl widget.
    778799            qt_post_window_change_event(glWidget);
    779             it->lastUpdateWidget = 0;           
     800            it->lastUpdateWidget = 0;
    780801        }
    781802    }
     
    809830    // don't remove this line!
    810831    qt_event_request_window_change();
    811    
    812     // Post update request on gl widgets unconditionally. 
     832
     833    // Post update request on gl widgets unconditionally.
    813834    if (qt_widget_private(widget)->isGLWidget == true) {
    814835        qt_post_window_change_event(widget);
     
    12151236        QApplicationPrivate::qt_mac_apply_settings();
    12161237
    1217     qt_mac_read_fontsmoothing_settings();
    1218 
    12191238    // Cocoa application delegate
    12201239#ifdef QT_MAC_USE_COCOA
     
    12541273   priv->native_modal_dialog_active = false;
    12551274
     1275   qt_mac_read_fontsmoothing_settings();
    12561276}
    12571277
     
    17061726            // (actually two events; one for horizontal and one for vertical).
    17071727            // 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'.
    17091729            SInt32 mdelt = 0;
    17101730            GetEventParameter(event, kEventParamMouseWheelSmoothHorizontalDelta, typeSInt32, 0,
     
    25772597        delete QApplicationPrivate::popupWidgets;
    25782598        QApplicationPrivate::popupWidgets = 0;
    2579        
     2599
    25802600        // Special case for Tool windows: since they are activated and deactived together
    25812601        // with a normal window they never become the QApplicationPrivate::active_window.
Note: See TracChangeset for help on using the changeset viewer.