diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-11-29 15:30:52 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2016-12-07 13:21:20 +0000 |
commit | 4077fcc6153493284b5e2b0812ff215b49e8c8b7 (patch) | |
tree | 83f2643e479437b69388255a400c981dea74f8cc /src/plugins/platforms/cocoa/qcocoamenu.mm | |
parent | 630f8e7ad6e94c703f85fa11a9926ba83c478e72 (diff) |
QHostAddress: fix assignment operators
QHostAddress allowed assignment from a QString, but the respective
constructor is explicit, and rightfully so. So it does not make
sense that the assignment operator is provided, because of the
asymmetry caused between
QHostAddress addr = funcReturningQString(); // ERROR
addr = funcReturningQString(); // OK (until now)
By the same token, since SpecialAddress is implicitly convertible
to QHostAddress, provide the missing assignment operator from that
enum.
Add tests, rewriting the _data() function to use the enum instead
of an int to pass SpecialAddress values, and to test !=, too.
Added setAddress(SpecialAddress), since a) it was missing and
b) to share code between the ctor and the assignment operator.
Change-Id: Ief64c493be13ada8c6968801d9ed083b267fa902
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenu.mm')
0 files changed, 0 insertions, 0 deletions