Results 1 to 2 of 2

Thread: How to call component after the validation in main.qml?

  1. #1
    Join Date
    Jul 2016
    Posts
    53
    Thanks
    13
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default How to call component after the validation in main.qml?

    Hi,

    I am developing an app, which shows the products list fetch from server.

    First page will be Login.qml where the user authentication is written. ListItems.qml - I had created the listview which show list of products.
    In the main.qml, I am calling the login{} but the when the user is authenticated in Login.qml and I do not know how to get the value to main.qml and show the ListItems.qml.
    Independently both Login.qml and ListItems.qml is working.

    Code snippet:

    import QtQuick 2.3
    import QtQuick.Controls 1.2

    ApplicationWindow {
    id: appWindow
    width: 800
    height: 600
    title: "MissionMapsV1"

    Login {}

    //how to implement the login is successfull, ListItems has to be shown
    ListItems{}

    }//ApplicationWindow

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to call component after the validation in main.qml?

    javascript Code:
    1. Login {
    2. id: login
    3.  
    4. property bool authenticated: false
    5.  
    6. onSomething: authenticated = true
    7. }
    8.  
    9. ListItems {
    10. visible: login.authenticated
    11. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following 2 users say thank you to wysota for this useful post:

    Mathan (20th September 2016), pdoria (1st October 2016)

Similar Threads

  1. How to call member function from int main()
    By GussieBartlett in forum Qt Programming
    Replies: 3
    Last Post: 5th January 2012, 20:06
  2. Replies: 3
    Last Post: 5th August 2011, 22:39
  3. Replies: 2
    Last Post: 11th May 2009, 16:50
  4. Replies: 11
    Last Post: 11th August 2008, 09:14
  5. Replies: 1
    Last Post: 28th May 2008, 16:52

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.