Commit 8a13a363 authored by Frederik Gladhorn's avatar Frederik Gladhorn

Use qobject_cast instead of dynamic_cast

It's faster and doesn't force rtti.
parent facef2d2
......@@ -142,17 +142,17 @@ bool adjustIcon(QIcon *icon)
void updateIconCommon(QObject *object)
{
QAbstractButton* button = dynamic_cast<QAbstractButton*>(object);
QAbstractButton* button = qobject_cast<QAbstractButton*>(object);
if (button) {
updateIcon(button);
}
QComboBox* comboBox = dynamic_cast<QComboBox*>(object);
QComboBox* comboBox = qobject_cast<QComboBox*>(object);
if (comboBox) {
updateIcon(comboBox);
}
QAction* action = dynamic_cast<QAction*>(object);
QAction* action = qobject_cast<QAction*>(object);
if (action) {
updateIcon(action);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment