Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Cannot include QDeclarative Item

Cannot include QDeclarative Item

Scheduled Pinned Locked Moved QML and Qt Quick
26 Posts 3 Posters 8.5k 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.
  • P Offline
    P Offline
    p3c0
    Moderators
    wrote on 20 Feb 2015, 08:39 last edited by
    #21

    Since you already have paths, you can just send the path string from QML to C++ and then there access that image.

    157

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Javeria
      wrote on 20 Feb 2015, 08:44 last edited by
      #22

      But I want to edit that image and send it back to qml so that it displays it in the ui

      1 Reply Last reply
      0
      • P Offline
        P Offline
        p3c0
        Moderators
        wrote on 20 Feb 2015, 08:51 last edited by
        #23

        Do you have paths for the Images in QML ?

        If yes, then as said earlier, send the path string from QML to C++, open the image, process it, on C++ side(or whatever operations), then signal QML to display that image.

        157

        1 Reply Last reply
        0
        • J Offline
          J Offline
          JKSH
          Moderators
          wrote on 20 Feb 2015, 08:52 last edited by
          #24

          Read the blog post and the comments at http://pusling.com/blog/?p=369

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • J Offline
            J Offline
            Javeria
            wrote on 22 Feb 2015, 11:10 last edited by
            #25

            I have decided to use Qstring and i have followed this link to assign path:
            Link: http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html (The properties part)
            But im getting this error
            Invalid attached object assignment

            QQmlComponent: Component is not ready

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Javeria
              wrote on 22 Feb 2015, 11:23 last edited by
              #26

              @onClicked: {
              m.image=imagesListModel[index];
              main.source=m.imagesListModel[index]

                             // console.log("User select '"+"' image");
                           }@
              

              m is the Detectsquares object and i m setting the path and then assigning the path to the main image
              Here is the code im main.cpp:
              @
              QApplication app(argc, argv);
              // QQmlEngine eng;

              QQmlApplicationEngine engine;
              engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
              DetectSquares m;
              engine.rootContext()->setContextProperty("m",&m);
               QQmlComponent component(&engine, QUrl::fromLocalFile("qrc:/main.qml"));
               component.create();
              

              @

              1 Reply Last reply
              0

              21/26

              20 Feb 2015, 08:39

              • Login

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