Retirement tax questions

Thank you for the response, however it does not fully answer the question.  This question applies to a married, filing jointly tax return.  Total taxable income (AGI, including spouse W2 income, less solo 401K contribution) significantly exceeds the QBI.  If the 20% QBI deduction is applied to the lesser of the QBI or taxable income, shouldn't the deduction be applied to the schedule C net income?

Example:  Jack and Jill are filing a joint tax return.  Jack is a sole proprietor and has schedule C net income of $50,000.  Jack made a $15,000 solo 401K contribution, which reduces AGI as reported on 1040 line 7.  Jill has W2 income of $100,000.  Total taxable income is $135,000 (Schedule C - solo 401K + W2).  Shouldn't the QBI deduction be $10,000 (20% x $50,000 schedule C net income [since it is less than $135,000 taxable income])?