MCPcopy Create free account
hub / github.com/baldurk/renderdoc / bookmarkContextMenu

Method bookmarkContextMenu

qrenderdoc/Windows/EventBrowser.cpp:5769–5813  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5767}
5768
5769void EventBrowser::bookmarkContextMenu(QRClickToolButton *button, uint32_t EID)
5770{
5771 QMenu contextMenu(this);
5772
5773 QAction renameBookmark(tr("&Rename"), this);
5774 QAction deleteBookmark(tr("&Delete"), this);
5775
5776 renameBookmark.setIcon(Icons::page_white_edit());
5777 deleteBookmark.setIcon(Icons::del());
5778
5779 contextMenu.addAction(&renameBookmark);
5780 contextMenu.addAction(&deleteBookmark);
5781
5782 QObject::connect(&deleteBookmark, &QAction::triggered, [this, EID]() {
5783 m_Ctx.RemoveBookmark(EID);
5784 repopulateBookmarks();
5785 });
5786
5787 QObject::connect(&renameBookmark, &QAction::triggered, [this, button, EID]() {
5788 EventBookmark editedBookmark;
5789 for(const EventBookmark &bookmark : m_Ctx.GetBookmarks())
5790 {
5791 if(bookmark.eventId == EID)
5792 {
5793 editedBookmark = bookmark;
5794 break;
5795 }
5796 }
5797
5798 if(editedBookmark.eventId == EID)
5799 {
5800 bool ok;
5801 editedBookmark.text =
5802 QInputDialog::getText(this, lit("Rename"), lit("New name:"), QLineEdit::Normal,
5803 GetBookmarkDisplayText(editedBookmark), &ok);
5804 if(ok)
5805 {
5806 button->setText(GetBookmarkDisplayText(editedBookmark));
5807 m_Ctx.SetBookmark(editedBookmark);
5808 }
5809 }
5810 });
5811
5812 RDDialog::show(&contextMenu, QCursor::pos());
5813}
5814
5815void EventBrowser::ExpandNode(QModelIndex idx)
5816{

Callers

nothing calls this directly

Calls 10

connectFunction · 0.85
GetBookmarkDisplayTextFunction · 0.85
trFunction · 0.50
showFunction · 0.50
posFunction · 0.50
setIconMethod · 0.45
RemoveBookmarkMethod · 0.45
GetBookmarksMethod · 0.45
setTextMethod · 0.45
SetBookmarkMethod · 0.45

Tested by

no test coverage detected