Deductions & credits

Not quite....Correct It is taken off the FED so the Fed AGI is Without QCD

1)  NC brings in the Fed AGI
2 ) then the QCD is added back  to NC income (line 5 of the NC SCH S)
3)  Then the QCD is added to charity deductions on line  20 of the NC SCH S,  to take it back off as part of NC itemized deductions...so it ends up effectively the same as Fed AGI, as long as NC itemized deductions can be used.

Except....that sometimes the QCD plus other allowed NC itemized deductions are too small, and NC Std Ded is used...so then your QCD is added back to FED AGI, and never removed again....but that's the way NC legislature putzed with it.
.
____________*Answers are correct to the best of my knowledge when posted, but should not be considered to be legal or official tax advice.*