Quantum Hall effect with realistic boundary conditions