The thing I'm going for is basically a panel that holds three items, with the middle one having the size of the screen (here a QScrollArea). The point is that I then shift the QScrollArea to reveal the left and right items as needed, like illustrated below.
Here, the left and right tabs are supposed to be hidden, with the text edit in the middle taking up the entirety of the scroll area (scroll bars are hidden here). Clicking the buttons labeled "Structure" and "Options" on the left and right should scroll said scroll area and reveal the corresponding tab. The Qt Designer structure is as follows :
mrte_text
is my own custom class for the WYSIWYG widget. Both tabs are ad-hoc widgets created for the occasion that I am adding in MainWindow::show
with the following code :
void MainWindow::show()
{
QHBoxLayout *l = (QHBoxLayout*)ui->scrollAreaWidgetContents->layout();
QMainWindow::show();
l->insertWidget(0, searchTab);
l->insertWidget(2, chatTab);
baseX = ui->scrollAreaWidgetContents->x();
baseY = ui->scrollAreaWidgetContents->y();
searchTab->move(baseX - searchTab->width(), baseY);
chatTab->move(baseX + ui->mrte_text->width(), baseY);
}
Moving the tabs don't seem to do anything, as removing the move
lines changes nothing, but I have explored this possibility.