Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. German
  4. QML Projekt "Hello World"
Forum Updated to NodeBB v4.3 + New Features

QML Projekt "Hello World"

Scheduled Pinned Locked Moved Solved German
22 Posts 3 Posters 5.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Galilio
    wrote on last edited by
    #9

    Bei der Applicaton Output habe ich folgende Meldung:

    QML debugging is enabled. Only use this in a safe environment.
    QQmlComponent: Component is not ready
    qrc:///main.qml:60:5: QML StackView: initialItem: file://nas-ham-ch-001/user/xyayayay/Daten/build-Einfuehrung1-Desktop_Qt_5_9_1_MinGW_32bit-Debug/HomeForm.ui.qml:-1 No such file or directory
    qrc:///main.qml:28: TypeError: Cannot read property 'title' of null```
    G 1 Reply Last reply
    0
    • G Galilio

      Bei der Applicaton Output habe ich folgende Meldung:

      QML debugging is enabled. Only use this in a safe environment.
      QQmlComponent: Component is not ready
      qrc:///main.qml:60:5: QML StackView: initialItem: file://nas-ham-ch-001/user/xyayayay/Daten/build-Einfuehrung1-Desktop_Qt_5_9_1_MinGW_32bit-Debug/HomeForm.ui.qml:-1 No such file or directory
      qrc:///main.qml:28: TypeError: Cannot read property 'title' of null```
      G Offline
      G Offline
      Galilio
      wrote on last edited by
      #10

      @Galilio
      Wenn ich mein .pro datei öffne, die sieht dann so aus:

      QT += quick
      CONFIG += c++11
      
      # The following define makes your compiler emit warnings if you use
      # any feature of Qt which as been marked deprecated (the exact warnings
      # depend on your compiler). Please consult the documentation of the
      # deprecated API in order to know how to port your code away from it.
      DEFINES += QT_DEPRECATED_WARNINGS
      
      # You can also make your code fail to compile if you use deprecated APIs.
      # In order to do so, uncomment the following line.
      # You can also select to disable deprecated APIs only up to a certain version of Qt.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      SOURCES += \
              main.cpp
      
      RESOURCES += qml.qrc
      
      # Additional import path used to resolve QML modules in Qt Creator's code model
      QML_IMPORT_PATH =
      
      # Additional import path used to resolve QML modules just for Qt Quick Designer
      QML_DESIGNER_IMPORT_PATH =
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /opt/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      

      Fehlt was?

      Danke

      1 Reply Last reply
      0
      • G Offline
        G Offline
        Galilio
        wrote on last edited by
        #11

        @J-Hilk
        Guten Morgen
        Sorry für die Störung
        Kannst du mir bitte nicht weiter helfen.

        Danke

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Galilio
          wrote on last edited by
          #12

          Wenn ich einen breakpoint in main.cpp setze, dann hält sich die App bei diesem breakpoint aber die Änderung auf QML seite werden nicht übernommen.

          J.HilkJ 1 Reply Last reply
          0
          • G Galilio

            Wenn ich einen breakpoint in main.cpp setze, dann hält sich die App bei diesem breakpoint aber die Änderung auf QML seite werden nicht übernommen.

            J.HilkJ Offline
            J.HilkJ Offline
            J.Hilk
            Moderators
            wrote on last edited by
            #13

            @Galilio
            Vorschlag,

            da es ja anscheinend kein großes Projekt ist, warum postet du nicht den QuellCode von dem was du gemacht hast, und wir sehen was wir machen können.


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            1 Reply Last reply
            0
            • G Offline
              G Offline
              Galilio
              wrote on last edited by Galilio
              #14

              Ich habe es einen QtQuick_Application_Scroll erstellt.
              Das Projeckt ist schon erstellt.
              Build lässt sich auch einwandfrei funktionieren.
              Die Source code sehen dann so aus:
              --> main.cpp

              #include <QGuiApplication>
              #include <QQmlApplicationEngine>
              
              int main(int argc, char *argv[])
              {
                  QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
              
                  QGuiApplication app(argc, argv);
              
                  QQmlApplicationEngine engine;
                  engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
                  if (engine.rootObjects().isEmpty())
                      return -1;
              
                  return app.exec();
              }
              

              main.qml

              import QtQuick 2.9
              import QtQuick.Controls 2.2
              
              ApplicationWindow {
                  visible: true
                  width: 640
                  height: 480
                  title: qsTr("Scroll")
              
                  ScrollView {
                      anchors.fill: parent
              
                      ListView {
                          width: parent.width
                          model: 20
                          delegate: ItemDelegate {
                              text: "Item " + (index + 1)
                              width: parent.width
                          }
                      }
                  }
              }
              

              das pro File sieht so aus:

              QT += quick
              CONFIG += c++11
              
              # The following define makes your compiler emit warnings if you use
              # any feature of Qt which as been marked deprecated (the exact warnings
              # depend on your compiler). Please consult the documentation of the
              # deprecated API in order to know how to port your code away from it.
              DEFINES += QT_DEPRECATED_WARNINGS
              
              # You can also make your code fail to compile if you use deprecated APIs.
              # In order to do so, uncomment the following line.
              # You can also select to disable deprecated APIs only up to a certain version of Qt.
              #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
              
              SOURCES += \
                      main.cpp
              
              RESOURCES += qml.qrc
              
              # Additional import path used to resolve QML modules in Qt Creator's code model
              QML_IMPORT_PATH =
              
              # Additional import path used to resolve QML modules just for Qt Quick Designer
              QML_DESIGNER_IMPORT_PATH =
              
              # Default rules for deployment.
              qnx: target.path = /tmp/$${TARGET}/bin
              else: unix:!android: target.path = /opt/$${TARGET}/bin
              !isEmpty(target.path): INSTALLS += target
              
              

              --> an dem main.qml ändere ich diese Zeile:
              von: title: qsTr("Scroll") zu: title: qsTr("dfsdfjkhskdfhksjd")

              Ich starte das Projekt neu mit qmake "Debug"

              Der Title des GUIs ist gleich geblieben "Scroll" stattt "dfsdfjkhskdfhksjd"

              1 Reply Last reply
              0
              • G Offline
                G Offline
                Galilio
                wrote on last edited by
                #15

                Wenn ich unter Build-Einstellung das Häckchen Qt Quick Compiler setze
                und in der pro File folgenden einfüge:

                OTHER_FILES += main.qml
                

                dann werden alle Änderungen, die auf QML Seite gemacht wurden direkt in Debug-Modus
                sichtbar

                Muss ich immer so machen?

                G 1 Reply Last reply
                0
                • G Galilio

                  Wenn ich unter Build-Einstellung das Häckchen Qt Quick Compiler setze
                  und in der pro File folgenden einfüge:

                  OTHER_FILES += main.qml
                  

                  dann werden alle Änderungen, die auf QML Seite gemacht wurden direkt in Debug-Modus
                  sichtbar

                  Muss ich immer so machen?

                  G Offline
                  G Offline
                  Galilio
                  wrote on last edited by
                  #16

                  @J-Hilk
                  Problem hast sich gelöst.
                  Es lag daran, dass das Projekt auf dem Netzwerk lag.
                  Es scheint, dass Qt damit Probleme hat.

                  J.HilkJ 1 Reply Last reply
                  1
                  • G Galilio

                    @J-Hilk
                    Problem hast sich gelöst.
                    Es lag daran, dass das Projekt auf dem Netzwerk lag.
                    Es scheint, dass Qt damit Probleme hat.

                    J.HilkJ Offline
                    J.HilkJ Offline
                    J.Hilk
                    Moderators
                    wrote on last edited by
                    #17

                    @Galilio
                    danke für die Info. Auf dies, als die Fehlerursache, wär ich so ohne weiteres auch nicht gekommen.
                    Gut das du es gefunden hast.

                    Viel Erfolg noch!


                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                    Q: What's that?
                    A: It's blue light.
                    Q: What does it do?
                    A: It turns blue.

                    G 1 Reply Last reply
                    0
                    • J.HilkJ J.Hilk

                      @Galilio
                      danke für die Info. Auf dies, als die Fehlerursache, wär ich so ohne weiteres auch nicht gekommen.
                      Gut das du es gefunden hast.

                      Viel Erfolg noch!

                      G Offline
                      G Offline
                      Galilio
                      wrote on last edited by
                      #18

                      @J.Hilk
                      Was ich gemerkt habe ist, dass das Projektname nicht grosser als 128 zeichen sein darf.
                      Ist so der Fall, dann werden die Änderungen nicht sichtbar sein.

                      jsulmJ J.HilkJ 2 Replies Last reply
                      0
                      • G Galilio

                        @J.Hilk
                        Was ich gemerkt habe ist, dass das Projektname nicht grosser als 128 zeichen sein darf.
                        Ist so der Fall, dann werden die Änderungen nicht sichtbar sein.

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #19

                        @Galilio said in QML Projekt "Hello World":

                        Projektname nicht grosser als 128 zeichen sein darf

                        Projektname oder Pfad zum Project?

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        G 1 Reply Last reply
                        0
                        • G Galilio

                          @J.Hilk
                          Was ich gemerkt habe ist, dass das Projektname nicht grosser als 128 zeichen sein darf.
                          Ist so der Fall, dann werden die Änderungen nicht sichtbar sein.

                          J.HilkJ Offline
                          J.HilkJ Offline
                          J.Hilk
                          Moderators
                          wrote on last edited by
                          #20

                          @Galilio said in QML Projekt "Hello World":

                          Was ich gemerkt habe ist, dass das Projektname nicht grosser als 128 zeichen sein darf.

                          128 ? das normale Limit für Windows/NTFS systeme ist 260


                          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                          Q: What's that?
                          A: It's blue light.
                          Q: What does it do?
                          A: It turns blue.

                          1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @Galilio said in QML Projekt "Hello World":

                            Projektname nicht grosser als 128 zeichen sein darf

                            Projektname oder Pfad zum Project?

                            G Offline
                            G Offline
                            Galilio
                            wrote on last edited by
                            #21

                            @jsulm
                            Pfad zu Projekt

                            1 Reply Last reply
                            0
                            • G Offline
                              G Offline
                              Galilio
                              wrote on last edited by
                              #22

                              Hallo Zusammen,

                              kann es sein, dass diese Problematik nur in der aktuelle Version.
                              Kollegen meinen, dass in der alten Version nicht der Fall sein!!

                              Danke

                              1 Reply Last reply
                              0

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved