Quickcast is a base ability available to all level 5 cloth-wearing casters who do not specialize in weapons. This allows them to cast a single spell with a quickened casting time, but costs twice the power. It cannot be interrupted by melee or spells. The only exception to this is the Necromancer form of Quickcast (Facilitate Painworking). It allows the Necromancer's summoned undead pet to have six seconds of uninterrupted casting time.
Once a monster has engaged you in combat, either through melee, archery or spell casting, you will become too distracted to cast, and may need to rely on your melee weapon. Most casters have access to the Quickcast ability (or the Necromancer equivalent, Facilitate Painworking). This ability will allow you to cast a spell without interruption. Note that this only counts for an actual 'interruption' - spells that cause you to become unable to cast (such as a mesmerization or stun) will still stop you from casting, and Amnesia spells will not interrupt you, but will cause you to forget what you were doing – essentially halting your current cast. When you are interrupted, for a period of time afterwards, you will be unable to cast.