Results 1 to 5 of 5

Thread: [Qt4]: Adding centered items in QListWidget

  1. #1
    Join Date
    Feb 2006
    Posts
    24
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default [Qt4]: Adding centered items in QListWidget

    Hello,

    I want to add some items centered into a QListWidget. The Widget stretches along the left side of a dialog, it's about 100px wide, and 600px high.
    The items I add have an icon, and some text under it. At the moment the items are aligned on the left side of the QListWidget, so the icons are not at one line.
    How can I show the items centered, not by text, but by the icon?

    Thanks for help,
    Johannes

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

    Default Re: [Qt4]: Adding centered items in QListWidget

    Quote Originally Posted by Jojo
    I want to add some items centered into a QListWidget.
    Centered horizontally, vertically, uh oh what?

    Quote Originally Posted by Jojo
    The items I add have an icon, and some text under it.
    So the view mode is icon mode?

    Quote Originally Posted by Jojo
    At the moment the items are aligned on the left side of the QListWidget, so the icons are not at one line.
    How can I show the items centered, not by text, but by the icon?
    Sorry, but would you mind supplying an example image of what you're trying to achive?
    It doesn't seem very clear or at least I can't understand you..

  3. #3
    Join Date
    Feb 2006
    Posts
    24
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [Qt4]: Adding centered items in QListWidget

    Hello,

    sorry, I couldn't reply earlier.
    I know have a screenshot which makes the problem obvious I think. The items shall be centered vertically in the list. Also atm the list widget is sized to exactly match the width of the currently selected item, this behaviour makes longer entries appear clipped. This is also appearent in the screenshot:
    Here is a link: http://img20.imageshack.us/my.php?image=shot6ia.png

    Thanks for helping me with this issue, I've found no way yet to archieve what I want.

    Bye,
    Jojo

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

    Default Re: [Qt4]: Adding centered items in QListWidget

    Try turning property uniform item sizes on.

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

    Jojo (16th March 2006)

  6. #5
    Join Date
    Feb 2006
    Posts
    24
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: [Qt4]: Adding centered items in QListWidget

    Thanks, this works

Similar Threads

  1. How to make QListWidget items editable?
    By montylee in forum Qt Programming
    Replies: 14
    Last Post: 3rd October 2008, 09:57
  2. Replies: 1
    Last Post: 5th September 2008, 23:54
  3. Get Visible Items from the QListWidget
    By srj in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2006, 20:13

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.