-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will make QML tooling happier.
- Loading branch information
Showing
15 changed files
with
116 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
This file is part of KDDockWidgets. | ||
SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]> | ||
Author: Sérgio Martins <[email protected]> | ||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only | ||
Contact KDAB at <[email protected]> for commercial licensing options. | ||
*/ | ||
|
||
#include "Singletons_p.h" | ||
#include "ViewFactory.h" | ||
#include "core/DockRegistry.h" | ||
#include "core/DockWidget.h" | ||
#include "Platform.h" | ||
#include "Helpers_p.h" | ||
|
||
using namespace KDDockWidgets::QtQuick; | ||
|
||
Singletons::~Singletons() = default; | ||
|
||
KDDockWidgets::QtQuick::ViewFactory *Singletons::widgetFactory() const | ||
{ | ||
return QtQuick::ViewFactory::self(); | ||
} | ||
|
||
KDDockWidgets::DockRegistry *Singletons::dockRegistry() const | ||
{ | ||
return DockRegistry::self(); | ||
} | ||
|
||
KDDockWidgets::QtQuickHelpers *Singletons::helpers() const | ||
{ | ||
if (auto plat = QtQuick::Platform::instance()) { | ||
return plat->helpers(); | ||
} | ||
|
||
return nullptr; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
This file is part of KDDockWidgets. | ||
SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]> | ||
Author: Sérgio Martins <[email protected]> | ||
SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only | ||
Contact KDAB at <[email protected]> for commercial licensing options. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "Helpers_p.h" | ||
#include "ViewFactory.h" | ||
#include "core/DockRegistry.h" | ||
|
||
#include <QQmlEngine> | ||
|
||
namespace KDDockWidgets::QtQuick { | ||
|
||
class Singletons : public QObject | ||
{ | ||
Q_OBJECT | ||
QML_ELEMENT | ||
QML_SINGLETON | ||
Q_PROPERTY(KDDockWidgets::QtQuick::ViewFactory *widgetFactory READ widgetFactory CONSTANT) | ||
Q_PROPERTY(KDDockWidgets::DockRegistry *dockRegistry READ dockRegistry CONSTANT) | ||
Q_PROPERTY(KDDockWidgets::QtQuickHelpers *helpers READ helpers CONSTANT) | ||
public: | ||
~Singletons() override; | ||
KDDockWidgets::QtQuick::ViewFactory *widgetFactory() const; | ||
KDDockWidgets::DockRegistry *dockRegistry() const; | ||
KDDockWidgets::QtQuickHelpers *helpers() const; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters