At a urinal, no problem. Unzip, business, zip, wash, go.
In a stall, also no problem. Undo your belt, take down your trousers (sit down at this point if you like), and rebuckle your belt at it's loosest setting just above knee level. Use outward pressure from your legs to maintain tension on the belt. Sit down now if you haven't already, and do your business. This keeps your gun ready to use, you can't forget to take it with you when you leave, it keeps it off the floor where people in neighboring stalls can see and/or grab it, and it keeps your pants from falling onto a nasty, filthy restroom floor.