| 54 | } |
| 55 | |
| 56 | QAction *YACReader::wrappedToolbarAction(QAction *action) |
| 57 | { |
| 58 | auto a = new QAction(action->text()); |
| 59 | |
| 60 | a->setEnabled(action->isEnabled()); |
| 61 | a->setCheckable(action->isCheckable()); |
| 62 | |
| 63 | a->setChecked(action->isChecked()); |
| 64 | |
| 65 | QObject::connect(a, &QAction::triggered, action, &QAction::triggered); |
| 66 | |
| 67 | QObject::connect(action, &QAction::changed, action, [=]() { |
| 68 | a->setEnabled(action->isEnabled()); |
| 69 | a->setCheckable(action->isCheckable()); |
| 70 | |
| 71 | a->setChecked(action->isChecked()); |
| 72 | }); |
| 73 | QObject::connect(a, &QAction::toggled, action, &QAction::setChecked); |
| 74 | QObject::connect(action, &QAction::toggled, a, &QAction::setChecked); |
| 75 | |
| 76 | // asign a to action somehow so we can retrieve it later |
| 77 | action->setProperty("wrappedToolbarAction", QVariant::fromValue<QObject *>(a)); |
| 78 | |
| 79 | return a; |
| 80 | } |
| 81 | |
| 82 | QPixmap YACReader::hdpiPixmap(const QString &file, QSize size) |
| 83 | { |