Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/styles/qwindowsstyle.cpp

    r651 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4242#include "qwindowsstyle.h"
    4343#include "qwindowsstyle_p.h"
    44 #include <private/qstylehelper_p.h>
    4544
    4645#if !defined(QT_NO_STYLE_WINDOWS) || defined(QT_PLUGIN)
    4746
    48 #include "qlibrary.h"
     47#include <private/qsystemlibrary_p.h>
    4948#include "qapplication.h"
    5049#include "qbitmap.h"
     
    7170#include <qmath.h>
    7271
    73 
    7472#ifdef Q_WS_X11
    7573#include "qfileinfo.h"
     
    7775#include <private/qt_x11_p.h>
    7876#endif
     77
     78#include <private/qstylehelper_p.h>
    7979
    8080QT_BEGIN_NAMESPACE
     
    127127    if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
    128128        && QSysInfo::WindowsVersion < QSysInfo::WV_NT_based)) {
    129         QLibrary shellLib(QLatin1String("shell32"));
     129        QSystemLibrary shellLib(QLatin1String("shell32"));
    130130        pSHGetStockIconInfo = (PtrSHGetStockIconInfo)shellLib.resolve("SHGetStockIconInfo");
    131131    }
    132132#endif
     133    startTime.start();
    133134}
    134135
     
    506507#ifndef Q_OS_WINCE
    507508            NONCLIENTMETRICS ncm;
    508             ncm.cbSize = sizeof(NONCLIENTMETRICS);
     509            ncm.cbSize = FIELD_OFFSET(NONCLIENTMETRICS, lfMessageFont) + sizeof(LOGFONT);
    509510            if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0))
    510511                ret = qMax(ncm.iScrollHeight, ncm.iScrollWidth);
     
    930931{
    931932#ifdef Q_OS_WINCE
    932     HMODULE hmod = LoadLibrary(L"ceshell.dll");
     933    HMODULE hmod = LoadLibrary(L"ceshell");
    933934#else
    934     HMODULE hmod = LoadLibrary(L"shell32.dll");
     935    HMODULE hmod = QSystemLibrary::load(L"shell32");
    935936#endif
    936937    if( hmod ) {
     
    13971398            int size = qMin(r.height(), r.width());
    13981399            QPixmap pixmap;
    1399             QString pixmapName = QStyleHelper::uniqueName(QLatin1String("$qt_ia-") + QLatin1String(metaObject()->className()), opt, QSize(size, size))
    1400                   + QLatin1Char('-') + QString::number(pe);
     1400            QString pixmapName = QStyleHelper::uniqueName(QLatin1String("$qt_ia-")
     1401                                                          % QLatin1String(metaObject()->className()), opt, QSize(size, size))
     1402                                 % HexString<uint>(pe);
    14011403            if (!QPixmapCache::find(pixmapName, pixmap)) {
    14021404                int border = size/5;
    14031405                int sqsize = 2*(size/2);
    1404                 QImage image(sqsize, sqsize, QImage::Format_ARGB32);
    1405                 image.fill(Qt::transparent);
     1406                QImage image(sqsize, sqsize, QImage::Format_ARGB32_Premultiplied);
     1407                image.fill(0);
    14061408                QPainter imagePainter(&image);
    14071409
     
    19201922            }
    19211923
    1922             int xm = QWindowsStylePrivate::windowsItemFrame + checkcol + QWindowsStylePrivate::windowsItemHMargin;
     1924            int xm = int(QWindowsStylePrivate::windowsItemFrame) + checkcol + int(QWindowsStylePrivate::windowsItemHMargin);
    19231925            int xpos = menuitem->rect.x() + xm;
    19241926            QRect textRect(xpos, y + QWindowsStylePrivate::windowsItemVMargin,
     
    24042406    case CE_ProgressBarContents:
    24052407        if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) {
    2406 
    24072408            QRect rect = pb->rect;
     2409            if (!rect.isValid())
     2410                return;
     2411
    24082412            bool vertical = false;
    24092413            bool inverted = false;
     
    31143118                                &copy.palette.brush(QPalette::Button));
    31153119                copy.rect.adjust(4, 1, -5, -1);
    3116                 if (!enabled || !(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled) ) {
     3120                if ((!enabled || !(sb->stepEnabled & QAbstractSpinBox::StepUpEnabled))
     3121                    && proxy()->styleHint(SH_EtchDisabledText, opt, widget) )
     3122                {
    31173123                    QStyleOptionSpinBox lightCopy = copy;
    31183124                    lightCopy.rect.adjust(1, 1, 1, 1);
     
    31473153                                &copy.palette.brush(QPalette::Button));
    31483154                copy.rect.adjust(4, 0, -5, -1);
    3149                 if (!enabled || !(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled) ) {
     3155                if ((!enabled || !(sb->stepEnabled & QAbstractSpinBox::StepDownEnabled))
     3156                    && proxy()->styleHint(SH_EtchDisabledText, opt, widget) )
     3157                {
    31503158                    QStyleOptionSpinBox lightCopy = copy;
    31513159                    lightCopy.rect.adjust(1, 1, 1, 1);
     
    32283236            int checkcol = qMax<int>(maxpmw, QWindowsStylePrivate::windowsCheckMarkWidth); // Windows always shows a check column
    32293237            w += checkcol;
    3230             w += QWindowsStylePrivate::windowsRightBorder + 10;
     3238            w += int(QWindowsStylePrivate::windowsRightBorder) + 10;
    32313239            sz.setWidth(w);
    32323240        }
Note: See TracChangeset for help on using the changeset viewer.