qt - QTableWidget: How can I get tighter lines with less vertical spacing padding? -


Great for simple grid display. Changing colors, fonts, etc. is straightforward.

However, I did not manage to give the grid a 'hard' look with a less vertical whistle. I see around Qt documentation talks (like)

  • margins
  • border
  • padding

Widgets, but when I set them up, I get the change around the whole grid widget instead of inside.

How can I set it (with style sheet or hard-coded option) to make the QTableWidget display harder?

The code for 'yes' may be incorrect This was just an example. Copy & amp; Paste the rudimentary code instead of the following, change the value in "SetDefaultSectionSize ()", recompile it and run. You should see the difference that it determines the visible result of 10 or 50 yields. In the above code, it is possible that QFontMetrics or QFont is doing something wrong.

Whatever height you want to use, you can use it, but the font size is most understandable.

  #include & lt; QtGui & gt; Int main (int argc, char * argv []) {Q Application app (argc, argv); QDialog * my_dialog = New QDialog (); QHBoxLayout * layout = new QHBoxLayout (); QTableWidget * my_table_widget = new QTableWidget (my_dialog); My_table_widget-> Settokount (10); My_table_widget-> Set column count (10); My_table_widget-> Vertical header () - & gt; Set Default Sizes (15); Layout-> Advert (my_table_widget); My_dialog- & gt; Set layout (layout); My_dialog- & gt; Resize (500, 200); My_dialog- & gt; Show (); Return app.exec (); }  

Edit: I do not know how to format a block of code ... forgive me ...

2 Edit : I've decided that, with the following simple tighterTable.pro file helps.

  templates = app target = dendendpet + =. Include + = source = + tighterTable.cpp # if this is the filename  

Thanks a big fat bunch for this. BTW: Editing in the form of code is only indenting from four places, and / or with the button '101010' at least in the formatting row.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -