Results 1 to 3 of 3

Thread: Align to the center QListWidgetItems in QListWidget

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    18
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Align to the center QListWidgetItems in QListWidget

    Hi,

    I've got some icons in a QListWidget that I would like to center. I tried with "setViewMode(QListView::IconMode) but unfortunately the items are laid out using LeftToRight flow. And I would like the items to be laid out using TopToBottom flow like in QListView::ListMode and centered in the QListWidget.

    Is there any way to achieve that ?

  2. #2
    Join Date
    Oct 2009
    Location
    Mexico
    Posts
    81
    Thanks
    6
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Align to the center QListWidgetItems in QListWidget

    ry to use the function QListView::setFlow()
    Qt Code:
    1. MyListWidget->setFlow(QListView::TopToBottom);
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    18
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Align to the center QListWidgetItems in QListWidget

    Yep I tried that naturally but the resulting display is not the same. The text that was below an icon would be on its right which is not what I want...

    As I said, I would like the items to be laid out using TopToBottom flow like in QListView::ListMode and centered in the QListWidget. But without using QListView::ListMode...

Similar Threads

  1. QTabWidget align
    By AlexD in forum Qt Programming
    Replies: 6
    Last Post: 10th August 2012, 13:19
  2. QItemDelegate Align
    By aekilic in forum Qt Programming
    Replies: 43
    Last Post: 1st April 2009, 07:52
  3. How to align list items to the center?
    By zgulser in forum Qt Tools
    Replies: 4
    Last Post: 9th February 2009, 09:52
  4. reordering QListWidgetItems of a QListWidget
    By OriginalCopy in forum Qt Programming
    Replies: 14
    Last Post: 4th December 2007, 15:49
  5. Applying fonts to QListWidgetItems
    By L.Marvell in forum Qt Programming
    Replies: 4
    Last Post: 8th May 2006, 10:04

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.