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. Qml list disappeare and not visible sometimes

Qml list disappeare and not visible sometimes

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

    I have this code here to implement simple Qml List as an example from QMl reference.
    The list doesn't appear at all.
    bd56c4a5-b943-4ce3-a030-0a57b4f9ba84-image.png b394413d-2ed5-4728-b0f5-2dc59716c521-image.png

    This's the code

    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtQuick.Controls 2.15
    
    Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    
    
        ListModel {
            ListElement {
                name: "Bill Smith"
                number: "555 3264"
            }
            ListElement {
                name: "John Brown"
                number: "555 8426"
            }
            ListElement {
                name: "Sam Wise"
                number: "555 0473"
            }
        }
    }
    
    

    The list I want to do is this one. but the begining not even working.

    The list I want to do

    1 Reply Last reply
    0
    • MarkkyboyM Offline
      MarkkyboyM Offline
      Markkyboy
      wrote on last edited by
      #2

      You're not setting a ListView to display the ListModel, see here for answer;

      https://forum.qt.io/topic/134573/simple-listmodel-example

      Don't just sit there standing around, pick up a shovel and sweep up!

      I live by the sea, not in it.

      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