The code you show explicitly invokes the assignment of the base class, i.e. only parts of the QStyleOptionButton base class are assigned, but not member variables of the object.
It’s clear from the documentation that no operator= declared for QStyleOptionButton , so if someone called the usual assignment on such an object, the compiler would try to generate such an operator consisting of the assignment of each subobject of the base class and each member variable.
Such a generated statement may or may not compile, depending on whether all members and base classes can be copied. In such cases, it is usually necessary to define the operator manually in order to correctly perform the assignment if the class must be completely copied.
However, the likely reason for explicitly assigning a base class assignment is that you really need to copy only parts of the base class, while other members of the class should not change, so this is not a “real assignment” in the semantic sense.
source share