Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/widgets/qcombobox.cpp

    r651 r769  
    7777# include <private/qeffects_p.h>
    7878#endif
     79
     80
     81
     82
    7983QT_BEGIN_NAMESPACE
    8084
     
    140144        break;
    141145    }
    142 
     146    if (qVariantCanConvert<QBrush>(index.data(Qt::BackgroundRole))) {
     147        menuOption.palette.setBrush(QPalette::All, QPalette::Background,
     148                                    qvariant_cast<QBrush>(index.data(Qt::BackgroundRole)));
     149    }
    143150    menuOption.text = index.model()->data(index, Qt::DisplayRole).toString()
    144151                           .replace(QLatin1Char('&'), QLatin1String("&&"));
     
    533540    const bool usePopup = combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo);
    534541#ifndef QT_NO_SCROLLBAR
     542
    535543    if (usePopup)
    536544        view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     545
    537546#endif
    538547    if (combo->style()->styleHint(QStyle::SH_ComboBox_ListMouseTracking, &opt, combo) ||
     
    608617                               combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo));
    609618        setFrameStyle(combo->style()->styleHint(QStyle::SH_ComboBox_PopupFrameStyle, &opt, combo));
    610     }
     619#ifdef QT_SOFTKEYS_ENABLED
     620    } else if (e->type() == QEvent::LanguageChange) {
     621        selectAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::SelectSoftKey));
     622        cancelAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::CancelSoftKey));
     623#endif
     624    }
     625
    611626    QWidget::changeEvent(e);
    612627}
     
    24112426        listRect.moveLeft(above.x());
    24122427
     2428
    24132429        // Position vertically so the curently selected item lines up
    24142430        // with the combo box.
     
    24162432        const int offset = listRect.top() - currentItemRect.top();
    24172433        listRect.moveTop(above.y() + offset - listRect.top());
     2434
    24182435
    24192436
     
    24222439        // important to show as much as possible of the popup.
    24232440        const int height = !boundToScreen ? listRect.height() : qMin(listRect.height(), screen.height());
     2441
     2442
     2443
     2444
    24242445        listRect.setHeight(height);
     2446
     2447
    24252448        if (boundToScreen) {
    24262449            if (listRect.top() < screen.top())
     
    24292452                listRect.moveBottom(screen.bottom());
    24302453        }
     2454
     2455
     2456
     2457
     2458
     2459
     2460
     2461
     2462
     2463
     2464
     2465
     2466
     2467
     2468
     2469
     2470
    24312471    } else if (!boundToScreen || listRect.height() <= belowHeight) {
    24322472        listRect.moveTopLeft(below);
     
    26372677            d->updateLineEditGeometry();
    26382678        d->setLayoutItemMargins(QStyle::SE_ComboBoxLayoutItem);
     2679
     2680
     2681
     2682
     2683
     2684
     2685
     2686
     2687
     2688
     2689
     2690
     2691
     2692
     2693
     2694
     2695
     2696
     2697
     2698
     2699
     2700
     2701
     2702
     2703
     2704
     2705
     2706
     2707
     2708
     2709
     2710
     2711
    26392712        // ### need to update scrollers etc. as well here
    26402713        break;
Note: See TracChangeset for help on using the changeset viewer.