Priority encoder and normal encoder
Your if-else and case(1'b1) are both priority encoders. A normal encoder would look like the following:

always @*
  begin
    Q2Q1Q0 = 3'b000;
    case ({D7,D6,D5,D4,D3,D2,D1,D0})
      8'h01: Q2Q1Q0 = 3'b000;
      8'h02: Q2Q1Q0 = 3'b001;
      8'h04: Q2Q1Q0 = 3'b010;
      8'h08: Q2Q1Q0 = 3'b011;
      8'h10: Q2Q1Q0 = 3'b100;
      8'h20: Q2Q1Q0 = 3'b101;
      8'h40: Q2Q1Q0 = 3'b110;
      8'h80: Q2Q1Q0 = 3'b111;
    endcase
  end


A normal encoder considers the whole input expression and only one bit must be one. If more bits are one then no conditions are meet (default and/or error condition depending it is coded).

Priority encoders have precedence to bits if two more more bits are high. If the input is 8'h12 then either 1 or 5 (depending on the priority order) will be returned. A normal encoder will return 0 (and/or an error) because the input is not one-hot. See the true table below.

$$
\begin{array}{r|lcr|lcr|l} \
\text{Normal} &amp;&amp;&amp; \text{Priority (LSB)} &amp;&amp;&amp; \text{Priority (MSB)} \\
00000001 &amp; 000 &amp;&amp; ???????1&amp;000 &amp;&amp; 00000001 &amp; 000 \\
00000010 &amp; 001 &amp;&amp; ??????10&amp;001 &amp;&amp; 0000001? &amp; 001 \\
00000100 &amp; 010 &amp;&amp; ?????100&amp;010 &amp;&amp; 000001?? &amp; 010 \\
00001000 &amp; 011 &amp;&amp; ????1000&amp;011 &amp;&amp; 00001??? &amp; 011 \\
00010000 &amp; 100 &amp;&amp; ???10000&amp;100 &amp;&amp; 0001???? &amp; 100 \\
00100000 &amp; 101 &amp;&amp; ??100000&amp;101 &amp;&amp; 001????? &amp; 101 \\
01000000 &amp; 110 &amp;&amp; ?1000000&amp;110 &amp;&amp; 01?????? &amp; 110 \\
10000000 &amp; 111 &amp;&amp; 10000000&amp;111 &amp;&amp; 1??????? &amp; 111 \\
\color{blue}{\text{otherwise}} &amp; - \color{red}{\text{ [error]}} &amp;&amp; 00000000 &amp; - \color{red}{\text{ [error]}} &amp;&amp; 00000000 &amp; - \color{red}{\text{ [error]}} \\
\end{array}
$$

The syntax case(1'b1) compares a value to a list a variables and executes the first match. Where as typical case statements compares a variable to a list for values and executes the first match. By default case(1'b1) infers a priority encoder. However, the synthesizer may choose to use a normal encoder if it can determine the input is guaranteed to be one-hot and if it satisfies timing and resource requirements. Most synthesizer have pragmas that allows to user force the type. Pragma commands are not universal so you will need to refer to the manual. Note pragmas are for experts, only use them when required.