[SOLVED] Synchronizing tab ordering with button ordering

In my application I have some function that requires a whole bunch of parameters. There is a tabbed settings panel, that can be used to configure four 'presets'. Additionally there is a 'start' button for each of these four parameter configurations. These buttons are (currently) in a HBoxLayout.

I'd like these buttons to follow the ordering of the tabs in the settings panel. I.e. if I move the second tab the first location, the second button should move in front inside the horizontal layout as well.

Is anyone aware of existing code that already does it? Otherwise, how could I do this? (in particular I don't have a clue how to reorder the buttons in the horizontal layout, if at all possible)

For bonus, I'd like to be able to update the layout of the buttons already while dragging the tab, so don't wait for the tabMoved signal before updating the button ordering.

What I didn't realize before however, is that the tabMoved signal is actually emitted independent on whether the mouse is still down or not. GREAT! I created a very simple prototype, and as it turns out, I get everything I want, including the bonus feature by simply connecting to QTabBar::tabMoved and in the slot writing a line along the lines of the following: