! * Populates the menu \c menu with the image and image-view relevant actions. * The menu is used * - as the context menu in DatapickerImageView * - as the "datapicker menu" in the main menu-bar (called form MainWin) * - as a part of the image context menu in project explorer */
| 255 | * - as a part of the image context menu in project explorer |
| 256 | */ |
| 257 | void DatapickerImageView::createContextMenu(QMenu* menu) const { |
| 258 | Q_ASSERT(menu); |
| 259 | |
| 260 | QAction* firstAction = nullptr; |
| 261 | // if we're populating the context menu for the project explorer, then |
| 262 | // there're already actions available there. Skip the first title-action |
| 263 | // and insert the action at the beginning of the menu. |
| 264 | if (menu->actions().size() > 1) |
| 265 | firstAction = menu->actions().at(1); |
| 266 | |
| 267 | menu->insertAction(firstAction, addCurveAction); |
| 268 | menu->insertSeparator(firstAction); |
| 269 | menu->insertMenu(firstAction, m_navigationMenu); |
| 270 | menu->insertSeparator(firstAction); |
| 271 | menu->insertMenu(firstAction, m_viewMouseModeMenu); |
| 272 | menu->insertMenu(firstAction, m_zoomMenu); |
| 273 | menu->insertMenu(firstAction, m_magnificationMenu); |
| 274 | menu->insertSeparator(firstAction); |
| 275 | } |
| 276 | |
| 277 | void DatapickerImageView::fillToolBar(QToolBar* toolBar) { |
| 278 | toolBar->addSeparator(); |