Results 1 to 2 of 2

Thread: initialize error of ComboBox : Cannot read property 'constructor' of undefined

  1. #1
    Join Date
    Jan 2011
    Posts
    127
    Thanks
    42
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default initialize error of ComboBox : Cannot read property 'constructor' of undefined

    When I try to initialize the model of ComboBox, weird error pop out

    Qt Code:
    1. import QtQuick 2.2
    2. import QtQuick.Controls 1.1
    3.  
    4. Rectangle {
    5. width: 100
    6. height: 62
    7.  
    8. ListModel{
    9. id: modelA
    10. }
    11.  
    12. ComboBox{
    13. model: modelA
    14. }
    15.  
    16. Component.onCompleted: {
    17. modelA.append({"source" : "hhhh"})
    18. }
    19. }
    To copy to clipboard, switch view to plain text mode 

    error message

    file:///C:/Qt/Qt5.2.0/5.2.0/mingw48_32/qml/QtQuick/Controls/ComboBox.qml:496: TypeError: Cannot read property 'constructor' of undefined

    How could I fix this error?

  2. #2
    Join Date
    Jan 2011
    Posts
    127
    Thanks
    42
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: initialize error of ComboBox : Cannot read property 'constructor' of undefined

    Found the solution, use loader to load the ComboBox when insert or http://stackoverflow.com/questions/2...47640_20833809
    Last edited by stereoMatching; 30th December 2013 at 15:00.

Similar Threads

  1. Replies: 1
    Last Post: 1st July 2013, 14:27
  2. Technique to read file property details in Windows 7
    By astodolski in forum General Programming
    Replies: 3
    Last Post: 2nd March 2013, 08:37
  3. Exposing a Qt container property to QtScript, READ and WRITE
    By SingleMalt in forum Qt Programming
    Replies: 6
    Last Post: 12th May 2011, 07:31
  4. member function to read data from a combobox
    By babygal in forum Qt Programming
    Replies: 2
    Last Post: 17th August 2010, 11:44
  5. Replies: 2
    Last Post: 25th September 2009, 14:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.