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-Project in cpp einbinden

QML-Project in cpp einbinden

Scheduled Pinned Locked Moved Unsolved German
7 Posts 2 Posters 1.0k 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.
  • L Offline
    L Offline
    Linex
    wrote on last edited by Linex
    #1

    Hallo,
    ich habe ein QML-Project das mir in einem Rectangle RSS-Feeds anzeigt. Analog zum RSS-Example von Qt.
    Das Projekt kann ich mit dem Creator auch ausführen und läuft einwandfrei.
    Nun möchte ich das QML in eine MainWindow-Applikation einbauen bzw. dort z.B. per Button-Click aufrufen.

    Leider hab ich in der Doku noch keinen Weg gefunden, wie das zu bewerkstelligen ist.

    projekt.pro
    QT += core gui quick network qml

    main.cpp
    QGuiApplication app(argc, argv);
    QQmlApplicationEngine engine;
    engine.load(QUrl::fromLocalFile("RssInfo.qml"));
    return app.exec();

    Fehlermeldung
    loaded library "crypto"
    loaded library "ssl"
    qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_ciphersuites
    qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_use_session_callback
    qt.network.ssl: QSslSocket: cannot call unresolved function SSL_set_psk_use_session_callback
    qt.network.ssl: QSslSocket: cannot call unresolved function SSL_set_psk_use_session_callback
    qt.network.ssl: QSslSocket: cannot call unresolved function SSL_set_psk_use_session_callback

    Die Meldung kommt auch wenn ich in meiner qml "nur" ein einfaches ApplicationWindow erstelle.

    ApplicationWindow {
    id: applicationWindow
    visible: true
    width: 640
    height: 400
    title: qsTr("Rss-Feed")
    }
    Zumindest wird das mit dem build-QML-Preview angezeigt. Irgendwie komm ich nicht weiter.....

    J.HilkJ 1 Reply Last reply
    0
    • L Linex

      Hallo,
      ich habe ein QML-Project das mir in einem Rectangle RSS-Feeds anzeigt. Analog zum RSS-Example von Qt.
      Das Projekt kann ich mit dem Creator auch ausführen und läuft einwandfrei.
      Nun möchte ich das QML in eine MainWindow-Applikation einbauen bzw. dort z.B. per Button-Click aufrufen.

      Leider hab ich in der Doku noch keinen Weg gefunden, wie das zu bewerkstelligen ist.

      projekt.pro
      QT += core gui quick network qml

      main.cpp
      QGuiApplication app(argc, argv);
      QQmlApplicationEngine engine;
      engine.load(QUrl::fromLocalFile("RssInfo.qml"));
      return app.exec();

      Fehlermeldung
      loaded library "crypto"
      loaded library "ssl"
      qt.network.ssl: QSslSocket: cannot resolve SSL_CTX_set_ciphersuites
      qt.network.ssl: QSslSocket: cannot resolve SSL_set_psk_use_session_callback
      qt.network.ssl: QSslSocket: cannot call unresolved function SSL_set_psk_use_session_callback
      qt.network.ssl: QSslSocket: cannot call unresolved function SSL_set_psk_use_session_callback
      qt.network.ssl: QSslSocket: cannot call unresolved function SSL_set_psk_use_session_callback

      Die Meldung kommt auch wenn ich in meiner qml "nur" ein einfaches ApplicationWindow erstelle.

      ApplicationWindow {
      id: applicationWindow
      visible: true
      width: 640
      height: 400
      title: qsTr("Rss-Feed")
      }
      Zumindest wird das mit dem build-QML-Preview angezeigt. Irgendwie komm ich nicht weiter.....

      J.HilkJ Online
      J.HilkJ Online
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @Linex said in QML-Project in cpp einbinden:

      QUrl::fromLocalFile("RssInfo.qml")

      Hi, ich verstehe nicht ganz deine Situation, vielleicht würdest du da nochmal ein wenig ausholen und mehr erklären

      aber von dem was ich sehe, würde ich sagen QUrl::fromLocalFile("RssInfo.qml") ist der Übeltäter.

      Die fertige exe Datei liegt nicht im selben Verzeichnis wie dein Projekt -> wird in dem Ordner die RssInfo.qml nicht finden, weil nicht vorhanden.

      Ich würde empfehlen das Qt Ressourcen System zu nutzen und die QML Datei da rein packen und von dort zu laden


      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
      1
      • L Offline
        L Offline
        Linex
        wrote on last edited by
        #3

        Danke :-)
        War tatsächlich am Pfad gelegen. Hab's über die Resouces gelöst und geht.

        J.HilkJ 1 Reply Last reply
        1
        • L Linex

          Danke :-)
          War tatsächlich am Pfad gelegen. Hab's über die Resouces gelöst und geht.

          J.HilkJ Online
          J.HilkJ Online
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Linex Super!

          Nicht vergessen, TopicTools verwenden und Topic auf gelöst stellen 😉


          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
          • L Offline
            L Offline
            Linex
            wrote on last edited by
            #5

            Noch eine kurze Frage. Kann ich ein QML auf ein Widget legen?

            J.HilkJ 1 Reply Last reply
            0
            • L Linex

              Noch eine kurze Frage. Kann ich ein QML auf ein Widget legen?

              J.HilkJ Online
              J.HilkJ Online
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @Linex

              sicher

              https://doc.qt.io/qt-5/qquickwidget.html
              https://doc.qt.io/qt-5/qquickview.html

              aber ich hab 1- 2 Fehler in gemischten Projekten gefunden(hauptsächlich für Mobile Endgeräte ) also, mit Vorsicht genießen 😉


              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
              • L Offline
                L Offline
                Linex
                wrote on last edited by
                #7

                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