An orange inventory slot keeps anything placed there out of Quick Stack.

Alt-clicking an occupied main-inventory slot cycles between a yellow item-type exclusion, an orange slot exclusion and no exclusion. A slot exclusion stays at that position when the item moves. Alt-clicking an empty slot toggles its slot exclusion directly. These choices are saved for your character.