I was told:
"Filing I-485 will terminate your nonimmigration student status. Therefore, you won't be able to use OPT-EAD after July.
I suggest you change to H4 status before filing I-485. This way, even if 485 is denied, you will maintain H4 status.
If you file I-485 first, you won't be able to change status from OPT to H4. "