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. QtQuick project with qt-components symbian
Forum Updated to NodeBB v4.3 + New Features

QtQuick project with qt-components symbian

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 2.8k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    AlterX
    wrote on last edited by
    #1

    Hi all,
    i'm trying that above in my project...well
    i've a big problem at run-time: ReferenceError: Can't find variable: checkUtil

    Ok, i'm not so newbie with that, but this is my initial code (in main.cpp):
    @
    QmlApplicationViewer viewer;
    MyClass checkUtil;

    viewer.setMainQmlFile(QLatin1String("qml/Repos/main.qml"));
    viewer.rootContext()->setContextProperty("checkUtil", &checkUtil);
    

    @

    So my var is declared and setted into context!

    Qt Ambassador
    Real-time cooperative teams: http://www.softairrealfight.net
    Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

    https://codereview.qt-project.org/...

    1 Reply Last reply
    0
    • T Offline
      T Offline
      thisisbhaskar
      wrote on last edited by
      #2

      Are you able to reference checkUtil inside your qml code??

      Can you try below code...
      @QmlApplicationViewer viewer;
      MyClass checkUtil;
      viewer.rootContext()->setContextProperty("checkUtil", &checkUtil);
      viewer.setMainQmlFile(QLatin1String("qml/Repos/main.qml"));
      @
      Just moved setContextProperty() above setMainQmlFile() :)

      1 Reply Last reply
      0
      • T Offline
        T Offline
        thisisbhaskar
        wrote on last edited by
        #3

        Ok... just tried out in my Qt Creator, the above should solve your problem. Basically you are setting contextProperty before its being referenced inside your qml file.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AlterX
          wrote on last edited by
          #4

          Damn!
          it obviously doesn't work if i set it after!!!
          thanks mate!

          Qt Ambassador
          Real-time cooperative teams: http://www.softairrealfight.net
          Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

          https://codereview.qt-project.org/...

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AlterX
            wrote on last edited by
            #5

            ohhh it's very beautiful work with QtQuick and Symbian/Meego components!
            I'm looking forward to stable components...

            Qt Ambassador
            Real-time cooperative teams: http://www.softairrealfight.net
            Free Real-time network platform sdk: https://github.com/AlterX76/Solomon

            https://codereview.qt-project.org/...

            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