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. accelBubble Tutorial
Qt 6.11 is out! See what's new in the release blog

accelBubble Tutorial

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 608 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.
  • G Offline
    G Offline
    guestu
    wrote on last edited by
    #1

    I have tried to start mobile development with the "Creating a Mobile Qt Application" Tutorial. I have installed Qt Creator 4.9.2 on Windows 10 (1903). I connected a Android Device (Wiko Pulp, Android 5.1) with my Computer and compiled the project (after solving a few problems - qmake.conf). When I execute the project, it is installed on my Android device. But the bubble does not move. In the "output of application" tab the is an error: "W/libaccelbubble.so(18015): qrc:/main.qml:115: ReferenceError: mainWindow is not defined"

    There is an example accelBubble also in the Qt 5.13.0 directory without pages. This examples runs without problems, but I want to understand, why the tutorial example does not work.

    JKSHJ 1 Reply Last reply
    0
    • G guestu

      I have tried to start mobile development with the "Creating a Mobile Qt Application" Tutorial. I have installed Qt Creator 4.9.2 on Windows 10 (1903). I connected a Android Device (Wiko Pulp, Android 5.1) with my Computer and compiled the project (after solving a few problems - qmake.conf). When I execute the project, it is installed on my Android device. But the bubble does not move. In the "output of application" tab the is an error: "W/libaccelbubble.so(18015): qrc:/main.qml:115: ReferenceError: mainWindow is not defined"

      There is an example accelBubble also in the Qt 5.13.0 directory without pages. This examples runs without problems, but I want to understand, why the tutorial example does not work.

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi @guestu, and welcome!

      @guestu said in accelBubble Tutorial:

      qrc:/main.qml:115: ReferenceError: mainWindow is not defined

      The error message tells you that Line #115 contains a reference to mainWindow, but this ID does not exist.

      It is like an undefined variable in C++.

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

      G 1 Reply Last reply
      2
      • JKSHJ JKSH

        Hi @guestu, and welcome!

        @guestu said in accelBubble Tutorial:

        qrc:/main.qml:115: ReferenceError: mainWindow is not defined

        The error message tells you that Line #115 contains a reference to mainWindow, but this ID does not exist.

        It is like an undefined variable in C++.

        G Offline
        G Offline
        guestu
        wrote on last edited by
        #3

        @jksh
        Thank you,
        the problem I had, was that I didn't know how to announce the property "mainWindow" in the main.qml. With your answer I changed

                  Page1Form {
                      bubble {
                          id: bubble
                          centerX: mainWindow.width / 2
                          centerY: mainWindow.height / 2
                          bubbleCenter: bubble.width / 2
                          x: bubble.centerX - bubble.bubbleCenter 
        ...
        

        to

                  Page1Form {
                      mainWindow {
                        id: mainWindow
                      }
        
                      bubble {
                          id: bubble
                          centerX: mainWindow.width / 2
                          centerY: mainWindow.height / 2
                          bubbleCenter: bubble.width / 2
                          x: bubble.centerX - bubble.bubbleCenter
        ...
        

        Now the mainWindow is know and the application is running as expected.
        Thank you very much.

        1 Reply Last reply
        1

        • Login

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