Using PlaceHolder data in Qt Design Studio 4.2.0
-
wrote on 29 Aug 2023, 03:06 last edited by nguyenbinh
Hello,
I've seen PlaceHolder feature in Qt Design Studio (Link: https://doc.qt.io/qtdesignstudio/qtquick-placeholder-data.html) and have been trying to use it but haven't succeed yet, I followed instructions:
Project files structure:Example.qmlproject qtquickcontrols2.conf qml/example.qml dummydata/dataModel.qml
File
Example.qmlproject
:import QmlProject Project { mainFile: "qml/example.qml" mainUiFile: "qml/example.qml" QmlFiles { directory: "qml" } JavaScriptFiles { directory: "qml" } ImageFiles { directory: "qml" } Files { filter: "*.conf" files: ["qtquickcontrols2.conf"] } qt6Project: true qdsVersion: "4.2" quickVersion: "6.5" multilanguageSupport: true supportedLanguages: ["en"] primaryLanguage: "en" }
File
qtquickcontrols2.conf
:[Controls] Style=Basic
File
qml/example.qml
:import QtQuick import QtQuick.Controls ListView { width: 600 height: 800 model: dataModel delegate: ItemDelegate { width: ListView.view.width text: name } }
File
dummydata/dataModel.qml
:import QtQuick 2.0 ListModel { ListElement { name: "Ariane" } ListElement { name: "Bella" } ListElement { name: "Corinna" } }
What I'm expecting is the dummy data should shown up in design UI but nothing happen in 2D view of Qt Design Studio 4.2.0 (I've tried to restart Qt Design Studio several times):
Am I missing something and has anyone used this feature successfully before?
1/1