QToolbar setContentsMargins
While trying to upgrade from Qt 4.1.2 to 4.3.1, I ran into a problem with my toolbar. I have two icons I always want to display all the way on the right of my toolbar like this: http://www.shabsin.com/~rshabsin/_ui...ttoolbar99.bmp, and I was able to do that in 4.1.2 by doing some calculations and then setting the contents margins on my rightmost toolbar (the one containing the two icons) so the left margin would be just the right size to position the icons all the way on the right. This doesn't seem to work in 4.3.1. I even tried getting the tool bar's layout and setting its contents margin, but that didn't work either, I always get this: http://www.shabsin.com/~rshabsin/_ui...ttoolbar98.bmp. Any help?
Re: QToolbar setContentsMargins
Try adding a dummy expanding widget as first item in the tool bar:
Code:
// a dummy expanding widget
toolBar->addWidget(widget);
// add real actions
tooBar->addAction(...);
...
Re: QToolbar setContentsMargins
wow, very simple - worked great. thx, jpn.