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. Back button functionality and multiple times statement execution in Component.onCompleted

Back button functionality and multiple times statement execution in Component.onCompleted

Scheduled Pinned Locked Moved QML and Qt Quick
1 Posts 1 Posters 662 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.
  • R Offline
    R Offline
    Rambo
    wrote on last edited by
    #1

    Hi,
    I am developing an app which is for now mainly for Android. There are 1-2 points that I want to discuss, which are as follows:

    1. Back button functionality in app

    For this I have searched and tried many things I have like two main screen in app containing sub components in it. When I am trying to switch from second screen to first screen using Keys.onReleased button click handler on second screen, it is actually not going inside handler. Here is code snippet
    @Item {
    id: student_home_page;
    focus: true

    // ///////////////////////////////////////////////////////////////

    Keys.onReleased: {
    console.log("TEST for Back ");
    if (event.key == Qt.Key_Back) {
    console.log("BAck Button HAndled");
    event.accepted = true;
    }
    }
    }@

    So could anyone guide me what I am doing wrong I tried to override onBackPressed in android too but did not work.

    1. Sometimes when I push or pop between two pages the statements in Component.onCompleted executes more then once usually three times. This is causing serious performance issues as I am processing some json strings there. So I research about it and found something but I need to resolved for sure. so Any suggestions on this too.

    searched link that I found "Fast Forwarding ":http://qt-project.org/doc/qt-4.8/qdeclarativestates.html#state-fast-forwarding

    Thanks in adavnce

    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