I forgot to say that my toolbox is inside a dock widget.
I have taken the MDI example from the documentation and have added a basic dock widget, toolbox and two blank pages. The result is that this also exhibits the erroneous behaviour. Maybe I have found a bug in Qt?
I will do some more investigating.
Added after 7 minutes:
Ok, this is the code that I added to the standard MDI example.
First mainwindow.h , just below the #includes:
class QDockWidget;
class QToolBox;
To copy to clipboard, switch view to plain text mode
then below private:
QDockWidget *dock;
QToolBox *toolBox;
To copy to clipboard, switch view to plain text mode
At the end of the constructor in mainwindow.cpp :
toolBox
->addItem
(new QWidget(toolBox
),
"Widget 1");
toolBox
->addItem
(new QWidget(toolBox
),
"Widget 2");
dock->setWidget(toolBox);
addDockWidget(Qt::RightDockWidgetArea, dock);
dock = new QDockWidget(this);
toolBox = new QToolBox(this);
toolBox->addItem(new QWidget(toolBox), "Widget 1");
toolBox->addItem(new QWidget(toolBox), "Widget 2");
dock->setWidget(toolBox);
addDockWidget(Qt::RightDockWidgetArea, dock);
To copy to clipboard, switch view to plain text mode
Can anybody else reproduce this problem or I am doing something wrong?
Added after 15 minutes:
The bug also occurs if you click on the dock widget restore button. The bug can therefore also be reproduced with a single toolbox page. The bug does not occur when there are no toolbox pages.
Bookmarks