Hide the icon in the editor combobox (but not in its popup)

Otherwise we have the lock icon from the tool button and from the combo
box next to each other.

Change-Id: I74d0ba42cd38ea37f2f8aa7e8d08a733174f1dce
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Eike Ziller
2011-12-09 16:45:49 +01:00
parent cb8ec57cbc
commit 121e12701f
2 changed files with 3 additions and 1 deletions

View File

@@ -135,6 +135,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
connect(d->m_goBackAction, SIGNAL(triggered()), this, SIGNAL(goBackClicked()));
connect(d->m_goForwardAction, SIGNAL(triggered()), this, SIGNAL(goForwardClicked()));
d->m_editorList->setProperty("hideicon", true);
d->m_editorList->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
d->m_editorList->setMinimumContentsLength(20);
d->m_editorList->setModel(d->m_editorsListModel);

View File

@@ -698,8 +698,9 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
painter->save();
QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, widget);
QPalette customPal = cb->palette;
bool drawIcon = !(widget && widget->property("hideicon").toBool());
if (!cb->currentIcon.isNull()) {
if (!cb->currentIcon.isNull() && drawIcon) {
QIcon::Mode mode = cb->state & State_Enabled ? QIcon::Normal
: QIcon::Disabled;
QPixmap pixmap = cb->currentIcon.pixmap(cb->iconSize, mode);