13#include "core/Platform_p.h"
14#include "core/Logging_p.h"
15#include "core/Window_p.h"
16#include "core/Utils_p.h"
19#include "core/layouting/LayoutingSeparator_p.h"
21#ifdef KDDW_FRONTEND_QTWIDGETS
25#ifdef KDDW_FRONTEND_QTQUICK
29#ifdef KDDW_FRONTEND_FLUTTER
34#include "core/layouting/Item_p.h"
35#include "core/Screen_p.h"
37#include "QtCompat_p.h"
58 Item::setDumpScreenInfoFunc([] {
60 for (
const auto &screen :
screens) {
61 std::cerr <<
"Screen: " << screen->geometry() <<
"; " << screen->availableGeometry()
62 <<
"; drp=" << screen->devicePixelRatio() <<
"\n";
69 Item::setDumpScreenInfoFunc(
nullptr);
74Platform::Private::Private()
79 Core::Item::setCreateSeparatorFunc([](Core::LayoutingHost *host,
Qt::Orientation orientation, Core::ItemBoxContainer *container) -> Core::LayoutingSeparator * {
80 return (
new Core::Separator(host, orientation, container))->asLayoutingSeparator();
87 static bool guard =
false;
95 if (types.size() == 1)
110 return strcmp(
name(),
"qtwidgets") == 0;
115 return strcmp(
name(),
"qtquick") == 0;
127 if (userRequestedDistance > -1)
128 return userRequestedDistance;
142 std::vector<KDDockWidgets::FrontendType> types;
144#ifdef DOCKS_DEVELOPER_MODE
148 const int frontendId = envVarIntValue(
"KDDW_TEST_FRONTEND", ok);
156#ifdef KDDW_FRONTEND_QTQUICK
160#ifdef KDDW_FRONTEND_QTWIDGETS
164#ifdef KDDW_FRONTEND_FLUTTER
171#ifdef DOCKS_TESTING_METHODS
173void Platform::pauseForDebugger()
177Platform::WarningObserver::~WarningObserver() =
default;
180bool Platform::isInitialized()
187#ifdef DOCKS_DEVELOPER_MODE
191 if (Platform::isInitialized())
198#ifdef KDDW_FRONTEND_QTWIDGETS
203#ifdef KDDW_FRONTEND_QTQUICK
208#ifdef KDDW_FRONTEND_FLUTTER
217 KDDW_ERROR(
"Could not initialize platform for type={}. KDDockWidgets was built without support for it");
230void Platform::tests_deinitPlatform()
233 plat->
d->m_inDestruction =
true;
235 plat->tests_deinitPlatform_impl();
242 d->m_globalEventFilters.push_back(filter);
247 d->m_globalEventFilters.erase(
248 std::remove(
d->m_globalEventFilters.begin(),
d->m_globalEventFilters.end(), filter),
249 d->m_globalEventFilters.end());
272 std::ifstream file(fileName.
toStdString(), std::ios::binary);
273 if (!file.is_open()) {
274 KDDW_ERROR(
"Failed to open {}", fileName);
281 file.seekg(0, std::ios::end);
282 std::streampos fileSize = file.tellg();
283 file.seekg(0, std::ios::beg);
285 data.
resize(
int(fileSize));
287 file.read(data.
data(), fileSize);
Application-wide config to tune certain behaviours of the framework.
The MainWindow base-class. MainWindow and MainWindowBase are only split in two so we can share some c...
std::string toStdString() const const