Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Using PlaceHolder data in Qt Design Studio 4.2.0
Forum Updated to NodeBB v4.3 + New Features

Using PlaceHolder data in Qt Design Studio 4.2.0

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 223 Views
  • 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.
  • N Offline
    N Offline
    nguyenbinh
    wrote on 29 Aug 2023, 03:06 last edited by nguyenbinh
    #1

    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):
    38e05a64-d2f3-4dd3-bd57-54ad5273b7fe-image.png

    Am I missing something and has anyone used this feature successfully before?

    1 Reply Last reply
    0

    1/1

    29 Aug 2023, 03:06

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved