IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Qt Insight - Qt Quick Application

A Qt Quick application using Qt Insight Tracker.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Qt Insight - Qt Quick Application

Image non disponible

Running the Example

To run the example from Qt Creator, open the Welcome mode and select the example from Examples. For more information, visit Building and Running an Example.

The example shows how to integrate Qt Insight Tracker to your Qt Quick application.

In the example, InsighTracker singleton is configured and then enabled.

 
Sélectionnez
InsightConfiguration {
    syncInterval: 60
}

Component.onCompleted: InsightTracker.enabled = true;

The example is using states to control the UI layouts. Qt Insight can be then easily used to track the UI flow.

 
Sélectionnez
    onStateChanged: InsightTracker.sendScreenView(applicationFlow.state);

Button presses can also be tracked.

 
Sélectionnez
    MouseArea {
        anchors.fill: parent
        onClicked: {
            root.clicked()
            InsightTracker.sendClickEvent(root.text, root.InsightCategory.category, mouseX, mouseY);
        }
        onPressed: {
            glow.visible = true
            animation1.start()
            animation2.start()
        }
    }

An attached property InsightCategory can be used in the QML components. It can be used to filter the tracked events.

 
Sélectionnez
        CoffeeButton {
            id: cappuccinoButton
            text: "Cappuccino"
            InsightCategory.category: "coffee"
        }

Tracked events are always associated with a session, which is always new for each application launch. A new session can also be created if needed. In the example, this is done when the UI is reset back to the initial state.

 
Sélectionnez
        ScriptAction {
            script: InsightTracker.startNewSession();
        }

Example project

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+