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 ComboBox does not display the current item text of its model...
Forum Updated to NodeBB v4.3 + New Features

QML ComboBox does not display the current item text of its model...

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

    I'm using a ComboBox object to display data from a C++ model.
    The Combobox model is stuck to a QQmlListProperty<MyObject>.
    It looks like:

    ComboBox {
                  id: cbSubtitles
                  model: mediaPlayer.subtitleStreams
                  textRole: "title"
                  implicitHeight: 25
                  Layout.alignment: Qt.AlignLeft
                  Layout.leftMargin: 5
                  font.pointSize: 8
                  enabled: true
       }
    

    The subtitleStreams model is a QQmlListProperty().

    I can feed the list with data, it works.
    However, at first sight, nothing is displayed in the combobox. I mean , the current element.
    I have to drop-down the combobox one time to have all entries displayed and finally the current element.

    Is there something I missed ?

    Karim

    eyllanescE 1 Reply Last reply
    0
    • K Karim

      I'm using a ComboBox object to display data from a C++ model.
      The Combobox model is stuck to a QQmlListProperty<MyObject>.
      It looks like:

      ComboBox {
                    id: cbSubtitles
                    model: mediaPlayer.subtitleStreams
                    textRole: "title"
                    implicitHeight: 25
                    Layout.alignment: Qt.AlignLeft
                    Layout.leftMargin: 5
                    font.pointSize: 8
                    enabled: true
         }
      

      The subtitleStreams model is a QQmlListProperty().

      I can feed the list with data, it works.
      However, at first sight, nothing is displayed in the combobox. I mean , the current element.
      I have to drop-down the combobox one time to have all entries displayed and finally the current element.

      Is there something I missed ?

      Karim

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @Karim please provide a minimal and compilable example

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      0

      • Login

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