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/qgtkpainter.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)
     
    4848// and takes care of converting all such calls into cached Qt pixmaps.
    4949
     50#include <private/qstylehelper_p.h>
    5051#include <QtGui/QWidget>
    5152#include <QtGui/QStyleOption>
     
    143144
    144145QGtkPainter::QGtkPainter(QPainter *_painter)
    145         : m_window(QGtkStylePrivate::gtkWidget(QLatin1String("GtkWindow")))
     146        : m_window(QGtkStylePrivate::gtkWidget("GtkWindow"))
    146147        , m_painter(_painter)
    147148        , m_alpha(true)
     
    156157{
    157158    // Note the widget arg should ideally use the widget path, though would compromise performance
    158     QString tmp = QString(QLS("%0-%1-%2-%3x%4-%5")).arg(key).arg(uint(state)).arg(shadow)
    159                           .arg(size.width()).arg(size.height()).arg(quintptr(widget));
     159    QString tmp = key
     160                  % HexString<uint>(state)
     161                  % HexString<uint>(shadow)
     162                  % HexString<uint>(size.width())
     163                  % HexString<uint>(size.height())
     164                  % HexString<quint64>(quint64(widget));
    160165    return tmp;
    161166}
     
    237242        rect.setHeight(2 * border + 1);
    238243
    239     QString gapExtras = QString(QLS("s %0 w %1 g %2")).arg(gap_side).arg(width).arg(x);
    240     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + gapExtras;
     244    QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget)
     245                         % HexString<uchar>(gap_side)
     246                         % HexString<gint>(width)
     247                         % HexString<gint>(x);
    241248
    242249    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
     
    303310
    304311    QString pixmapName = uniqueName(QLS(part), state, shadow,
    305                                     rect.size(), gtkWidget) + pmKey;
     312                                    rect.size(), gtkWidget) % pmKey;
    306313
    307314    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
     
    353360
    354361    QPixmap cache;
    355     QString hLineExtras = QString(QLS("%0 %1 %2")).arg(x1).arg(x2).arg(y);
    356362    QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget)
    357                          + hLineExtras + pmKey;
     363                         % HexString<int>(x1)
     364                         % HexString<int>(x2)
     365                         % HexString<int>(y)
     366                         % pmKey;
    358367    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
    359368        DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_hline (style,
     
    380389
    381390    QPixmap cache;
    382     QString vLineExtras = QString(QLS("%0 %1 %2")).arg(y1).arg(y2).arg(x);
    383     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(),
    384                                     gtkWidget) + vLineExtras +pmKey;
     391    QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget)
     392                        % HexString<int>(y1)
     393                        % HexString<int>(y2)
     394                        % HexString<int>(x)
     395                        % pmKey;
     396
    385397    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
    386398        DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_vline (style,
     
    408420
    409421    QPixmap cache;
    410     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(),
    411                                     gtkWidget) + QString::number(expander_state) + pmKey;
     422    QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget)
     423                         % HexString<uchar>(expander_state)
     424                         % pmKey;
     425
    412426    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
    413427        DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_expander (style, pixmap,
     
    432446
    433447    QPixmap cache;
    434     QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget) + pmKey;
     448    QString pixmapName = uniqueName(QLS(part), state, GTK_SHADOW_NONE, rect.size(), gtkWidget) % pmKey;
    435449    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
    436450        DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_focus (style, pixmap, state, NULL,
     
    457471
    458472    QPixmap cache;
    459     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + pmKey;
     473    QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) % pmKey;
    460474    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
    461475        DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_resize_grip (style, pixmap, state,
     
    482496
    483497    QPixmap cache;
    484     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) +
    485                          QString::number((int)arrow_type) + pmKey;
     498    QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size())
     499                         % HexString<uchar>(arrow_type)
     500                         % pmKey;
    486501
    487502    GdkRectangle gtkCliprect = {0, 0, rect.width(), rect.height()};
     
    514529    QPixmap cache;
    515530    QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size())
    516                          + QString::number(orientation);
     531                         % HexString<uchar>(orientation);
     532
    517533    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
    518534        DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_handle (style,
     
    542558
    543559    QPixmap cache;
    544     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) + pmKey;
     560    QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget) % pmKey;
    545561    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
    546562        DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_slider (style,
     
    573589    QRect r = rect;
    574590    QPixmap cache;
    575     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) + pmKey;
     591    QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) % pmKey;
    576592    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
    577593        DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_shadow(style, pixmap, state, shadow, NULL,
     
    592608    QRect r = rect;
    593609    QPixmap cache;
    594     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) + pmKey;
     610    QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) % pmKey;
    595611    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
    596612        DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_flat_box (style,
     
    619635    QRect r = rect;
    620636    QPixmap cache;
    621     QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget);
    622     pixmapName += QString::number(gap_pos);
     637    QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size(), gtkWidget)
     638                         % HexString<uchar>(gap_pos);
    623639
    624640    if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
Note: See TracChangeset for help on using the changeset viewer.