Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.0
-
None
Description
When a QMdiArea's viewMode is QMdiArea::TabbedView and a QMdiSubWindow is added to the QMdiArea, a new tab is created for this new sub window.
This is to be expected in most cases.
However, a problem arises when the new sub window is not shown (show()).
If the sub window is added to the QMdiArea but not shown, a tab is created for the sub window. This tab can be clicked, however, since the sub window is not shown, clicking the tab has no affect. Furthermore, once the tab is clicked, it then becomes disabled as opposed to being disabled to begin with.
Perhaps the tab should not be visible if the sub window is not visible. It is perfectly reasonable to add a sub window but not show it immediately.
Test case main.cpp to reproduce
===============================
#include <QtGui>
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = 0)
: QMainWindow(parent), tabCount(0)
public slots:
void addMdiAreaSubWindow()
private:
QMdiArea *mdiArea;
int tabCount;
};
#include "main.moc"
int main(int argc, char **argv)
{
QApplication a(argc, argv);
MainWindow mw;
mw.show();
return a.exec();
}