adding KWindowSystem to try and fix wayland issues
This commit is contained in:
parent
f70dc7722b
commit
9120f6cca4
2 changed files with 21 additions and 2 deletions
|
@ -30,7 +30,7 @@ include(ECMPoQmTools)
|
||||||
kde_enable_exceptions()
|
kde_enable_exceptions()
|
||||||
|
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Widgets Sql X11Extras QmlImportScanner)
|
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui QuickControls2 Widgets Sql X11Extras QmlImportScanner)
|
||||||
find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 I18n Archive CoreAddons)
|
find_package(KF5 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 WindowSystem I18n Archive CoreAddons)
|
||||||
|
|
||||||
find_package(Libmpv)
|
find_package(Libmpv)
|
||||||
set_package_properties(Libmpv PROPERTIES TYPE REQUIRED)
|
set_package_properties(Libmpv PROPERTIES TYPE REQUIRED)
|
||||||
|
@ -109,6 +109,7 @@ target_link_libraries(${CRATE} INTERFACE
|
||||||
KF5::I18n
|
KF5::I18n
|
||||||
KF5::Archive
|
KF5::Archive
|
||||||
KF5::CoreAddons
|
KF5::CoreAddons
|
||||||
|
KF5::WindowSystem
|
||||||
podofo
|
podofo
|
||||||
mpv
|
mpv
|
||||||
)
|
)
|
||||||
|
|
20
src/main.cpp
20
src/main.cpp
|
@ -7,6 +7,7 @@
|
||||||
#include <KLocalizedContext>
|
#include <KLocalizedContext>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <KAboutData>
|
#include <KAboutData>
|
||||||
|
#include <KWindowSystem>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
#include <QtSql>
|
#include <QtSql>
|
||||||
|
@ -48,6 +49,14 @@
|
||||||
#include "cxx-qt-gen/service_thing.cxxqt.h"
|
#include "cxx-qt-gen/service_thing.cxxqt.h"
|
||||||
#include "cxx-qt-gen/file_helper.cxxqt.h"
|
#include "cxx-qt-gen/file_helper.cxxqt.h"
|
||||||
|
|
||||||
|
static QWindow *windowFromEngine(QQmlApplicationEngine *engine)
|
||||||
|
{
|
||||||
|
const auto rootObjects = engine->rootObjects();
|
||||||
|
auto *window = qobject_cast<QQuickWindow *>(rootObjects.first());
|
||||||
|
Q_ASSERT(window);
|
||||||
|
return window;
|
||||||
|
}
|
||||||
|
|
||||||
static void connectToDatabase() {
|
static void connectToDatabase() {
|
||||||
// let's setup our sql database
|
// let's setup our sql database
|
||||||
QSqlDatabase db = QSqlDatabase::database();
|
QSqlDatabase db = QSqlDatabase::database();
|
||||||
|
@ -112,6 +121,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
qDebug() << QQuickStyle::availableStyles();
|
qDebug() << QQuickStyle::availableStyles();
|
||||||
qDebug() << QIcon::themeName();
|
qDebug() << QIcon::themeName();
|
||||||
|
qDebug() << QApplication::platformName();
|
||||||
|
|
||||||
// integrate with commandline argument handling
|
// integrate with commandline argument handling
|
||||||
QCommandLineParser parser;
|
QCommandLineParser parser;
|
||||||
|
@ -148,7 +158,6 @@ int main(int argc, char *argv[])
|
||||||
// QQuickView *view = new QQuickView;
|
// QQuickView *view = new QQuickView;
|
||||||
// view->setSource(QUrl(QStringLiteral("qrc:qml/main.qml")));
|
// view->setSource(QUrl(QStringLiteral("qrc:qml/main.qml")));
|
||||||
// view->show();
|
// view->show();
|
||||||
|
|
||||||
#ifdef STATIC_KIRIGAMI
|
#ifdef STATIC_KIRIGAMI
|
||||||
KirigamiPlugin::getInstance().registerTypes();
|
KirigamiPlugin::getInstance().registerTypes();
|
||||||
#endif
|
#endif
|
||||||
|
@ -157,6 +166,15 @@ int main(int argc, char *argv[])
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QWindow *window = windowFromEngine(&engine);
|
||||||
|
|
||||||
|
// KWindowSystem::setMainWindow(&window);
|
||||||
|
KWindowSystem::activateWindow(window);
|
||||||
|
qDebug() << "00000000000000000000000000000000";
|
||||||
|
qDebug() << KWindowSystem::isPlatformWayland();
|
||||||
|
qDebug() << "00000000000000000000000000000000";
|
||||||
|
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue