You are looking for this:
ui.label->hide();
^^^
Your label is part of the generated ui file and so on. You probably have a ui member, so that is what you need to use.
I would personally work with a heap object, aka. pointer, instead of stack object, but that is not why you are getting the compilation issue for sure.