Commit 5afdee00 authored by Janet Blackquill's avatar Janet Blackquill 🌈
Browse files

Initial commit

parent 71494d4b
root = true
[*]
indent_style = tab
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
cmake_minimum_required(VERSION 3.5)
project(KDEInitialSystemSetup LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
include(GNUInstallDirs)
find_package(Qt5 COMPONENTS Core Quick QuickControls2 WaylandCompositor REQUIRED)
set(DefaultPermissions
OWNER_WRITE OWNER_READ OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
add_subdirectory(KDEInitialSystemSetup)
set(SOURCES
Sources/Main.cpp
Resources/Resources.qrc
)
add_executable(org.kde.initialsystemsetup
${SOURCES}
)
target_compile_definitions(org.kde.initialsystemsetup
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>
)
target_link_libraries(org.kde.initialsystemsetup
PRIVATE Qt5::Core Qt5::Quick Qt5::QuickControls2 Qt5::WaylandCompositor
)
install(TARGETS org.kde.initialsystemsetup
PERMISSIONS ${DefaultPermissions} SETUID
DESTINATION ${CMAKE_INSTALL_BINDIR}
)
import QtQuick 2.0
import QtWayland.Compositor 1.3
WaylandCompositor {
id: waylandCompositor
Screen {
compositor: waylandCompositor
}
}
<RCC>
<qresource prefix="/">
<file>Main.qml</file>
<file>Screen.qml</file>
</qresource>
</RCC>
import QtQuick 2.5
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.5
import QtQuick.Window 2.2
import QtWayland.Compositor 1.0
WaylandOutput {
id: output
property bool isNestedCompositor: Qt.platform.pluginName.startsWith("wayland") || Qt.platform.pluginName === "xcb"
sizeFollowsWindow: output.isNestedCompositor
window: Window {
id: window
width: 1024
height: 760
visible: true
Rectangle {
anchors.fill: parent
color: "cyan"
}
}
}
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
const QUrl url(QStringLiteral("qrc:/Main.qml"));
QObject::connect(
&engine, &QQmlApplicationEngine::objectCreated,
&app, [url](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl) {
QCoreApplication::exit(-1);
}
},
Qt::QueuedConnection);
engine.load(url);
return app.exec();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment