Issue
I have been wrestling with html and css in QTextBrowser for the past two days in PySide.
My intent is to create a TV monitor like screen to show main text in the center and some side information on the right hand side and possibly some error message at the bottom of the screen. I am not sure if table is the correct way to go by the way.
I want to know how to use html and css to get a table that spans 100% in both directions. I now have a problem with the height of table. According to the Qt doc Supported HTML Subset, table
supports the following attributes: border, bgcolor (Qt color names or #RRGGBB), cellspacing, cellpadding, width (absolute or relative), and height.
However, when I specify height like this:
table{
width: 100%;
height: 100%
}
in css
or inline like this: <table border="1" height:100%>
. Neither works.
Any help is greatly appreciated.
Solution
Have you looked into using QGridLayout
?
It has a lot of great functionality for filling up a space with the widgets in the right place.
You have a lot of control over the stretch, percentages, fixed, minimum, maximum, aspects of the sizes.
In each of the cells of the grid layout, you put the widget that you are planning on using.
For you, it sounds like most of them are going to be QLabel
s. If there is going to be some scrolling text, you could use QTextEdit
or QTextDocument
or QTextBrowser
.
Hope that helps.
Answered By - phyatt
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.