From 485d039e7b8ddb150b0f9723cfb08815eb843cba Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Sun, 2 Aug 2015 18:45:42 +0200 Subject: filesystembrowser: Improve example by exposing model roles This is one of the biggest API shortcomings we currently have when exposing C++ models to QML. The least we can do is make our examples more readable, and hint the users how to make their apps a bit better. Change-Id: I25f51ef393bbd0c9bf7bab48b705a672881d80c1 Reviewed-by: Friedemann Kleint Reviewed-by: Mitch Curtis --- examples/quick/controls/filesystembrowser/main.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples/quick/controls/filesystembrowser/main.qml') diff --git a/examples/quick/controls/filesystembrowser/main.qml b/examples/quick/controls/filesystembrowser/main.qml index b85002d5e..6e79ca618 100644 --- a/examples/quick/controls/filesystembrowser/main.qml +++ b/examples/quick/controls/filesystembrowser/main.qml @@ -41,6 +41,7 @@ import QtQuick 2.2 import QtQuick.Controls 1.5 import QtQml.Models 2.2 +import io.qt.examples.quick.controls.filesystembrowser 1.0 ApplicationWindow { visible: true @@ -120,6 +121,9 @@ ApplicationWindow { resizable: true } - onActivated : Qt.openUrlExternally(fileSystemModel.data(index, 263)) + onActivated : { + var url = fileSystemModel.data(index, FileSystemModel.UrlStringRole) + Qt.openUrlExternally(url) + } } } -- cgit v1.2.3