Changed qBound implementation to better reflect what's in Qt.