46 QGridLayout *gridLayout =
new QGridLayout(
this);
47 gridLayout->setSpacing(1);
48 gridLayout->setContentsMargins(1,1,1,1);
50 QHBoxLayout *buttLayout =
new QHBoxLayout();
52 QPushButton *bOk =
new QPushButton(
this);
53 bOk->setText(
"Apply");
54 QObject::connect(bOk, &QPushButton::clicked,
this, &QRootMethodDialog::accept);
55 buttLayout->addWidget(bOk);
57 QPushButton *bCancel =
new QPushButton(
this);
58 bCancel->setText(
"Cancel");
59 QObject::connect(bCancel, &QPushButton::clicked,
this, &QRootMethodDialog::reject);
60 buttLayout->addWidget(bCancel);
64 setSizePolicy(QSizePolicy(QSizePolicy::Expanding,
65 QSizePolicy::Expanding));
68 gridLayout->addLayout(buttLayout, 1, 0, Qt::AlignBottom);
76 QLabel* lbl =
new QLabel(argname);
79 QLineEdit* le =
new QLineEdit();
80 le->setGeometry(10,10, 130, 30);
93 if ((
n<0) || (
n>=
fArgs.size()))
return QString(
"");
103 if (!menu || !
object || !func)
112 while (
auto argument = (
TMethodArg *) next()) {
121 if (
type.CompareTo(
"enum") != 0)
122 std::cout <<
"*** Warning in Dialog(): data type is not basic type, assuming (int)\n";
132 if (
m &&
m->GetterMethod()) {
134 m->GetterMethod()->Init(
object->IsA(),
m->GetterMethod()->GetMethodName(),
"");
140 if (basictype ==
"char*") {
141 char *tdefval =
nullptr;
142 m->GetterMethod()->
Execute(
object,
"", &tdefval);
143 if (tdefval) val = tdefval;
145 if ((basictype ==
"float") ||
146 (basictype ==
"double")) {
148 m->GetterMethod()->
Execute(
object,
"", ddefval);
151 if ((basictype ==
"char") ||
152 (basictype ==
"int") ||
153 (basictype ==
"bool") ||
154 (basictype ==
"long") ||
155 (basictype ==
"short")) {
157 m->GetterMethod()->
Execute(
object,
"", ldefval);
164 if ((opt =
m->GetOptions()) !=
nullptr) {
175 if (argument->GetDefault())
176 argDflt = argument->GetDefault();
178 if ((argDflt.
Length() > 1) &&
179 (argDflt[0]==
'\"') && (argDflt[argDflt.
Length()-1]==
'\"')) {
189 if (exec() != QDialog::Accepted)
198 menu->
Execute(
object, func, &tobjlist);
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
constexpr Ssiz_t kNPOS
The equivalent of std::string::npos for the ROOT class TString.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
QVector< QLineEdit * > fArgs
QString getArg(int n)
Get argument value.
void addArg(const char *argname, const char *value, const char *type)
Add argument.
void methodDialog(TContextMenu *menu, TObject *object, TFunction *func)
Run method dialog.
QRootMethodDialog()
Create method dialog.
All ROOT classes may have RTTI (run time type identification) support added.
Basic data type descriptor (datatype information is obtained from CINT).
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
Global functions class (global functions are obtained from CINT).
TList * GetListOfMethodArgs()
Return list containing the TMethodArgs of a TFunction.
Each ROOT method (see TMethod) has a linked list of its arguments.
void AddLast(TObject *obj) override
Add object in the next empty slot in the array.
Collectable string class.
Mother of all ROOT objects.
virtual void Execute(const char *method, const char *params, Int_t *error=nullptr)
Execute method on this object with the given parameter string, e.g.
const char * Data() const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const