# Tiled crash when docking uis together

**URL:** <https://discourse.mapeditor.org/t/tiled-crash-when-docking-uis-together/7256>\
**Category:** Bugs\
**Created:** [January 29, 2025, 6:47pm UTC](https://discourse.mapeditor.org/t/tiled-crash-when-docking-uis-together/7256 "2025-01-29T18:47:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rudi\_Hammad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/rudi_hammad/32/3984_2.png) [@Rudi\_Hammad](https://discourse.mapeditor.org/u/Rudi_Hammad)\
**Post date:** [January 29, 2025, 6:47pm UTC](https://discourse.mapeditor.org/t/tiled-crash-when-docking-uis-together/7256/1 "2025-01-29T18:47:30Z")

</div>

[bug.zip](https://discourse.mapeditor.org/uploads/short-url/t8vPGx1DK9rbZzNFdio7YyFO0yX.zip) (2.9 MB)  
Hello,  
I’ve uploaded a video that shows how Tiled crashes when I place a UI under another floating one. Didn’t have time to check the forum to see if this is already reported, but here it is anyways.

Cheers

---

<div class="post-metadata">

**Author:** ![bjorn](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/bjorn/32/1599_2.png) [@bjorn](https://discourse.mapeditor.org/u/bjorn)\
**Post date:** [January 30, 2025, 11:52am UTC](https://discourse.mapeditor.org/t/tiled-crash-when-docking-uis-together/7256/2 "2025-01-30T11:52:36Z")

</div>

Hmm, the good news is that I could reproduce this crash also on Linux. However, the crash is entirely happening inside of the Qt framework:

```auto
1 QWeakPointer<QObject>::internalData qsharedpointer_impl.h 752 0x7ffff6335b99 
2 QPointer<QMainWindowLayout>::data qpointer.h 75 0x7ffff6335b99 
3 QMainWindowPrivate::mainWindowLayout qmainwindow.cpp 63 0x7ffff6335b99 
4 qt_mainwindow_layout qmainwindow.cpp 69 0x7ffff6335b99 
5 QDockWidgetGroupLayout::toolBarAreaLayout qmainwindowlayout.cpp 281 0x7ffff634ac36 
6 QMainWindowLayoutSeparatorHelper<QDockWidgetGroupLayout>::findSeparator qmainwindowlayout_p.h 291 0x7ffff634ac36 
7 QMainWindowLayoutSeparatorHelper<QDockWidgetGroupLayout>::adjustCursor qmainwindowlayout_p.h 149 0x7ffff634ae43 
8 QMainWindowLayoutSeparatorHelper<QDockWidgetGroupLayout>::windowEvent qmainwindowlayout_p.h 224 0x7ffff634b44d 
9 QDockWidgetGroupWindow::event qmainwindowlayout.cpp 308 0x7ffff6348527 
10 QApplicationPrivate::notify_helper qapplication.cpp 3296 0x7ffff61903f6 
11 QApplication::notify qapplication.cpp 2774 0x7ffff6199028 
12 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1168 0x7ffff4d7bcaa 
13 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1626 0x7ffff4d7becd 
14 QApplicationPrivate::sendMouseEvent qapplication.cpp 2355 0x7ffff619836d 
15 QWidgetWindow::handleMouseEvent qwidgetwindow.cpp 667 0x7ffff62037b7 
16 QWidgetWindow::event qwidgetwindow.cpp 299 0x7ffff6206473 
17 QApplicationPrivate::notify_helper qapplication.cpp 3296 0x7ffff61903f6 
18 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1168 0x7ffff4d7bcaa 
19 QCoreApplication::sendSpontaneousEvent qcoreapplication.cpp 1626 0x7ffff4d7becd 
20 QGuiApplicationPrivate::processMouseEvent qguiapplication.cpp 2461 0x7ffff55e58b8 
21 QWindowSystemInterface::sendWindowSystemEvents qwindowsysteminterface.cpp 1114 0x7ffff5648aac 
22 xcbSourceDispatch qxcbeventdispatcher.cpp 57 0x7ffff14acb9e 
23 g_main_context_dispatch_unlocked.lto_priv 0x7ffff44fd28c 
24 g_main_context_iterate_unlocked.isra 0x7ffff455d7b8 
25 g_main_context_iteration 0x7ffff44fe783 
26 QEventDispatcherGlib::processEvents qeventdispatcher_glib.cpp 399 0x7ffff505591e 
27 QEventLoop::exec qflags.h 34 0x7ffff4d88fe2 
28 QCoreApplication::exec qflags.h 74 0x7ffff4d85166 
29 main main.cpp 633 0x21c045       

```

It actually appears to crash upon hovering the separator between the views, due to trying to use the `QDockWidgetGroupWindow` instance as a `QMainWindow`, which it isn’t, but it was casted to one in `QDockWidgetGroupLayout::toolBarAreaLayout` in code introduced in [Avoid dock widget separators stealing mouse events from expanded toolbar · qt/qtbase@3d99f90 · GitHub](https://github.com/qt/qtbase/commit/3d99f90b50ab22ef5ab4433c57f9ee584a0a7cae), so it appears to be a regression in Qt 6.8.1.

Fortunately, I found this issue was already reported as [QTBUG-132952](https://bugreports.qt.io/browse/QTBUG-132952) and is [already fixed](https://github.com/qt/qtbase/commit/39ba5ed46aa96392148ee462de5fae4b9953b940) for an upcoming Qt release. Until we have a Tiled build against a fixed Qt I would suggest to avoid this kind of layout.

---

<div class="post-metadata">

**Author:** ![Rudi\_Hammad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/rudi_hammad/32/3984_2.png) [@Rudi\_Hammad](https://discourse.mapeditor.org/u/Rudi_Hammad)\
**Post date:** [January 30, 2025, 2:20pm UTC](https://discourse.mapeditor.org/t/tiled-crash-when-docking-uis-together/7256/3 "2025-01-30T14:20:19Z")

</div>

Good to know, thx.
