| 110 | } |
| 111 | |
| 112 | bool ElaMenu::isHasIcon() const |
| 113 | { |
| 114 | QList<QAction*> actionList = this->actions(); |
| 115 | for (auto action: actionList) |
| 116 | { |
| 117 | if (action->isSeparator()) |
| 118 | { |
| 119 | continue; |
| 120 | } |
| 121 | QMenu* menu = action->menu(); |
| 122 | if (menu && (!menu->icon().isNull() || !menu->property("ElaIconType").toString().isEmpty())) |
| 123 | { |
| 124 | return true; |
| 125 | } |
| 126 | if (!action->icon().isNull() || !action->property("ElaIconType").toString().isEmpty()) |
| 127 | { |
| 128 | return true; |
| 129 | } |
| 130 | } |
| 131 | return false; |
| 132 | } |
| 133 | |
| 134 | void ElaMenu::showEvent(QShowEvent* event) |
| 135 | { |