Results 1 to 4 of 4

Thread: [delegate] wrong commit for boolean

  1. #1
    Join Date
    May 2006
    Posts
    55
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default [delegate] wrong commit for boolean

    Hi
    Has anybody used the default delegate (QItemDelegate)
    on a default model (QStandardItemModel) with a boolean column ?
    For display things are OK at first : "true" or "false"
    edition start quite well, too : a combobox with "false" and "true" appears,
    then when committing the change, an int value is poured into the model
    in stead of a boolean, it seems.
    Has anybody faced such a behaviour ? What can I have missed ?
    Thx in advance.

    Laurent G.

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: [delegate] wrong commit for boolean

    All the values of a model are QVariants, so it does not really matter if an int or something else is fed into the model as long as it converts properly into a boolean.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: [delegate] wrong commit for boolean

    Task Tracker: 125584 - QItemDelegate::setModelData() does not handle boolean values
    J-P Nurmi

  4. The following user says thank you to jpn for this useful post:

    lauranger (26th October 2006)

  5. #4
    Join Date
    May 2006
    Posts
    55
    Thanks
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: [delegate] wrong commit for boolean

    Thanks jpn.

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.