European colonialism in China followed essentially the same pattern as it did at first in India, taking small but commercially-valuable ports. India was crowded with tiny states so Europeans could easily divide and conquer, and win the loyalties of local elites, but no such thing was possible in China.
For an idea of how a European invasion of China would have gone, we can just look at what happened when Japan invaded- the Japanese, a great power with an industrializing economy and one of the world's more efficient armies, against a Chinese state that was arguably in worse shape than it was under the Ming. The end result? A 15-year-long war that cost the Japanese army one million dead and another million wounded, an occupation so brutal that it embittered a whole continent towards Japan for generations afterwards, and no permanent gains for Japan at all.
Consider also that Japan was both way closer to China than any European colonizer, and much more populous than them, and also benefited from a bigger technological gap than EUIV-era Europeans would have. I think, all things considered, Europe was smart not to try this out.