If you look for ideal elements fit, like in form in QTCreator, You don't have to use Layout.
Just put widgets on place, make it ALL proportional etc.
include class I put below, I put example too at the end
It works like a charm, if you will have to use QLayouts, make them MaxMin constraint, but results may be strange. When you use it, better forget about layouts ;)
we're storing our Qt build in our version management system
This is a strange thing to do, since Qt guarantees binary compatibility between minor versions, but well, you're free to choose. Unfortunately, I don't see how you could decrease the size further, beside deleting the docs, as the libraries are in the /lib directory and they're the next biggest size. Maybe store only the libs that you're using, i.e. these that you're going to deploy. No point in keeping QtXml if you're not using it, right?
The QSizePolicy is set to Expanding, because I want the table should take all the space by default. Anyway I tried to set it to Minimum but nothing changes. It seems something force the minimum size of the table, but I printed out the actual minimumSize value and is set to 0, even after adding the contents.
The thing is, that i need this dots to be separate items, since they are used as clickable buttons. I tried to inherit from QTreeView and override drawRow, but when i do that, i need to override visualRect, indexAt and some other methods too, and that's realy inconvenient. Is there another way to reach my goals with QTreeView , or do i need to inherit from QAbstractItemView, and implement this kind of TreeView myself?
My TreeView is floating and I want its maximun width to be synchronized with its column content.
But I also want to let the possibility to the user to reduce this size manually.
I'd do something like :
The thing is that toolbars don't really display icons. They display widgets (that can have icons). By default when you add an action to a toolbar a QToolButton is created for it, but you are not limited to that and can add any widget e.g. an expanding line edit, combobox or a button with an icon and text. All of these can have different size policies, be expanding or have a custom stylesheet applied.
All of this makes calculating such size not feasible because how would you calculate it if a widget can change its size.
What I'm saying is that yours is a special, very specific case (with just icons), and as such you need to handle it yourself if you want to.
To answer your questions:
It's not one thing that adds the space. There are couple of aspects that can contribute. You can control some(or all?) of them with stylesheets e.g. set padding of the toolbar and toolbuttons to 0 and margins and borders of the toolbuttons. By default all of these depend on a style and will vary across computers. You also need to be careful to consider the size of the toolbar handle (if it's movable) as its size depends on the active style. You also need to consider that if the icon is narrower than the iconSize then there's gonna by space left anyway.
nope, AFAIK it can vary from one item of the toolbar to another if you set it this way
nope and just out of curiosity - why do you need that? The bar will display an arrow button that will let you see the overflowing items. Also such calculated size would be useless as the window can be resized and thus the toolbar too (unless you're doing some really fancy layout).
Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.