开发者

Python Qt: embedded html bug?

开发者 https://www.devze.com 2022-12-17 20:12 出处:网络
Here is a strange thing that is happening... I have used embedded html with Qt Python to display a form inside the GUI/Widget. The problem is, if the cell has more content, it shows a black shadow lik

Here is a strange thing that is happening... I have used embedded html with Qt Python to display a form inside the GUI/Widget. The problem is, if the cell has more content, it shows a black shadow like a box on the right side of that cell/table.

Here is an example of the code working fine:

    html += ("<BR><BR><table border='0' cellspacing='0' cellpadding='0'>"
                    "<tr>"
                        "<td bgcolor='#000000'>"

                        "<table border='0' cellspacing='1' cellpadding='4'>"
                        "<tr>"
                            "<TD WIDTH=837 bgcolor='#FFFFFF'><font size='4' color='black'><DIV align=center><B> StackOverFlow Forum<BR>YOUR FAVORITE WEB SITE</DIV></font></td>"
                        "</tr>"
                        "</table>"

                        "</td>"
                    "</tr>"
                "</table>"
                )

As expected, the first example shows this:

+----------------------------------------------------+  
|                STACKOVERFLOW FORUM                 |  
|              YOUR FAVORITE WEB SITE                |  
+----------------------------------------------------+  

then in the sequence, the same code,开发者_C百科 but with a little more content to that cell:

    html += ("<table border='0' cellspacing='0' cellpadding='0'>"
                    "<tr>"
                        "<td bgcolor='#000000'>"

                        "<table border='0' cellspacing='1' cellpadding='4'>"
                        "<tr>"
                            "<TD WIDTH=837 bgcolor='#FFFFFF'><font size='4' color='black'><DIV align=center><B>STACKOVERFLOW FORUM STACKOVERFLOW FORUM STACKOVERFLOW FORUM STACKOVERFLOW FORUM STACKOVERFLOW FORUM<BR>YOUR FAVORITE WEB SITE </DIV></font></td>"
                        "</tr>"
                        "</table>"

                        "</td>"
                    "</tr>"
                "</table>"
                )

For the second, it shows a black shadow/box on the right-side of the table, just like this.

+----------------------------------------------------+||||  
|     STACKOVERFLOW FORUM STACKOVERFLOW FORUM ...    |||||  
|           YOUR FAVORITE WEB SITE                   |||||  
+----------------------------------------------------+||||  

So, quite strange, considering that it is exactly the same code, only the second having more text inside it.

Any suggestion?


If this is an exact snippet from you code then problem may be connected with the fact that you don't have closing </b> tag. If that doesn't help try removing <div> and adding align='center' to <td>

0

精彩评论

暂无评论...
验证码 换一张
取 消