1

In this answer, the answerer uses the | operator: Yes/No message box using QMessageBox

According to the documentation, that argument is supposed to be StandardButtons.

So the | operator merges two StandardButton into one StandardButtons?

I've tried looking through the Qt documentation, but there is none on operators. So it must be a C++ operator?

Community
  • 1
  • 1

1 Answers1

4

| is the bitwise OR operator, which is commonly used to combine enum values (assuming that the integers backing the enum values are powers of two). In this case, the code specifies that it wishes to have both a Yes and a No button. (Note that this is standard C++ syntax and nothing Qt specific.)

Aasmund Eldhuset
  • 37,289
  • 4
  • 68
  • 81