mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Add a call to checkAllowClose slot (if it exists) when closing windows
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <QEvent>
|
||||
#include <QApplication>
|
||||
#include <QDrag>
|
||||
#include <QMetaMethod>
|
||||
#include <QMimeData>
|
||||
#include <QMouseEvent>
|
||||
#include <QPainter>
|
||||
@@ -792,6 +793,16 @@ void ToolWindowManager::tabCloseRequested(int index) {
|
||||
return;
|
||||
}
|
||||
|
||||
int methodIndex = toolWindow->metaObject()->indexOfMethod(QMetaObject::normalizedSignature("checkAllowClose()"));
|
||||
|
||||
if(methodIndex >= 0) {
|
||||
bool ret = true;
|
||||
toolWindow->metaObject()->method(methodIndex).invoke(toolWindow, Qt::DirectConnection, Q_RETURN_ARG(bool, ret));
|
||||
|
||||
if(!ret)
|
||||
return;
|
||||
}
|
||||
|
||||
if(toolWindowProperties(toolWindow) & ToolWindowManager::HideOnClose)
|
||||
hideToolWindow(toolWindow);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user