Ignore:
Timestamp:
Aug 11, 2025, 5:45:54 PM (2 months ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
5718cc
Parents:
ae9ad6
git-author:
Frederik Heber <frederik.heber@…> (07/20/25 20:19:22)
git-committer:
Frederik Heber <frederik.heber@…> (08/11/25 17:45:54)
Message:

Adds context menu "atom" to GLWorldView.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Qt4/QtMainWindow.cpp

    rae9ad6 r9cdab3  
    134134  toolbar->addFavoriteActionItems(20);
    135135  addToolBar(toolbar);
     136
     137  // add context menu on right click
     138  glWorldView->setContextMenuPolicy(Qt::CustomContextMenu);
     139  connect(glWorldView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(slotContextMenuRequested(const QPoint&)));
    136140
    137141  setCentralWidget(splitter1);
     
    193197}
    194198
     199void QtMainWindow::slotContextMenuRequested(const QPoint &pos)
     200{
     201  // pick the atoms menu
     202  QtMenu<QMenu_tooltip> * atoms_submenu = MainMenu->findSubmenu("atom");
     203  // and show it
     204  if (atoms_submenu != NULL) {
     205    atoms_submenu->popup(glWorldView->mapToGlobal(pos));
     206  } else {
     207    ELOG(1, "Could not find atom submenu.");
     208  }
     209}
    195210QtMainWindow::~QtMainWindow()
    196211{
Note: See TracChangeset for help on using the changeset viewer.