Unsolved All MDI windows are active
-
With new myMDIWindow() without parent. In constructor nothing special:
ui->setupUI(this); setWindowTitle("some")
-
I meant how are you creating it your QMainWindow subclass ?
-
: QMainWindow(parent),
ui(new Ui::MyMainWindow),
mWorkspaceBrowser(parent)
{
setWindowFlags(Qt::Widget); // Let QMainWindow act as a common widget here
} -
Where's myMDIWindow ?
-
New info: myMDIWindow with tree widget have signal connected to mdi window which creates it (Let's call it first mdi window). This signal connected to a slot which creates new MDI window according to user double-click in this tree widget. In this case all mdi windows become active. If I create MDI window by clicking a button in first mdi window - all become normal again. Code to create mdi window is the same in both cases:
mdiArea->addSubWindow(newMDI); newMDI->setMainWindow(this); newMDI->show(); newMDI->raise(); mdiArea->setActiveSubWindow(newMDI);
"this" is main window. Could this be dock widget has focus or smth like this on mdi creation?
-
@SGaist said:
Where's myMDIWindow ?
As I said above simple new Widget() without parent created in first mdi window.
-
Can you create a minimal compilable example that shows that behavior ?
-
@SGaist need some time. Probably tomorrow.
-
No problem
-
@SGaist created bug report for now: https://bugreports.qt.io/browse/QTBUG-52287
-
Correct me if I am wrong, are you trying to create an instance QMdiSubWindow and put it on the dock widget?
In this case it loses its relation to QMDiArea and is treated as a regular widget on the dock widget.
So you can't expect QMainWindow windowStateChanged() to be sent.
You may try to watch focus on all such widgets and organize equivalent "active" status for them,
but QMainWindow will not help you here. -
@alex_malyu yes, You are wrong. Read attentively. I'm not trying to catch signal in mdi going to dock, also I tried to convert it to simple widget which was no such signal.