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"
22#ifdef KDDW_FRONTEND_QTWIDGETS
26#ifdef KDDW_FRONTEND_QTQUICK
30#ifdef KDDW_FRONTEND_FLUTTER
35#include "core/layouting/Item_p.h"
36#include "core/Screen_p.h"
38#include "QtCompat_p.h"
59 Item::setDumpScreenInfoFunc([] {
61 for (
const auto &screen :
screens) {
62 std::cerr <<
"Screen: " << screen->geometry() <<
"; " << screen->availableGeometry()
63 <<
"; drp=" << screen->devicePixelRatio() <<
"\n";
70 Item::setDumpScreenInfoFunc(
nullptr);
75Platform::Private::Private()
80 Core::Item::setCreateSeparatorFunc([](Core::LayoutingHost *host,
Qt::Orientation orientation, Core::ItemBoxContainer *container) -> Core::LayoutingSeparator * {
81 return (
new Core::Separator(host, orientation, container))->asLayoutingSeparator();
88 static bool guard =
false;
96 if (types.size() == 1)
116 return strcmp(
name(),
"qtwidgets") == 0;
121 return strcmp(
name(),
"qtquick") == 0;
133 if (userRequestedDistance > -1)
134 return userRequestedDistance;
148 std::vector<KDDockWidgets::FrontendType> types;
150#ifdef DOCKS_DEVELOPER_MODE
154 const int frontendId = envVarIntValue(
"KDDW_TEST_FRONTEND", ok);
162#ifdef KDDW_FRONTEND_QTQUICK
166#ifdef KDDW_FRONTEND_QTWIDGETS
170#ifdef KDDW_FRONTEND_FLUTTER
183#ifdef DOCKS_TESTING_METHODS
185void Platform::pauseForDebugger()
189Platform::WarningObserver::~WarningObserver() =
default;
193#ifdef DOCKS_DEVELOPER_MODE
204#ifdef KDDW_FRONTEND_QTWIDGETS
209#ifdef KDDW_FRONTEND_QTQUICK
214#ifdef KDDW_FRONTEND_FLUTTER
223 KDDW_ERROR(
"Could not initialize platform for type={}. KDDockWidgets was built without support for it");
236void Platform::tests_deinitPlatform()
239 plat->
d->m_inDestruction =
true;
241 plat->tests_deinitPlatform_impl();
249 d->m_globalEventFilters.push_back(filter);
254 d->m_globalEventFilters.erase(
255 std::remove(
d->m_globalEventFilters.begin(),
d->m_globalEventFilters.end(), filter),
256 d->m_globalEventFilters.end());
279 std::ifstream file(fileName.
toStdString(), std::ios::binary);
280 if (!file.is_open()) {
281 KDDW_ERROR(
"Failed to open {}", fileName);
288 file.seekg(0, std::ios::end);
289 std::streampos fileSize = file.tellg();
290 file.seekg(0, std::ios::beg);
292 data.
resize(
int(fileSize));
294 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