From 626036c3f525c52fe573a0b2dfa6d0d1c5b204d3 Mon Sep 17 00:00:00 2001 From: ppouchet <pierre.pouchet@etu.ec-lyon.fr> Date: Mon, 24 Mar 2025 11:39:56 +0100 Subject: [PATCH] Changement chemins vers chemins absolus (temporaire) --- Motus/BackKey.qml | 18 +++++++++--------- Motus/Main.qml | 14 ++++---------- Motus/main.cpp | 3 +++ Motus/wordchooser.cpp | 2 +- test.docx | 0 5 files changed, 17 insertions(+), 20 deletions(-) delete mode 100644 test.docx diff --git a/Motus/BackKey.qml b/Motus/BackKey.qml index 3ee2759..e865df2 100644 --- a/Motus/BackKey.qml +++ b/Motus/BackKey.qml @@ -10,15 +10,15 @@ Item { color: "#7a7a7a" radius: 15 anchors.fill: parent - } - Image { - id: image - width: 100 - height: 30 - anchors.verticalCenter: parent.verticalCenter - source: "qrc:/back_key.png" - anchors.horizontalCenter: parent.horizontalCenter - fillMode: Image.PreserveAspectFit + Image { + id: image + x: 0 + y: 0 + width: 150 + height: 70 + source: "file:///C:/Users/pierr/OneDrive/Documents/GitHub/momomotus/momomotus/Motus/back_key.png" + fillMode: Image.PreserveAspectFit + } } } diff --git a/Motus/Main.qml b/Motus/Main.qml index 5849c59..3f87d1e 100644 --- a/Motus/Main.qml +++ b/Motus/Main.qml @@ -79,24 +79,18 @@ Window { - Image { - id: testImage - source: "qrc:/back_key.png" - width: 100 - height: 100 - anchors.left: parent.left - anchors.top: parent.top - } + Rectangle { id: rectangle1 - y: 666 + y: 465 width: 640 height: 280 color: "#323232" radius: 10 border.color: "#ffffff" border.width: 5 + anchors.horizontalCenterOffset: 38 anchors.horizontalCenter: parent.horizontalCenter Column { @@ -405,7 +399,7 @@ Window { width: 100 height: 60 anchors.verticalCenter: parent.verticalCenter - imageSource: "qrc:/back_key.png" + } } } diff --git a/Motus/main.cpp b/Motus/main.cpp index a365692..200e2c8 100644 --- a/Motus/main.cpp +++ b/Motus/main.cpp @@ -2,9 +2,12 @@ #include <QQmlApplicationEngine> #include <QQmlContext> #include "WordChooser.h" +#include <Qfile> + int main(int argc, char *argv[]) { + QFile file(":/words_alpha.txt"); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; diff --git a/Motus/wordchooser.cpp b/Motus/wordchooser.cpp index a0aedbd..52e1ccc 100644 --- a/Motus/wordchooser.cpp +++ b/Motus/wordchooser.cpp @@ -12,7 +12,7 @@ WordChooser::WordChooser(QObject *parent) : QObject(parent) { } void WordChooser::loadWords() { - QFile file(":/words_alpha.txt"); // ✅ fonctionne avec le .qrc + QFile file("C:\\Users\\pierr\\OneDrive\\Documents\\GitHub\\momomotus\\momomotus\\Motus\\words_alpha.txt"); // ✅ fonctionne avec le .qrc if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream in(&file); while (!in.atEnd()) { diff --git a/test.docx b/test.docx deleted file mode 100644 index e69de29..0000000 -- GitLab