Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
QRootContextMenu.h
Go to the documentation of this file.
1// Author: Sergey Linev 2/07/2026
2
3/*************************************************************************
4 * Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOT_QRootContextMenu
12#define ROOT_QRootContextMenu
13
14#include <QObject>
15#include <QString>
16#include <QColor>
17
18#include "TContextMenuImp.h"
19#include "TObject.h"
20#include "TList.h"
21#include <map>
22
23class QSignalMapper;
24class TList;
25class QAction;
26class QMenu;
27
28class QRootContextMenu : public QObject, public TObject, public TContextMenuImp {
29 Q_OBJECT
30
31public slots:
32 void executeMenu(int id);
33
34protected:
35
37 std::map<int, void*> fCustomArg;
38 QAction* addMenuAction(QMenu *menu, QSignalMapper *map, const QString &text, int id, void *arg = nullptr);
39
40public:
41 QRootContextMenu(TContextMenu *c = nullptr, const char *name = "ROOT Context Menu");
42 ~QRootContextMenu() override;
43
44 void DisplayPopup(Int_t x, Int_t y) override;
45 void Dialog(TObject *object, TMethod *method) override;
46 void Dialog(TObject *object, TFunction *function) override;
47
48 void RecursiveRemove(TObject *obj) override;
49};
50
51#endif
#define c(i)
Definition RSha256.hxx:101
Option_t Option_t TPoint TPoint const char text
char name[80]
Definition TGX11.cxx:142
This class provides an interface to context-sensitive popup menus.
void executeMenu(int id)
Execute specified menu item.
void Dialog(TObject *object, TMethod *method) override
Create dialog object with OK and Cancel buttons.
void RecursiveRemove(TObject *obj) override
Handle remove of some ROOT objects.
QRootContextMenu(TContextMenu *c=nullptr, const char *name="ROOT Context Menu")
Create context menu.
QAction * addMenuAction(QMenu *menu, QSignalMapper *map, const QString &text, int id, void *arg=nullptr)
Register menu action in signal map.
~QRootContextMenu() override
Delete a context menu.
std::map< int, void * > fCustomArg
void DisplayPopup(Int_t x, Int_t y) override
Display context popup menu for currently selected object.
This class provides an interface to GUI independent context sensitive popup menus.
This class provides an interface to context sensitive popup menus.
Global functions class (global functions are obtained from CINT).
Definition TFunction.h:30
A doubly linked list.
Definition TList.h:38
Each ROOT class (see TClass) has a linked list of methods.
Definition TMethod.h:38
Mother of all ROOT objects.
Definition TObject.h:42
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17