MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / slotCustomContextMenu

Method slotCustomContextMenu

App/Client/FrmActive.cpp:165–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163{}
164
165void CFrmActive::slotCustomContextMenu(const QPoint &pos)
166{
167 QMenu menu;
168 QModelIndex index = m_pTableView->currentIndex();
169 int r = index.row();
170 if(-1 < r && r < m_Operates.size())
171 {
172 QVariant v = m_pModel->item(index.row(), m_nId)->data();
173 COperate* c = v.value<COperate*>();
174 if(c) {
175 auto m = c->GetMenu();
176 //menu.addMenu(m);
177 if(m)
178 menu.addActions(m->actions());
179 }
180 }
181 if(!menu.isEmpty())
182 menu.addSeparator();
183 menu.addMenu(m_pRecentMenu);
184 menu.addMenu(m_pOperate);
185 menu.addAction(m_pStop);
186 menu.addSeparator();
187 menu.addAction(m_pAddToFavorite);
188 menu.exec(mapToGlobal(pos));
189}
190
191void CFrmActive::slotClicked(const QModelIndex &index)
192{

Callers

nothing calls this directly

Calls 3

dataMethod · 0.45
GetMenuMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected