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. ComboBox is empty when loaded by asynchronous Loader
Forum Update on Monday, May 27th 2025

ComboBox is empty when loaded by asynchronous Loader

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 973 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.
  • E Offline
    E Offline
    ebe4841
    wrote on 18 Dec 2013, 18:55 last edited by
    #1

    Hi,

    I am using an asynchronous Loader to load Qml components on demand.
    When using ComboBox (QtQuick.Controls) in the loaded component, the combobox popup is empty and very small (about 1x1 px). It looks like the model is not used at all.

    Here is a small example:
    @import QtQuick 2.0
    import QtQuick.Controls 1.0

    Rectangle {
    width: 360
    height: 160
    Row {
    Button {
    text: "Load Combobox"
    onClicked:
    {
    loader.active = true
    }
    }
    CheckBox {
    id:asyncCheckbox
    checked: true
    text: "asynchronous"

        }
    }
    Loader {
        id: loader
        asynchronous: asyncCheckbox.checked
        active: false
        anchors.centerIn: parent
        sourceComponent: cbPage
    }
    Component {
        id: cbPage
        ComboBox { width: 200; model: [ "Banana", "Apple", "Coconut" ]  }
    }
    

    }@

    Note that you can only load once and have to restart the application to load again.
    I am using Qt 5.1.1.

    Is this a bug in Qt?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      Vincent007
      wrote on 22 Dec 2013, 10:55 last edited by
      #2

      How do you release "cbPage" loaded by the loader before you load "cbPage" again by loader?

      1 Reply Last reply
      0

      1/2

      18 Dec 2013, 18:55

      • Login

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