Changeset 846 for trunk/src/gui/styles/qgtkpainter.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/styles/qgtkpainter.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 48 48 // and takes care of converting all such calls into cached Qt pixmaps. 49 49 50 #include <private/qstylehelper_p.h> 50 51 #include <QtGui/QWidget> 51 52 #include <QtGui/QStyleOption> … … 143 144 144 145 QGtkPainter::QGtkPainter(QPainter *_painter) 145 : m_window(QGtkStylePrivate::gtkWidget( QLatin1String("GtkWindow")))146 : m_window(QGtkStylePrivate::gtkWidget("GtkWindow")) 146 147 , m_painter(_painter) 147 148 , m_alpha(true) … … 156 157 { 157 158 // 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)); 160 165 return tmp; 161 166 } … … 237 242 rect.setHeight(2 * border + 1); 238 243 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); 241 248 242 249 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { … … 303 310 304 311 QString pixmapName = uniqueName(QLS(part), state, shadow, 305 rect.size(), gtkWidget) +pmKey;312 rect.size(), gtkWidget) % pmKey; 306 313 307 314 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { … … 353 360 354 361 QPixmap cache; 355 QString hLineExtras = QString(QLS("%0 %1 %2")).arg(x1).arg(x2).arg(y);356 362 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; 358 367 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 359 368 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_hline (style, … … 380 389 381 390 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 385 397 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 386 398 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_vline (style, … … 408 420 409 421 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 412 426 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 413 427 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_expander (style, pixmap, … … 432 446 433 447 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; 435 449 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 436 450 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_focus (style, pixmap, state, NULL, … … 457 471 458 472 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; 460 474 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 461 475 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_resize_grip (style, pixmap, state, … … 482 496 483 497 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; 486 501 487 502 GdkRectangle gtkCliprect = {0, 0, rect.width(), rect.height()}; … … 514 529 QPixmap cache; 515 530 QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) 516 + QString::number(orientation); 531 % HexString<uchar>(orientation); 532 517 533 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 518 534 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_handle (style, … … 542 558 543 559 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; 545 561 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 546 562 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_slider (style, … … 573 589 QRect r = rect; 574 590 QPixmap cache; 575 QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) +pmKey;591 QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) % pmKey; 576 592 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 577 593 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_shadow(style, pixmap, state, shadow, NULL, … … 592 608 QRect r = rect; 593 609 QPixmap cache; 594 QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) +pmKey;610 QString pixmapName = uniqueName(QLS(part), state, shadow, rect.size()) % pmKey; 595 611 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) { 596 612 DRAW_TO_CACHE(QGtkStylePrivate::gtk_paint_flat_box (style, … … 619 635 QRect r = rect; 620 636 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); 623 639 624 640 if (!m_usePixmapCache || !QPixmapCache::find(pixmapName, cache)) {
Note:
See TracChangeset
for help on using the changeset viewer.