Results 1 to 12 of 12

Thread: ComboBox Model inside Listview

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: ComboBox Model inside Listview

    Quote Originally Posted by Binary01 View Post
    @anda_skao
    Yes, individual models per listview delegate
    See, wasn't that hard

    Since you need to access the individual models from outside the delegate, they need to be defined outside the delegates.

    E.g. a lists of models, or having the combobox models as roles of the main model

    Cheers,
    _

  2. #2
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: ComboBox Model inside Listview

    No, combobox's models should be inside the delagate, if they was outside delegate = other result

    Regards,

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: ComboBox Model inside Listview

    Quote Originally Posted by Binary01 View Post
    No, combobox's models should be inside the delagate, if they was outside delegate = other result
    Ok, I am curious: how would that affect the result?

    Cheers,
    _

  4. #4
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: ComboBox Model inside Listview

    I have an other button in my window, that adds (onClicked) an other delegate (rectangle) in Listview.
    Combobox are editable, if I change a value in a delegate, the others take the same value.

    Regards

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: ComboBox Model inside Listview

    Quote Originally Posted by Binary01 View Post
    Combobox are editable, if I change a value in a delegate, the others take the same value.
    Now I am confused.
    This sounds like you want the combobox models to be the same, not independent.

    In comment #5 you claimed that the combobox models would need to be different.

    Which one is it?

    Cheers,
    _

  6. #6
    Join Date
    Jan 2016
    Posts
    54
    Thanks
    7
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: ComboBox Model inside Listview

    Quote Originally Posted by Binary01 View Post
    Combobox are editable, if I change a value in a delegate, the others take the same value.

    Regards
    This comment for explain why the models should be outside the delegate

    >> The combobox models would need to be different (independent)

    Regards,

  7. #7
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: ComboBox Model inside Listview

    Quote Originally Posted by Binary01 View Post
    This comment for explain why the models should be outside the delegate
    That is what I suggested in comment #6 to which you replied with a claim that this would result in different behavior.
    When I ask why you think that is you reply with a comment suggesting to share a model across comboboxes?

    Please clarify whether the comboxes are independent or not and separately why you think that having the models instantiated outside the delegates would somehow change behavior.

    Cheers,
    _

Similar Threads

  1. QML/C++ Master/Detail ComboBox/Listview
    By lqsa in forum Qt Quick
    Replies: 3
    Last Post: 20th July 2016, 14:19
  2. Listview inside repeater - model
    By Qmyo in forum Qt Quick
    Replies: 1
    Last Post: 17th May 2016, 16:24
  3. ListView problem with c++ model
    By nick85 in forum Qt Quick
    Replies: 7
    Last Post: 12th September 2013, 09:33
  4. ListView inside another element
    By Dp0H in forum Qt Quick
    Replies: 0
    Last Post: 24th September 2012, 12:44
  5. How to set custom height for ListView & ComboBox items
    By rawfool in forum Qt Programming
    Replies: 1
    Last Post: 30th September 2011, 10:39

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.