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. How to notify something outside if the module is loaded by loader
Forum Updated to NodeBB v4.3 + New Features

How to notify something outside if the module is loaded by loader

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 189 Views 2 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.
  • MihanM Offline
    MihanM Offline
    Mihan
    wrote on last edited by Mihan
    #1

    Hi all

    I want to check param from one module loaded by loader when it's active.

    For example, I want to show a window loaded by loader after the splash finished(visible: false)

    QtObject {
        id: root
    
        property QtObject splashScreen: Splash{
            id: splash
        }
    
        property var loader: Loader{
            source: "qrc:/MainWIndow.qml"
            asynchronous: true
            active: false
        }
    
        Component.onCompleted:{
            splashScreen.delay();
            loader.active = true;
            while(!splashScreen.visible)
                loader.show()
        }
    }
    

    Also, I want to communicate between Splash and Mainwindow, what should I do?

    Regards
    Mihan

    1 Reply Last reply
    0
    • fcarneyF Offline
      fcarneyF Offline
      fcarney
      wrote on last edited by
      #2

      Put Splash inside MainWindow.qml and have that file control when the Splash is shown.
      Add property to MainWindow.qml.

      You could do this in one file:

      Component {
        id: customMainWindow
        MainWindow {
          loader: true  // add this property to MainWindow
          Splash {
          }
          // add custom splash logic as needed
        }
      }
      
      Loader {
        sourceComponent: customMainWindow
      }
      

      C++ is a perfectly valid school of magic.

      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