This isn't directly supported, but you can achieve similar result if you make your central widget another QMainWindow. This has the downside that you can't move the toolbars between the two QMainWindows, unless you manage to reparent them dynamically while dragging (should be possible but I haven't tried it).
QWidget* spinWidget = new QWidget;
QHBoxLayout* spinLay = new QHBoxLayout(spinWidget);
spinLay.setContentsMargins(0,0,10,0); // Here you set the spacing
QToolBar* toolbarDocument = new QToolBar;
Please have some patience, this forum is community driven and not all users live in the same timezone as you.
The picture you are linking to doesn't show a hovered button but a checked button. You will have that visual effect if you set the checkable property of the action to corresponding to the button as true and you check it.
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).