Results 1 to 6 of 6

Thread: KListWidget item settings

  1. #1
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default KListWidget item settings

    I have a KListWidget which will be filled with some names by the user. And when the user selects one of the items. Each of those items has its own settings everywhere in the dialog, checkboxes, another KListWidget which can have many strings, spinboxes etc. And wondering what would be a good way to perform this kinda of work. I will have KConfigXT store it because I will have an option to import/export all of this too
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: KListWidget item settings

    I'd use a data model and something like QDataWidgetMapper to make sure all widgets get updated automatically when a new user is chosen.

  3. #3
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: KListWidget item settings

    Thank you didn't even know there was a Mapper for Data widgets. But the only problem is how can I make KConfigXT store it all. Because I don't think you can store stuff like that?
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: KListWidget item settings

    To be honest I have no idea how KConfigXT works but from what I see it is an xml file and a widget that can operate on it. If that is the case then creating a model out of the settings shouldn't be a problem and then you can use a mapper with it. Also storing a list in the file itself shouldn't be a problem, I'm sure it supports whatever QSettings supports and more and storing hierarchies (using groups or arrays) with QSettings is a usual thing to do.

    Just to make sure - we are talking KDE4 here, right?

  5. #5
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: KListWidget item settings

    Yeah I'm using 4.2.60 KDE. And KConfigDialog with the KConfigXT. Going to try and make all those warning disappear too. Because the UI isn't tired to the ServerPage yet.

    Network ServerList
    ------------ -------------------
    FreeNode ------------------------> irc.freenode.net, irc.freenode2.net
    EFNet ---------------------------> irc.efnet.org irc.efnet2.org

    Stuff like that so yeah. I'm looking through KDE4 docs but not finding nothing.
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

  6. #6
    Join Date
    Mar 2008
    Location
    Houston, Texas, USA
    Posts
    277
    Thanks
    9
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: KListWidget item settings

    Well I figured it out how to get it to work the only problem is that it's going to be a nightmare to implement . I have to write a custom KConfig setup to make the process a little easier and create the groups so that they appear like

    [Freenode]
    .....
    Servers=irc.freenode.net, irc.freenode2.net
    Channels=##C++,#Qt
    .....

    And just iterate through the group list and append them. Just need to read over the mapper and I should be good to go
    Qt-4.7.3 | Gentoo ~amd64 | KDE-4.7
    Aki IRC Client for KDE4 | Qt Documentation

Similar Threads

  1. ListWidget positions item
    By talex in forum Qt Programming
    Replies: 3
    Last Post: 21st October 2008, 16:16
  2. View, Scene, Item and thread??
    By dungsivn in forum Qt Programming
    Replies: 5
    Last Post: 20th August 2008, 20:21
  3. Item in a DLL not getting events
    By Benne Gesserit in forum Qt Programming
    Replies: 11
    Last Post: 16th August 2008, 23:30
  4. Item Delegate Painting
    By stevey in forum Qt Programming
    Replies: 3
    Last Post: 9th May 2008, 08:37
  5. Replies: 1
    Last Post: 19th April 2007, 23:23

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.