Results 1 to 3 of 3

Thread: How to show list of labels taken from QMap?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Location
    Poland
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2
    Thanked 4 Times in 1 Post

    Default How to show list of labels taken from QMap?

    Hi

    I've created QMap of <String, MyClassItem> and I need to list all items in that map, by showing MyClassItemObject.name. I also would like to edit/remove an MyClassItemObject by selecting it on the list and pushing a button (causing new dialog to appear).
    My first thought was to subclass QListWidgetItem, adding a pointer to object that has the same name as QListWidgetItem.text. Is that a good or bad idea?

  2. #2
    Join Date
    Apr 2011
    Location
    Poland
    Posts
    10
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    2
    Thanked 4 Times in 1 Post

    Default Re: How to show list of labels taken from QMap?

    BUMP.

    I created an image to show exactly what I need.


    Uploaded with ImageShack.us

    ANY advice would be useful.

  3. #3
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android
    Thanked 342 Times in 324 Posts

    Default Re: How to show list of labels taken from QMap?

    Is that a good or bad idea?
    You should give it a try, you'll have access to the subclassed QListWidgetItem when you connect to "itemClicked()" signal from QListWidget, and dynamic_cast the passed QListWidgetItem pointer, so this should work.

Similar Threads

  1. Replies: 1
    Last Post: 23rd April 2011, 17:33
  2. How to show all labels
    By Patrik in forum Qwt
    Replies: 3
    Last Post: 19th January 2011, 01:54
  3. List View with sections for alphabetialy sorted list
    By woodtluk in forum Qt Programming
    Replies: 4
    Last Post: 12th October 2010, 11:50
  4. Replies: 3
    Last Post: 12th July 2010, 13:12

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.