Changeset 769 for trunk/src/gui/widgets/qcombobox.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/widgets/qcombobox.cpp
r651 r769 77 77 # include <private/qeffects_p.h> 78 78 #endif 79 80 81 82 79 83 QT_BEGIN_NAMESPACE 80 84 … … 140 144 break; 141 145 } 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 } 143 150 menuOption.text = index.model()->data(index, Qt::DisplayRole).toString() 144 151 .replace(QLatin1Char('&'), QLatin1String("&&")); … … 533 540 const bool usePopup = combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo); 534 541 #ifndef QT_NO_SCROLLBAR 542 535 543 if (usePopup) 536 544 view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); 545 537 546 #endif 538 547 if (combo->style()->styleHint(QStyle::SH_ComboBox_ListMouseTracking, &opt, combo) || … … 608 617 combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo)); 609 618 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 611 626 QWidget::changeEvent(e); 612 627 } … … 2411 2426 listRect.moveLeft(above.x()); 2412 2427 2428 2413 2429 // Position vertically so the curently selected item lines up 2414 2430 // with the combo box. … … 2416 2432 const int offset = listRect.top() - currentItemRect.top(); 2417 2433 listRect.moveTop(above.y() + offset - listRect.top()); 2434 2418 2435 2419 2436 … … 2422 2439 // important to show as much as possible of the popup. 2423 2440 const int height = !boundToScreen ? listRect.height() : qMin(listRect.height(), screen.height()); 2441 2442 2443 2444 2424 2445 listRect.setHeight(height); 2446 2447 2425 2448 if (boundToScreen) { 2426 2449 if (listRect.top() < screen.top()) … … 2429 2452 listRect.moveBottom(screen.bottom()); 2430 2453 } 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2431 2471 } else if (!boundToScreen || listRect.height() <= belowHeight) { 2432 2472 listRect.moveTopLeft(below); … … 2637 2677 d->updateLineEditGeometry(); 2638 2678 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 2639 2712 // ### need to update scrollers etc. as well here 2640 2713 break;
Note:
See TracChangeset
for help on using the changeset viewer.