forked from openkylin/qt5-ukui-platformtheme
fixbug192192 combobox下拉框里有的有图标,有的没有图标时,文字需要跟图标对齐
This commit is contained in:
parent
3777b9f9d4
commit
2e672ea3cd
|
@ -5342,15 +5342,17 @@ void Qt5UKUIStyle::drawControl(QStyle::ControlElement element, const QStyleOptio
|
||||||
bool hasIcon = false;
|
bool hasIcon = false;
|
||||||
if(isComboBox)
|
if(isComboBox)
|
||||||
{
|
{
|
||||||
auto *comboBox = qobject_cast<const QComboBox*>(widget);
|
if(!menuItem->icon.isNull())
|
||||||
int column = comboBox->count();
|
|
||||||
for(int i = 0; i < column; i++)
|
|
||||||
{
|
|
||||||
if(!comboBox->itemIcon(i).isNull()){
|
|
||||||
hasIcon = true;
|
hasIcon = true;
|
||||||
break;
|
// auto *comboBox = qobject_cast<const QComboBox*>(widget);
|
||||||
}
|
// int column = comboBox->count();
|
||||||
}
|
// for(int i = 0; i < column; i++)
|
||||||
|
// {
|
||||||
|
// if(!comboBox->itemIcon(i).isNull()){
|
||||||
|
// hasIcon = true;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
else if(menuItem->maxIconWidth != 0)
|
else if(menuItem->maxIconWidth != 0)
|
||||||
hasIcon = true;
|
hasIcon = true;
|
||||||
|
|
Loading…
Reference in New Issue