Skip to content

Commit

Permalink
emit signal with no arguments, for being able to safely connect with …
Browse files Browse the repository at this point in the history
…slot with arguments by value

Fixes root-project#7195
  • Loading branch information
ferdymercury committed Feb 16, 2021
1 parent a3c0cc5 commit a6fdb1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions gui/gui/inc/TGComboBox.h
Expand Up @@ -143,6 +143,7 @@ class TGComboBox : public TGCompositeFrame, public TGWidget {
virtual void Selected(Int_t widgetId, Int_t id); // *SIGNAL*
virtual void Selected(Int_t id) { Emit("Selected(Int_t)", id); } // *SIGNAL*
virtual void Selected(const char *txt) { Emit("Selected(char*)", txt); } // *SIGNAL*
virtual void Selected() { Emit("Selected()"); } // *SIGNAL*
virtual void ReturnPressed(); // *SIGNAL*
virtual void SavePrimitive(std::ostream &out, Option_t *option = "");

Expand Down
4 changes: 3 additions & 1 deletion gui/gui/src/TGComboBox.cxx
Expand Up @@ -464,6 +464,7 @@ void TGComboBox::Select(Int_t id, Bool_t emit)
if (emit) {
Selected(fWidgetId, id);
Selected(id);
Selected();
}
}
}
Expand Down Expand Up @@ -609,6 +610,7 @@ Bool_t TGComboBox::ProcessMessage(Long_t msg, Long_t, Long_t parm2)
}
Selected(fWidgetId, (Int_t)parm2);
Selected((Int_t)parm2);
Selected();
fClient->NeedRedraw(this);
break;
}
Expand All @@ -621,7 +623,7 @@ Bool_t TGComboBox::ProcessMessage(Long_t msg, Long_t, Long_t parm2)
}

////////////////////////////////////////////////////////////////////////////////
/// Emit signal.
/// Emit signal, done only when selected entry changed.

void TGComboBox::Selected(Int_t widgetId, Int_t id)
{
Expand Down

0 comments on commit a6fdb1d

Please sign in to comment.