Skip to content

Commit 56ba4e4

Browse files
committed
qmdiSplitTab: double click open new document on correct tab (#132)
When double clicking the empty area of a tabbar, a new document is created. Currently, the active tab would get a new tab. What happes if you click a non active split? The document is opened on the wrong place. This fixes it. Similar to what has been done in https://github.com/ diegoiast/qtedit4/commit/d46a2c6060d0780ef2bb0bdc8ec8c61df23a5bc2 closes #132
1 parent 6fea676 commit 56ba4e4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/widgets/qmdiSplitTab.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ qmdiSplitTab::qmdiSplitTab(QWidget *parent) : SplitTabWidget(parent) {
6868
connect(this, &SplitTabWidget::emptyAreaDoubleClicked, this,
6969
[this](QTabWidget *tabWidget, const QPoint &) {
7070
auto manager = dynamic_cast<PluginManager *>(this->parent());
71-
if (manager) {
71+
if (tabWidget) {
72+
updateCurrentTabWidget(tabWidget);
73+
}
74+
if (tabWidget && manager) {
7275
emit manager->newFileRequested(tabWidget->tabBar());
7376
}
7477
});

0 commit comments

Comments
 (0)