I have a QTableWidget displayed in a dialog as one widget among several. This table will always have exactly three columns and five rows. It works fine, but I’m not happy with the appearance. The table is laid out in such a way that it consumes more space than is strictly necessary to show only the 5 rows and 3 columns — the widget’s frame is larger than the actual table, so there’s white space along the right edge and bottom to make up the difference. No doubt there is some way to construct the widget so that it must take a specific number of pixels in each direction, but I’m hoping there’s some switch I don’t know about to tell the table “make yourself as large as necessary, but no larger.” Is there?
Second question: how can one get rid of the frame that appear around most widgets? For instance, on Windows, the QTableWidget appears in a “shadow box” (as though you are looking at it through a rectangular hole in a piece of cardboard). Likewise, the row and column headings appear in such a way that they look like buttons. How can they appear simply as text — more like a QLabel?
I’m new to Qt as of about 10 days ago, and liking it a lot.
Randall
↧