IIRC, for most items Qlvl=ilvl, and ilvl= mlvl of the monster that dropped it. However, for the coronet, diadem and tiaras the qlvl is higher (and dont remember by how much, 12 sticks in mind but that seems too high)
Imbueing only takes into account qlvl and Clvl, and is independant of dificulty, as RTB said.