KDDockWidgets API Documentation 2.0
Loading...
Searching...
No Matches
DelayedCall.cpp
Go to the documentation of this file.
1/*
2 This file is part of KDDockWidgets.
3
4 SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
5 Author: SĂ©rgio Martins <sergio.martins@kdab.com>
6
7 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only
8
9 Contact KDAB at <info@kdab.com> for commercial licensing options.
10*/
11
12#include "DelayedCall_p.h"
13#include "DockWidget_p.h"
14#include "Controller.h"
15#include "DragController_p.h"
16#include "core/Utils_p.h"
17
18using namespace KDDockWidgets::Core;
19
20DelayedCall::~DelayedCall() = default;
21
22
23DelayedDelete::DelayedDelete(Controller *c)
24 : m_object(c)
25{
26}
27
28DelayedDelete::~DelayedDelete() = default;
29
30
31void DelayedDelete::call()
32{
33 if (isWayland() && DragController::instance()->isInQDrag()) {
34 // Workaround QTBUG-115527. FloatingWindow must be deleted after QDrag::exec() ends.
35 Platform::instance()->runDelayed(200, new DelayedDelete(m_object));
36 return;
37 }
38
39 // Can't use deleteLater() here due to QTBUG-83030 (deleteLater() never delivered if
40 // triggered by a sendEvent() before event loop starts)
41 delete m_object;
42}
43
44
45DelayedEmitFocusChanged::DelayedEmitFocusChanged(DockWidget *dw, bool focused)
46 : m_dockWidget(dw)
47 , m_focused(focused)
48{
49}
50
51DelayedEmitFocusChanged::~DelayedEmitFocusChanged() = default;
52
53void DelayedEmitFocusChanged::call()
54{
55 if (m_dockWidget) {
56 m_dockWidget->d->isFocusedChanged.emit(m_focused);
57 }
58}
The DockWidget base-class. DockWidget and Core::DockWidget are only split in two so we can share some...
static Platform * instance()
Returns the platform singleton.
virtual void runDelayed(int ms, Core::DelayedCall *c)=0

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
KDDockWidgets
Advanced Dock Widget Framework for Qt
https://www.kdab.com/development-resources/qt-tools/kddockwidgets/
Generated by doxygen 1.9.8